- crates/vcs chunk.rs: chunks of a file (buffer text vs index, HEAD vs
index), a minimal patch applied with git apply --cached, revert as a
byte edit; token refusal when buffer, index or HEAD changed; CRLF
(autocrlf and stored), no final newline, BOM, staged renames, first
commit; binary and untracked refused. Real-git tests + property test.
- engine: git.chunks, git.stageChunk, git.unstageChunk, git.revertChunk
(revert edits the buffer under the lock, undoable in the editor);
cmd:
:start_then; git.lineChanges shares the vcs line diff.
- UI: chunk popup on a gutter marker click (Stage / Unstage / Revert /
Previous / Next), hollow staged markers, vcs.showChunk, diff viewer
hint, "partly staged" badge in the Changes window.
- Docs: G8 row, Git parity row evidence, ui-parity, architecture.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
721 lines
20 KiB
Vue
721 lines
20 KiB
Vue
<script setup lang="ts">
|
|
/**
|
|
* The Changes tool window (M4.2), shown in the bottom panel: the project's
|
|
* changed files from git in the groups Staged, Changes and Untracked, and
|
|
* a commit message box.
|
|
*
|
|
* - **Status line:** the branch (or the short hash when detached) and the
|
|
* counts, or why there is nothing to show: git missing or too old (with
|
|
* a hint to the setting `git.executable`), no repository, no changes.
|
|
* A refresh button runs `vcs.refresh`; two more open the stash dialog
|
|
* (M4.9) on its form (`vcs.stash`) and on its list (`vcs.showStashes`).
|
|
* - **Groups:** a header with a checkbox that stages (Changes, Untracked)
|
|
* or unstages (Staged) the whole group, then the files. Each file has a
|
|
* checkbox doing the same for itself, its name coloured by its state
|
|
* (`--lt-vcs-*`), its directory and its state. Up/Down, Page Up/Down,
|
|
* Home and End move the selection, Space stages or unstages it, Enter or
|
|
* a double-click opens it.
|
|
* - **Opening:** a conflicted file through `vcs.resolveConflicts {path}`
|
|
* (the merge dialog, M4.8); others through the UI command
|
|
* `vcs.showDiff {path, staged}` when something provides it (the diff
|
|
* viewer, M4.3); until then the file opens in the editor (`file.open`),
|
|
* unless it was deleted.
|
|
* - **Context menu (C7 A3):** a right click on a row, or Shift+F10 / the
|
|
* context-menu key on the selected one, opens `ChangesContextMenu.vue`:
|
|
* Open, and Add to .gitignore for untracked files.
|
|
* - **Commit box:** the message, an Amend checkbox and Commit. Commit
|
|
* saves dirty buffers first (`flushDirty`); `Mod+Enter` in the box
|
|
* commits too.
|
|
* - State lives in the Changes store (`changes.ts`), so the status and the
|
|
* message survive hiding the window. Icons are Lucide's; colours are
|
|
* tokens.
|
|
*/
|
|
import { Archive, ArchiveRestore, RefreshCw } from "@lucide/vue";
|
|
import { computed, nextTick, onMounted, ref, watch } from "vue";
|
|
import { useCommandsStore } from "../../../commands/store";
|
|
import { isMac } from "../../../commands/keymap";
|
|
import { t } from "../../../i18n";
|
|
import { run } from "../../../ipc";
|
|
import { baseName } from "../../../stores/editor";
|
|
import { useNotificationsStore } from "../../../stores/notifications";
|
|
import ChangesContextMenu from "./ChangesContextMenu.vue";
|
|
import { SHORT_HASH, useChangesStore, type ChangeRow, type FileState, type GroupId } from "./changes";
|
|
|
|
const changes = useChangesStore();
|
|
const commands = useCommandsStore();
|
|
const notifications = useNotificationsStore();
|
|
|
|
/** The list element. */
|
|
const list = ref<HTMLElement | null>(null);
|
|
/** The commit message box. */
|
|
const messageBox = ref<HTMLTextAreaElement | null>(null);
|
|
|
|
/** The open context menu: its row and where it shows; null when closed. */
|
|
const menu = ref<{ row: ChangeRow; x: number; y: number } | null>(null);
|
|
|
|
/**
|
|
* Opens the context menu of a row.
|
|
*
|
|
* @param row - the row; it becomes the selection.
|
|
* @param x - window x of the menu.
|
|
* @param y - window y of the menu.
|
|
*/
|
|
function openMenu(row: ChangeRow, x: number, y: number): void {
|
|
changes.select(row.key);
|
|
menu.value = { row, x, y };
|
|
}
|
|
|
|
/** Closes the context menu and gives the focus back to the list. */
|
|
function closeMenu(): void {
|
|
menu.value = null;
|
|
list.value?.focus();
|
|
}
|
|
|
|
/** Rows moved by Page Up and Page Down. */
|
|
const PAGE = 10;
|
|
|
|
/**
|
|
* The title of a group.
|
|
*
|
|
* @param group - the group.
|
|
*/
|
|
function groupTitle(group: GroupId): string {
|
|
const titles: Record<GroupId, () => string> = {
|
|
staged: () => t("vcs.changes.group.staged"),
|
|
changes: () => t("vcs.changes.group.changes"),
|
|
untracked: () => t("vcs.changes.group.untracked"),
|
|
};
|
|
return titles[group]();
|
|
}
|
|
|
|
/**
|
|
* The name of a state, for people.
|
|
*
|
|
* @param state - the state.
|
|
*/
|
|
function stateLabel(state: FileState): string {
|
|
const labels: Record<FileState, () => string> = {
|
|
unmodified: () => t("vcs.state.unmodified"),
|
|
modified: () => t("vcs.state.modified"),
|
|
added: () => t("vcs.state.added"),
|
|
deleted: () => t("vcs.state.deleted"),
|
|
renamed: () => t("vcs.state.renamed"),
|
|
copied: () => t("vcs.state.copied"),
|
|
untracked: () => t("vcs.state.untracked"),
|
|
ignored: () => t("vcs.state.ignored"),
|
|
conflicted: () => t("vcs.state.conflicted"),
|
|
};
|
|
return labels[state]();
|
|
}
|
|
|
|
/**
|
|
* The colour class suffix of a state (`changes__name--<suffix>`, which
|
|
* uses the token `--lt-vcs-<suffix>`).
|
|
*
|
|
* @param state - the state.
|
|
*/
|
|
function stateColor(state: FileState): string {
|
|
switch (state) {
|
|
case "added":
|
|
case "copied":
|
|
return "added";
|
|
case "deleted":
|
|
return "deleted";
|
|
case "untracked":
|
|
return "untracked";
|
|
case "ignored":
|
|
return "ignored";
|
|
case "conflicted":
|
|
return "conflicted";
|
|
default:
|
|
return "modified";
|
|
}
|
|
}
|
|
|
|
/** The line above the list. */
|
|
const statusLine = computed(() => {
|
|
const s = changes.status;
|
|
switch (changes.phase) {
|
|
case "idle":
|
|
return changes.loadError ?? t("vcs.changes.noProject");
|
|
case "loading":
|
|
return t("vcs.changes.loading");
|
|
case "unavailable":
|
|
return t("vcs.changes.unavailable", { reason: s?.error ?? "" });
|
|
case "noRepo":
|
|
return s?.error ? t("vcs.changes.repoError", { reason: s.error }) : t("vcs.changes.noRepo");
|
|
default:
|
|
break;
|
|
}
|
|
const repo = s?.repo;
|
|
const where = repo?.branch ?? (repo?.head ? repo.head.slice(0, SHORT_HASH) : t("vcs.changes.noCommits"));
|
|
const g = changes.groups;
|
|
if (changes.rows.length === 0) {
|
|
return t("vcs.changes.clean", { branch: where });
|
|
}
|
|
return t("vcs.changes.summary", {
|
|
branch: where,
|
|
staged: String(g.staged.length),
|
|
changes: String(g.changes.length),
|
|
untracked: String(g.untracked.length),
|
|
});
|
|
});
|
|
|
|
/** The groups with rows, in display order, with each row's flat index. */
|
|
const shownGroups = computed(() => {
|
|
let index = 0;
|
|
const out: { id: GroupId; rows: { row: ChangeRow; index: number }[] }[] = [];
|
|
for (const id of ["staged", "changes", "untracked"] as const) {
|
|
const rows = changes.groups[id].map((row) => ({ row, index: index++ }));
|
|
if (rows.length > 0) {
|
|
out.push({ id, rows });
|
|
}
|
|
}
|
|
return out;
|
|
});
|
|
|
|
/** Label of the commit button. */
|
|
const commitLabel = computed(() => (changes.amend ? t("vcs.commit.amendButton") : t("vcs.commit.button")));
|
|
|
|
/** The shortcut hint of the commit button. */
|
|
const commitHint = computed(() => t("vcs.commit.hint", { keys: isMac() ? "⌘↩" : "Ctrl+Enter" }));
|
|
|
|
/**
|
|
* The DOM id of a row.
|
|
*
|
|
* @param index - the row's index in the flat list.
|
|
*/
|
|
function optionId(index: number): string {
|
|
return `changes-row-${String(index)}`;
|
|
}
|
|
|
|
/**
|
|
* The directory part of a path, empty at the root.
|
|
*
|
|
* @param path - project-relative path.
|
|
*/
|
|
function dirName(path: string): string {
|
|
const slash = path.lastIndexOf("/");
|
|
return slash < 0 ? "" : path.slice(0, slash);
|
|
}
|
|
|
|
/**
|
|
* What a row shows after the name: the directory, and the old path of a
|
|
* rename or copy.
|
|
*
|
|
* @param row - the row.
|
|
*/
|
|
function detail(row: ChangeRow): string {
|
|
const dir = dirName(row.file.path);
|
|
const orig = row.file.origPath;
|
|
return orig !== undefined && row.group === "staged" ? t("vcs.changes.renamedFrom", { path: orig }) : dir;
|
|
}
|
|
|
|
/**
|
|
* The accessible name of a row's checkbox.
|
|
*
|
|
* @param row - the row.
|
|
*/
|
|
function toggleLabel(row: ChangeRow): string {
|
|
return row.group === "staged"
|
|
? t("vcs.changes.unstageFile", { path: row.file.path })
|
|
: t("vcs.changes.stageFile", { path: row.file.path });
|
|
}
|
|
|
|
/**
|
|
* The accessible name of a group's checkbox.
|
|
*
|
|
* @param group - the group.
|
|
*/
|
|
function groupToggleLabel(group: GroupId): string {
|
|
return group === "staged" ? t("vcs.changes.unstageAll") : t("vcs.changes.stageGroup", { group: groupTitle(group) });
|
|
}
|
|
|
|
/**
|
|
* Opens a row: a conflicted file's resolve view when `vcs.resolveConflicts`
|
|
* is provided (M4.8), else the diff when `vcs.showDiff` is provided, else
|
|
* the file.
|
|
*
|
|
* @param row - the row.
|
|
*/
|
|
async function openRow(row: ChangeRow): Promise<void> {
|
|
changes.select(row.key);
|
|
if (row.state === "conflicted" && commands.isEnabled("vcs.resolveConflicts")) {
|
|
await commands.execute("vcs.resolveConflicts", { path: row.file.path });
|
|
return;
|
|
}
|
|
const staged = row.group === "staged";
|
|
if (commands.isEnabled("vcs.showDiff")) {
|
|
await commands.execute("vcs.showDiff", { path: row.file.path, staged });
|
|
return;
|
|
}
|
|
if (row.state === "deleted") {
|
|
return;
|
|
}
|
|
const result = await run("file.open", { path: row.file.path });
|
|
if (!result.ok) {
|
|
notifications.notifyError("file.open", result.error);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Keyboard navigation in the list.
|
|
*
|
|
* @param event - the key event.
|
|
*/
|
|
function onListKey(event: KeyboardEvent): void {
|
|
const count = changes.rows.length;
|
|
const moves: Record<string, number> = {
|
|
ArrowDown: 1,
|
|
ArrowUp: -1,
|
|
PageDown: PAGE,
|
|
PageUp: -PAGE,
|
|
Home: -count,
|
|
End: count,
|
|
};
|
|
const delta = moves[event.key];
|
|
const row = changes.rows[changes.selectedIndex];
|
|
if (delta !== undefined) {
|
|
event.preventDefault();
|
|
changes.move(delta);
|
|
} else if (event.key === "Enter" && row) {
|
|
event.preventDefault();
|
|
void openRow(row);
|
|
} else if (event.key === " " && row) {
|
|
event.preventDefault();
|
|
void changes.toggle(row);
|
|
} else if ((event.key === "ContextMenu" || (event.key === "F10" && event.shiftKey)) && row) {
|
|
event.preventDefault();
|
|
const rect = document.getElementById(optionId(changes.selectedIndex))?.getBoundingClientRect();
|
|
openMenu(row, rect ? rect.left + 24 : 0, rect ? rect.bottom : 0);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Commits on `Mod+Enter` in the message box.
|
|
*
|
|
* @param event - the key event.
|
|
*/
|
|
function onMessageKey(event: KeyboardEvent): void {
|
|
if (event.key === "Enter" && (isMac() ? event.metaKey : event.ctrlKey)) {
|
|
event.preventDefault();
|
|
void changes.commit();
|
|
}
|
|
}
|
|
|
|
/** Takes the focus `vcs.commit` asked for, once. */
|
|
async function takeFocus(): Promise<void> {
|
|
if (!changes.focusPending) {
|
|
return;
|
|
}
|
|
changes.focusPending = false;
|
|
await nextTick();
|
|
messageBox.value?.focus();
|
|
}
|
|
|
|
watch(() => changes.focusRequest, takeFocus);
|
|
|
|
onMounted(() => {
|
|
void takeFocus();
|
|
});
|
|
|
|
watch(
|
|
() => changes.selectedIndex,
|
|
async (index) => {
|
|
await nextTick();
|
|
const element = index < 0 ? null : document.getElementById(optionId(index));
|
|
if (element && typeof element.scrollIntoView === "function") {
|
|
element.scrollIntoView({ block: "nearest" });
|
|
}
|
|
},
|
|
);
|
|
</script>
|
|
|
|
<template>
|
|
<div
|
|
class="changes"
|
|
data-test="changes"
|
|
>
|
|
<div class="changes__bar">
|
|
<div
|
|
class="changes__status"
|
|
role="status"
|
|
data-test="changes-status"
|
|
>
|
|
{{ statusLine }}
|
|
</div>
|
|
<button
|
|
type="button"
|
|
class="changes__icon-button"
|
|
:title="t('command.vcs.refresh')"
|
|
:aria-label="t('command.vcs.refresh')"
|
|
:disabled="changes.loading"
|
|
data-test="changes-refresh"
|
|
@click="changes.refresh()"
|
|
>
|
|
<RefreshCw :size="14" />
|
|
</button>
|
|
<button
|
|
type="button"
|
|
class="changes__icon-button"
|
|
:title="t('command.vcs.stash')"
|
|
:aria-label="t('command.vcs.stash')"
|
|
:disabled="changes.phase !== 'ready' || !commands.isEnabled('vcs.stash')"
|
|
data-test="changes-stash"
|
|
@click="commands.execute('vcs.stash')"
|
|
>
|
|
<Archive :size="14" />
|
|
</button>
|
|
<button
|
|
type="button"
|
|
class="changes__icon-button"
|
|
:title="t('command.vcs.showStashes')"
|
|
:aria-label="t('command.vcs.showStashes')"
|
|
:disabled="changes.phase !== 'ready' || !commands.isEnabled('vcs.showStashes')"
|
|
data-test="changes-stashes"
|
|
@click="commands.execute('vcs.showStashes')"
|
|
>
|
|
<ArchiveRestore :size="14" />
|
|
</button>
|
|
</div>
|
|
<div
|
|
v-if="changes.phase === 'unavailable'"
|
|
class="changes__hint"
|
|
data-test="changes-hint"
|
|
>
|
|
{{ t("vcs.changes.unavailableHint") }}
|
|
</div>
|
|
<div
|
|
ref="list"
|
|
class="changes__list"
|
|
role="listbox"
|
|
tabindex="0"
|
|
:aria-label="t('vcs.changes.list.label')"
|
|
:aria-activedescendant="changes.selectedIndex >= 0 ? optionId(changes.selectedIndex) : undefined"
|
|
data-test="changes-list"
|
|
@keydown="onListKey"
|
|
>
|
|
<div
|
|
v-for="group in shownGroups"
|
|
:key="group.id"
|
|
role="group"
|
|
:aria-label="groupTitle(group.id)"
|
|
:data-test="`changes-group-${group.id}`"
|
|
>
|
|
<div class="changes__group">
|
|
<input
|
|
type="checkbox"
|
|
class="changes__check"
|
|
:checked="group.id === 'staged'"
|
|
:disabled="changes.busy"
|
|
:aria-label="groupToggleLabel(group.id)"
|
|
:title="groupToggleLabel(group.id)"
|
|
:data-test="`changes-group-toggle-${group.id}`"
|
|
@click.prevent="changes.toggleGroup(group.id)"
|
|
>
|
|
<span class="changes__group-title">{{ groupTitle(group.id) }}</span>
|
|
<span class="changes__group-count">{{ group.rows.length }}</span>
|
|
</div>
|
|
<div
|
|
v-for="{ row, index } in group.rows"
|
|
:id="optionId(index)"
|
|
:key="row.key"
|
|
role="option"
|
|
class="changes__row"
|
|
:class="{ 'changes__row--selected': changes.selectedKey === row.key }"
|
|
:aria-selected="changes.selectedKey === row.key"
|
|
:data-state="row.state"
|
|
data-test="changes-row"
|
|
@click="changes.select(row.key)"
|
|
@dblclick="openRow(row)"
|
|
@contextmenu.prevent="openMenu(row, $event.clientX, $event.clientY)"
|
|
>
|
|
<input
|
|
type="checkbox"
|
|
class="changes__check"
|
|
tabindex="-1"
|
|
:checked="row.group === 'staged'"
|
|
:disabled="changes.busy"
|
|
:aria-label="toggleLabel(row)"
|
|
:title="toggleLabel(row)"
|
|
data-test="changes-row-toggle"
|
|
@click.stop.prevent="changes.toggle(row)"
|
|
>
|
|
<span
|
|
class="changes__name"
|
|
:class="`changes__name--${stateColor(row.state)}`"
|
|
>{{ baseName(row.file.path) }}</span>
|
|
<span class="changes__dir">{{ detail(row) }}</span>
|
|
<span
|
|
v-if="row.partial"
|
|
class="changes__partial"
|
|
:title="t('vcs.changes.partlyStaged')"
|
|
data-test="changes-row-partial"
|
|
>{{ t("vcs.changes.partly") }}</span>
|
|
<span class="changes__state">{{ stateLabel(row.state) }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<ChangesContextMenu
|
|
v-if="menu"
|
|
:row="menu.row"
|
|
:x="menu.x"
|
|
:y="menu.y"
|
|
@close="closeMenu"
|
|
@open="openRow"
|
|
/>
|
|
<form
|
|
class="changes__commit"
|
|
data-test="changes-commit"
|
|
@submit.prevent="changes.commit()"
|
|
>
|
|
<textarea
|
|
ref="messageBox"
|
|
v-model="changes.message"
|
|
class="changes__message"
|
|
rows="3"
|
|
:placeholder="t('vcs.commit.placeholder')"
|
|
:aria-label="t('vcs.commit.messageLabel')"
|
|
:disabled="changes.phase !== 'ready'"
|
|
data-test="changes-message"
|
|
@keydown="onMessageKey"
|
|
/>
|
|
<div class="changes__commit-row">
|
|
<label class="changes__amend">
|
|
<input
|
|
v-model="changes.amend"
|
|
type="checkbox"
|
|
:disabled="changes.phase !== 'ready' || changes.busy"
|
|
data-test="changes-amend"
|
|
>
|
|
{{ t("vcs.commit.amend") }}
|
|
</label>
|
|
<button
|
|
type="submit"
|
|
class="changes__commit-button"
|
|
:disabled="!changes.canCommit"
|
|
:title="commitHint"
|
|
data-test="changes-commit-button"
|
|
>
|
|
{{ commitLabel }}
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.changes {
|
|
display: flex;
|
|
flex-direction: column;
|
|
flex: 1;
|
|
min-height: 0;
|
|
}
|
|
|
|
.changes__bar {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--lt-space-s, 4px);
|
|
padding: var(--lt-space-xs, 2px) var(--lt-space-m, 8px);
|
|
}
|
|
|
|
.changes__status {
|
|
flex: 1;
|
|
min-width: 0;
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
white-space: nowrap;
|
|
color: var(--lt-fg-muted);
|
|
}
|
|
|
|
.changes__hint {
|
|
padding: 0 var(--lt-space-m, 8px) var(--lt-space-xs, 2px);
|
|
color: var(--lt-fg-muted);
|
|
}
|
|
|
|
.changes__icon-button {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: var(--lt-space-xs, 2px);
|
|
color: var(--lt-fg-muted);
|
|
background: transparent;
|
|
border: none;
|
|
border-radius: var(--lt-radius, 4px);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.changes__icon-button:hover:not(:disabled) {
|
|
color: var(--lt-fg);
|
|
background: color-mix(in srgb, var(--lt-fg) 8%, transparent);
|
|
}
|
|
|
|
.changes__icon-button:focus-visible {
|
|
outline: 2px solid var(--lt-accent);
|
|
}
|
|
|
|
.changes__list {
|
|
flex: 1;
|
|
min-height: 0;
|
|
overflow: auto;
|
|
border-top: 1px solid var(--lt-border);
|
|
outline: none;
|
|
}
|
|
|
|
.changes__list:focus-visible {
|
|
box-shadow: inset 0 0 0 1px var(--lt-accent);
|
|
}
|
|
|
|
.changes__group {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--lt-space-s, 4px);
|
|
padding: var(--lt-space-xs, 2px) var(--lt-space-m, 8px);
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.changes__group-title {
|
|
font-weight: 600;
|
|
}
|
|
|
|
.changes__group-count {
|
|
color: var(--lt-fg-muted);
|
|
}
|
|
|
|
.changes__check {
|
|
flex: none;
|
|
margin: 0;
|
|
accent-color: var(--lt-accent);
|
|
}
|
|
|
|
.changes__row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--lt-space-m, 8px);
|
|
padding: 0 var(--lt-space-m, 8px) 0 var(--lt-space-l, 24px);
|
|
white-space: nowrap;
|
|
cursor: default;
|
|
}
|
|
|
|
.changes__row:hover {
|
|
background: color-mix(in srgb, var(--lt-fg) 6%, transparent);
|
|
}
|
|
|
|
.changes__row--selected,
|
|
.changes__row--selected:hover {
|
|
background: var(--lt-editor-selection-bg);
|
|
}
|
|
|
|
.changes__name--added {
|
|
color: var(--lt-vcs-added);
|
|
}
|
|
|
|
.changes__name--modified {
|
|
color: var(--lt-vcs-modified);
|
|
}
|
|
|
|
.changes__name--deleted {
|
|
color: var(--lt-vcs-deleted);
|
|
text-decoration: line-through;
|
|
}
|
|
|
|
.changes__name--untracked {
|
|
color: var(--lt-vcs-untracked);
|
|
}
|
|
|
|
.changes__name--ignored {
|
|
color: var(--lt-vcs-ignored);
|
|
}
|
|
|
|
.changes__name--conflicted {
|
|
color: var(--lt-vcs-conflicted);
|
|
}
|
|
|
|
.changes__dir {
|
|
overflow: hidden;
|
|
text-overflow: ellipsis;
|
|
color: var(--lt-fg-muted);
|
|
}
|
|
|
|
.changes__state {
|
|
flex: none;
|
|
margin-left: auto;
|
|
color: var(--lt-fg-muted);
|
|
}
|
|
|
|
.changes__partial {
|
|
flex: none;
|
|
margin-left: auto;
|
|
padding: 0 4px;
|
|
color: var(--lt-fg-muted);
|
|
border: 1px solid var(--lt-border);
|
|
border-radius: 3px;
|
|
font-size: var(--lt-font-size-small);
|
|
}
|
|
|
|
.changes__partial + .changes__state {
|
|
margin-left: 6px;
|
|
}
|
|
|
|
.changes__row--selected .changes__dir,
|
|
.changes__row--selected .changes__state {
|
|
color: var(--lt-fg);
|
|
}
|
|
|
|
.changes__commit {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--lt-space-xs, 2px);
|
|
padding: var(--lt-space-s, 4px) var(--lt-space-m, 8px);
|
|
border-top: 1px solid var(--lt-border);
|
|
}
|
|
|
|
.changes__message {
|
|
resize: vertical;
|
|
min-height: 3em;
|
|
padding: var(--lt-space-xs, 2px) var(--lt-space-s, 4px);
|
|
font: inherit;
|
|
color: var(--lt-fg);
|
|
background: var(--lt-editor-bg);
|
|
border: 1px solid var(--lt-border);
|
|
border-radius: var(--lt-radius, 4px);
|
|
}
|
|
|
|
.changes__message:focus-visible {
|
|
outline: 2px solid var(--lt-accent);
|
|
outline-offset: -1px;
|
|
}
|
|
|
|
.changes__commit-row {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: var(--lt-space-m, 8px);
|
|
}
|
|
|
|
.changes__amend {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: var(--lt-space-xs, 2px);
|
|
color: var(--lt-fg);
|
|
}
|
|
|
|
.changes__commit-button {
|
|
margin-left: auto;
|
|
padding: var(--lt-space-xs, 2px) var(--lt-space-l, 24px);
|
|
color: var(--lt-fg);
|
|
background: color-mix(in srgb, var(--lt-accent) 18%, transparent);
|
|
border: 1px solid var(--lt-accent);
|
|
border-radius: var(--lt-radius, 4px);
|
|
cursor: pointer;
|
|
}
|
|
|
|
.changes__commit-button:disabled {
|
|
opacity: 0.5;
|
|
cursor: default;
|
|
}
|
|
|
|
.changes__commit-button:focus-visible {
|
|
outline: 2px solid var(--lt-fg);
|
|
outline-offset: 1px;
|
|
}
|
|
</style>
|