feat(web): refonte visuelle « Emerald » (thème clair/sombre, polices, tokens)
Adopte le langage visuel du design system Emerald dans l'IDE web : neutres zinc + accent emerald, polices auto-hébergées Inter + JetBrains Mono, radii/pills mono, points de statut, motif terminal, halo/grain. Refonte purement visuelle et additive (layout, routing, stores, protocole inchangés). - style.css : défauts sombres dans @theme + override clair sous html[data-theme=light] ; accent scindé (bright #34d399 / solid #059669 / hover) ; tokens border-soft/info/warn/danger/coffee ; idiomes globaux (focus/selection accent, scrollbars fines, jl-pulse/jl-blink, classes .chip/.status/.eyebrow/.label-mono/.caret/.halo/.grain, .btn*/.badge pill). - lib/theme.ts : singleton themeMode/resolvedTheme (dark/light/system, persistedRef arb.theme) + application dataset.theme/metas ; script anti-FOUC inline dans index.html ; toggle ActivityBar + Réglages. - Thèmes Monaco + xterm dark/light réactifs (palette ANSI + coloration syntaxique) ; fonts.ready + remeasureFonts pour l'alignement des glyphes. - status-tokens : tons sémantiques tokenisés ; balayage des ~340 couleurs Tailwind brutes vers les tokens sur tout components/* et views/* (exceptions assumées commentées). - GroupSummary.color exploité : icône de groupe teintée + ColorSwatchPicker (lib/group-colors.ts) dans les modals de groupe. - Polices via @fontsource-variable/{inter,jetbrains-mono} (offline).
This commit is contained in:
@@ -1,53 +1,53 @@
|
||||
<template>
|
||||
<div class="flex h-full flex-col border-t border-zinc-800">
|
||||
<div class="flex h-full flex-col border-t border-border">
|
||||
<!-- en-tête + actions distantes -->
|
||||
<div class="flex items-center gap-1 px-2 py-1 text-[11px] font-semibold uppercase tracking-wide text-zinc-500">
|
||||
<div class="flex items-center gap-1 px-2 py-1 label-mono">
|
||||
<GitCompare :size="13" /> {{ t('workspace.changes') }}
|
||||
<span v-if="git.ahead" class="text-emerald-500">↑{{ git.ahead }}</span>
|
||||
<span v-if="git.behind" class="text-amber-500">↓{{ git.behind }}</span>
|
||||
<span v-if="git.ahead" class="text-accent">↑{{ git.ahead }}</span>
|
||||
<span v-if="git.behind" class="text-warn">↓{{ git.behind }}</span>
|
||||
<span class="ml-auto flex items-center gap-1">
|
||||
<button type="button" class="rounded p-0.5 hover:bg-zinc-800 hover:text-zinc-300 disabled:opacity-40" :title="t('commit.fetch')" :disabled="!!busy" @click="onFetch"><Download :size="13" /></button>
|
||||
<button type="button" class="rounded p-0.5 hover:bg-zinc-800 hover:text-zinc-300 disabled:opacity-40" :title="t('commit.pull')" :disabled="!!busy" @click="onPull('ff-only')"><ArrowDownToLine :size="13" /></button>
|
||||
<button type="button" class="rounded p-0.5 hover:bg-surface-2 hover:text-fg disabled:opacity-40" :title="t('commit.fetch')" :disabled="!!busy" @click="onFetch"><Download :size="13" /></button>
|
||||
<button type="button" class="rounded p-0.5 hover:bg-surface-2 hover:text-fg disabled:opacity-40" :title="t('commit.pull')" :disabled="!!busy" @click="onPull('ff-only')"><ArrowDownToLine :size="13" /></button>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div class="min-h-0 flex-1 overflow-auto">
|
||||
<!-- fichiers indexés (staged) -->
|
||||
<div v-if="staged.length" class="px-1">
|
||||
<div class="flex items-center px-1 py-0.5 text-[11px] text-zinc-500">
|
||||
<div class="flex items-center px-1 py-0.5 text-[11px] text-fg-subtle">
|
||||
{{ t('commit.staged') }} ({{ staged.length }})
|
||||
<button type="button" class="ml-auto rounded px-1 hover:bg-zinc-800 hover:text-zinc-300 disabled:opacity-40" :disabled="!!busy" @click="onUnstageAll">{{ t('commit.unstageAll') }}</button>
|
||||
<button type="button" class="ml-auto rounded px-1 hover:bg-surface-2 hover:text-fg disabled:opacity-40" :disabled="!!busy" @click="onUnstageAll">{{ t('commit.unstageAll') }}</button>
|
||||
</div>
|
||||
<FileRow v-for="c in staged" :key="`s-${c.path}`" :c="c" :active="active === c.path" staged @select="select(c, true)">
|
||||
<button type="button" class="rounded p-0.5 hover:bg-zinc-700" :title="t('commit.unstage')" :disabled="!!busy" @click.stop="onUnstage(c)"><Minus :size="13" /></button>
|
||||
<button type="button" class="rounded p-0.5 hover:bg-surface-3" :title="t('commit.unstage')" :disabled="!!busy" @click.stop="onUnstage(c)"><Minus :size="13" /></button>
|
||||
</FileRow>
|
||||
</div>
|
||||
|
||||
<!-- changements non indexés / non suivis -->
|
||||
<div class="px-1">
|
||||
<div class="flex items-center px-1 py-0.5 text-[11px] text-zinc-500">
|
||||
<div class="flex items-center px-1 py-0.5 text-[11px] text-fg-subtle">
|
||||
{{ t('commit.changes') }} ({{ unstaged.length }})
|
||||
<button v-if="unstaged.length" type="button" class="ml-auto rounded px-1 hover:bg-zinc-800 hover:text-zinc-300 disabled:opacity-40" :disabled="!!busy" @click="onStageAll">{{ t('commit.stageAll') }}</button>
|
||||
<button v-if="unstaged.length" type="button" class="ml-auto rounded px-1 hover:bg-surface-2 hover:text-fg disabled:opacity-40" :disabled="!!busy" @click="onStageAll">{{ t('commit.stageAll') }}</button>
|
||||
</div>
|
||||
<p v-if="unstaged.length === 0 && staged.length === 0" class="px-2 py-1 text-xs text-zinc-600">{{ t('workspace.noChanges') }}</p>
|
||||
<p v-if="unstaged.length === 0 && staged.length === 0" class="px-2 py-1 text-xs text-fg-subtle">{{ t('workspace.noChanges') }}</p>
|
||||
<FileRow v-for="c in unstaged" :key="`u-${c.path}`" :c="c" :active="active === c.path" @select="select(c, false)">
|
||||
<button v-if="discardArmed === c.path" type="button" class="rounded p-0.5 text-rose-300 hover:bg-rose-900/40" :title="t('commit.confirmDiscard')" :disabled="!!busy" @click.stop="onDiscard(c)"><Check :size="13" /></button>
|
||||
<button v-else type="button" class="rounded p-0.5 hover:bg-zinc-700" :title="t('commit.discard')" :disabled="!!busy" @click.stop="discardArmed = c.path"><Undo2 :size="13" /></button>
|
||||
<button type="button" class="rounded p-0.5 hover:bg-zinc-700" :title="t('commit.stage')" :disabled="!!busy" @click.stop="onStage(c)"><Plus :size="13" /></button>
|
||||
<button v-if="discardArmed === c.path" type="button" class="rounded p-0.5 text-danger hover:bg-danger/40" :title="t('commit.confirmDiscard')" :disabled="!!busy" @click.stop="onDiscard(c)"><Check :size="13" /></button>
|
||||
<button v-else type="button" class="rounded p-0.5 hover:bg-surface-3" :title="t('commit.discard')" :disabled="!!busy" @click.stop="discardArmed = c.path"><Undo2 :size="13" /></button>
|
||||
<button type="button" class="rounded p-0.5 hover:bg-surface-3" :title="t('commit.stage')" :disabled="!!busy" @click.stop="onStage(c)"><Plus :size="13" /></button>
|
||||
</FileRow>
|
||||
</div>
|
||||
<p v-if="truncated" class="px-2 py-1 text-[11px] text-amber-500">{{ t('workspace.changesTruncated') }}</p>
|
||||
<p v-if="truncated" class="px-2 py-1 text-[11px] text-warn">{{ t('workspace.changesTruncated') }}</p>
|
||||
</div>
|
||||
|
||||
<!-- zone de commit -->
|
||||
<div class="flex flex-col gap-1 border-t border-zinc-800 p-2">
|
||||
<div class="flex flex-col gap-1 border-t border-border p-2">
|
||||
<textarea
|
||||
v-model="message"
|
||||
rows="2"
|
||||
class="input resize-none text-xs"
|
||||
:placeholder="amend ? t('commit.amendPlaceholder') : t('commit.messagePlaceholder')"
|
||||
/>
|
||||
<label class="flex items-center gap-1 text-[11px] text-zinc-400">
|
||||
<label class="flex items-center gap-1 text-[11px] text-fg-muted">
|
||||
<input v-model="amend" type="checkbox" /> {{ t('commit.amend') }}
|
||||
</label>
|
||||
<div class="flex items-center gap-2">
|
||||
@@ -59,7 +59,7 @@
|
||||
</BaseButton>
|
||||
<BaseButton v-if="canRebase" size="sm" variant="ghost" :loading="busy === 'rebase'" @click="onPull('rebase')">{{ t('commit.pullRebase') }}</BaseButton>
|
||||
</div>
|
||||
<p v-if="error" class="text-[11px] text-amber-400">{{ error }}</p>
|
||||
<p v-if="error" class="text-[11px] text-warn">{{ error }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -1,27 +1,27 @@
|
||||
<template>
|
||||
<div class="flex h-full flex-col">
|
||||
<p v-if="loading" class="p-3 text-xs text-zinc-500">{{ t('fs.loading') }}</p>
|
||||
<p v-else-if="error" class="p-3 text-xs text-rose-400">{{ error }}</p>
|
||||
<p v-else-if="binary" class="p-3 text-xs text-zinc-500">{{ t('diff.binary') }}</p>
|
||||
<p v-else-if="tooLarge" class="p-3 text-xs text-amber-500">{{ t('diff.tooLarge') }}</p>
|
||||
<p v-else-if="parsed.hunks.length === 0" class="p-3 text-xs text-zinc-500">{{ t('diff.noChanges') }}</p>
|
||||
<p v-if="loading" class="p-3 text-xs text-fg-subtle">{{ t('fs.loading') }}</p>
|
||||
<p v-else-if="error" class="p-3 text-xs text-danger">{{ error }}</p>
|
||||
<p v-else-if="binary" class="p-3 text-xs text-fg-subtle">{{ t('diff.binary') }}</p>
|
||||
<p v-else-if="tooLarge" class="p-3 text-xs text-warn">{{ t('diff.tooLarge') }}</p>
|
||||
<p v-else-if="parsed.hunks.length === 0" class="p-3 text-xs text-fg-subtle">{{ t('diff.noChanges') }}</p>
|
||||
<div v-else class="min-h-0 flex-1 overflow-auto">
|
||||
<div class="flex items-center gap-3 border-b border-zinc-800 px-3 py-1 text-[11px] text-zinc-500">
|
||||
<span class="text-emerald-500">+{{ parsed.additions }}</span>
|
||||
<span class="text-rose-500">−{{ parsed.deletions }}</span>
|
||||
<span v-if="staged" class="rounded bg-emerald-950 px-1 text-emerald-400">{{ t('git.staged') }}</span>
|
||||
<div class="flex items-center gap-3 border-b border-border px-3 py-1 text-[11px] text-fg-subtle">
|
||||
<span class="text-accent">+{{ parsed.additions }}</span>
|
||||
<span class="text-danger">−{{ parsed.deletions }}</span>
|
||||
<span v-if="staged" class="rounded bg-accent/15 px-1 text-accent">{{ t('git.staged') }}</span>
|
||||
</div>
|
||||
<table class="w-full border-collapse font-mono text-xs leading-5">
|
||||
<tbody>
|
||||
<template v-for="(h, hi) in parsed.hunks" :key="hi">
|
||||
<tr class="bg-zinc-900/60 text-sky-300/80">
|
||||
<td class="select-none px-2 text-right text-zinc-700" />
|
||||
<td class="select-none px-2 text-right text-zinc-700" />
|
||||
<tr class="bg-surface-1/60 text-info/80">
|
||||
<td class="select-none px-2 text-right text-fg-subtle" />
|
||||
<td class="select-none px-2 text-right text-fg-subtle" />
|
||||
<td class="whitespace-pre px-2">{{ h.header }}</td>
|
||||
</tr>
|
||||
<tr v-for="(l, li) in h.lines" :key="`${hi}-${li}`" :class="rowClass(l.type)">
|
||||
<td class="w-10 select-none px-2 text-right text-zinc-600">{{ l.oldLine ?? '' }}</td>
|
||||
<td class="w-10 select-none px-2 text-right text-zinc-600">{{ l.newLine ?? '' }}</td>
|
||||
<td class="w-10 select-none px-2 text-right text-fg-subtle">{{ l.oldLine ?? '' }}</td>
|
||||
<td class="w-10 select-none px-2 text-right text-fg-subtle">{{ l.newLine ?? '' }}</td>
|
||||
<td class="whitespace-pre px-2">{{ marker(l.type) }}{{ l.content }}</td>
|
||||
</tr>
|
||||
</template>
|
||||
@@ -66,9 +66,9 @@ async function load(): Promise<void> {
|
||||
watch(() => [props.repoId, props.wt, props.file, props.staged, props.version], load, { immediate: true });
|
||||
|
||||
function rowClass(type: DiffLineType): string {
|
||||
if (type === 'add') return 'bg-emerald-950/40 text-emerald-200';
|
||||
if (type === 'del') return 'bg-rose-950/40 text-rose-200';
|
||||
return 'text-zinc-300';
|
||||
if (type === 'add') return 'diff-add';
|
||||
if (type === 'del') return 'diff-del';
|
||||
return 'diff-ctx';
|
||||
}
|
||||
function marker(type: DiffLineType): string {
|
||||
return type === 'add' ? '+' : type === 'del' ? '-' : ' ';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div
|
||||
class="group flex items-center gap-2 rounded px-2 py-0.5 text-xs"
|
||||
:class="active ? 'bg-zinc-800 text-zinc-100' : 'text-zinc-300 hover:bg-zinc-800/60'"
|
||||
:class="active ? 'bg-surface-2 text-fg' : 'text-fg-muted hover:bg-surface-2/60'"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
@@ -10,9 +10,9 @@
|
||||
@click="emit('select')"
|
||||
>
|
||||
<span class="w-3 shrink-0 text-center font-mono font-bold" :class="tone">{{ letter }}</span>
|
||||
<span class="min-w-0 flex-1 truncate font-mono">{{ basename }}<span class="text-zinc-600">{{ dir }}</span></span>
|
||||
<span v-if="c.insertions" class="shrink-0 text-emerald-500">+{{ c.insertions }}</span>
|
||||
<span v-if="c.deletions" class="shrink-0 text-rose-500">−{{ c.deletions }}</span>
|
||||
<span class="min-w-0 flex-1 truncate font-mono">{{ basename }}<span class="text-fg-subtle">{{ dir }}</span></span>
|
||||
<span v-if="c.insertions" class="shrink-0 text-accent">+{{ c.insertions }}</span>
|
||||
<span v-if="c.deletions" class="shrink-0 text-danger">−{{ c.deletions }}</span>
|
||||
</button>
|
||||
<span class="flex shrink-0 items-center gap-0.5 opacity-60 group-hover:opacity-100">
|
||||
<slot />
|
||||
@@ -38,9 +38,9 @@ const letter = computed(() => {
|
||||
return (x || 'M').toUpperCase();
|
||||
});
|
||||
const tone = computed(() => {
|
||||
if (props.c.conflicted) return 'text-rose-400';
|
||||
if (props.c.untracked) return 'text-zinc-400';
|
||||
return letter.value === 'A' ? 'text-emerald-400' : letter.value === 'D' ? 'text-rose-400' : letter.value === 'R' ? 'text-sky-400' : 'text-amber-400';
|
||||
if (props.c.conflicted) return 'text-danger';
|
||||
if (props.c.untracked) return 'text-fg-muted';
|
||||
return letter.value === 'A' ? 'text-accent' : letter.value === 'D' ? 'text-danger' : letter.value === 'R' ? 'text-info' : 'text-warn';
|
||||
});
|
||||
const basename = computed(() => {
|
||||
const i = props.c.path.lastIndexOf('/');
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<div :class="embedded ? '' : 'flex h-full flex-col'">
|
||||
<div v-if="!embedded" class="flex items-center gap-1 px-2 py-1 text-[11px] font-semibold uppercase tracking-wide text-zinc-500">
|
||||
<div v-if="!embedded" class="flex items-center gap-1 px-2 py-1 label-mono">
|
||||
<FolderTree :size="13" /> {{ t('workspace.files') }}
|
||||
<button type="button" class="ml-auto rounded p-0.5 hover:bg-zinc-800 hover:text-zinc-300" :title="t('common.refresh')" @click="load">
|
||||
<button type="button" class="ml-auto rounded p-0.5 hover:bg-surface-2 hover:text-fg" :title="t('common.refresh')" @click="load">
|
||||
<RefreshCw :size="12" />
|
||||
</button>
|
||||
</div>
|
||||
<div :class="embedded ? '' : 'min-h-0 flex-1 overflow-auto px-1 pb-2'">
|
||||
<p v-if="loading" class="px-2 py-1 text-xs text-zinc-600">{{ t('fs.loading') }}</p>
|
||||
<p v-else-if="error" class="px-2 py-1 text-xs text-rose-400">{{ error }}</p>
|
||||
<p v-else-if="entries.length === 0" class="px-2 py-1 text-xs text-zinc-600">{{ t('fs.empty') }}</p>
|
||||
<p v-if="loading" class="px-2 py-1 text-xs text-fg-subtle">{{ t('fs.loading') }}</p>
|
||||
<p v-else-if="error" class="px-2 py-1 text-xs text-danger">{{ error }}</p>
|
||||
<p v-else-if="entries.length === 0" class="px-2 py-1 text-xs text-fg-subtle">{{ t('fs.empty') }}</p>
|
||||
<FileTreeNode
|
||||
v-for="e in entries"
|
||||
:key="e.path"
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<div>
|
||||
<button
|
||||
type="button"
|
||||
class="flex w-full items-center gap-1 rounded py-0.5 pr-2 text-left text-xs hover:bg-zinc-800/60"
|
||||
:class="isActive ? 'bg-zinc-800 text-zinc-100' : 'text-zinc-300'"
|
||||
class="flex w-full items-center gap-1 rounded py-0.5 pr-2 text-left text-xs hover:bg-surface-2/60"
|
||||
:class="isActive ? 'bg-surface-2 text-fg' : 'text-fg-muted'"
|
||||
:style="{ paddingLeft: `${depth * 12 + 6}px` }"
|
||||
:title="entry.name"
|
||||
@click="onClick"
|
||||
@@ -11,14 +11,14 @@
|
||||
<component
|
||||
:is="entry.isFile ? File : expanded ? ChevronDown : ChevronRight"
|
||||
:size="14"
|
||||
class="shrink-0 text-zinc-500"
|
||||
class="shrink-0 text-fg-subtle"
|
||||
/>
|
||||
<span class="truncate font-mono">{{ entry.name }}</span>
|
||||
</button>
|
||||
|
||||
<template v-if="!entry.isFile && expanded">
|
||||
<p v-if="loading" class="py-0.5 text-xs text-zinc-600" :style="{ paddingLeft: `${(depth + 1) * 12 + 6}px` }">…</p>
|
||||
<p v-else-if="error" class="py-0.5 text-xs text-rose-400" :style="{ paddingLeft: `${(depth + 1) * 12 + 6}px` }">{{ error }}</p>
|
||||
<p v-if="loading" class="py-0.5 text-xs text-fg-subtle" :style="{ paddingLeft: `${(depth + 1) * 12 + 6}px` }">…</p>
|
||||
<p v-else-if="error" class="py-0.5 text-xs text-danger" :style="{ paddingLeft: `${(depth + 1) * 12 + 6}px` }">{{ error }}</p>
|
||||
<FileTreeNode
|
||||
v-for="c in children"
|
||||
:key="c.path"
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<span class="flex items-center gap-2 text-xs">
|
||||
<span class="flex items-center gap-1 font-mono text-zinc-300">
|
||||
<span class="flex items-center gap-1 font-mono text-fg-muted">
|
||||
<GitBranch :size="13" />{{ branch ?? t('worktrees.detached') }}
|
||||
</span>
|
||||
<span v-if="git.ahead" class="text-emerald-400" :title="t('git.ahead')">↑{{ git.ahead }}</span>
|
||||
<span v-if="git.behind" class="text-amber-400" :title="t('git.behind')">↓{{ git.behind }}</span>
|
||||
<span v-if="git.stagedCount" class="text-emerald-400" :title="t('git.staged')">●{{ git.stagedCount }}</span>
|
||||
<span v-if="git.unstagedCount" class="text-amber-400" :title="t('git.unstaged')">○{{ git.unstagedCount }}</span>
|
||||
<span v-if="git.conflictCount" class="text-rose-400" :title="t('git.conflicts')">⚠{{ git.conflictCount }}</span>
|
||||
<span v-if="isClean" class="text-zinc-600">{{ t('worktrees.clean') }}</span>
|
||||
<span v-if="git.ahead" class="text-accent" :title="t('git.ahead')">↑{{ git.ahead }}</span>
|
||||
<span v-if="git.behind" class="text-warn" :title="t('git.behind')">↓{{ git.behind }}</span>
|
||||
<span v-if="git.stagedCount" class="text-accent" :title="t('git.staged')">●{{ git.stagedCount }}</span>
|
||||
<span v-if="git.unstagedCount" class="text-warn" :title="t('git.unstaged')">○{{ git.unstagedCount }}</span>
|
||||
<span v-if="git.conflictCount" class="text-danger" :title="t('git.conflicts')">⚠{{ git.conflictCount }}</span>
|
||||
<span v-if="isClean" class="text-fg-subtle">{{ t('worktrees.clean') }}</span>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user