Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 33 additions & 24 deletions README.en.md

Large diffs are not rendered by default.

55 changes: 32 additions & 23 deletions README.md

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions docs/design-system.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[简体中文](design-system.md) | [English](design-system.en.md)

> This is the authoritative UI specification for the entire project. All webview panels (console / templatePanel / templateAssetPanel / tempScreenshots / annotationPanel / characterManager / boxPanel) must follow it.
> This is the authoritative UI specification for the entire project. All webview panels (console / templatePanel / templateAssetPanel / tempScreenshots / annotationPanel / characterManager) must follow it.
> Implementation sources: `media/shared/tokens.css` (design tokens) and `media/shared/controls.css` (shared controls).
> **Pages compose these classes; they must not independently redefine visual rules.**

Expand Down Expand Up @@ -55,7 +55,7 @@ Buttons of the same kind share height (`--control-h-sm/md/lg`), padding (`--spac

## 4. Shared Size Scale

- Spacing: `--space-xs(4) / sm(6) / md(10) / lg(14) / xl(20)`.
- Spacing: `--space-xs(4) / sm(8) / md(12) / lg(16) / xl(24)`.
- Control height: `--control-h-sm(24) / md(30) / lg(34)`.
- Radius: `--radius-sm(5) / md(8) / lg(11) / pill`.
- Font size: `--font-xs(11) / sm(12) / md(13) / lg(15)`; weights only `--weight-regular(400)` / `--weight-medium(500)`.
Expand Down Expand Up @@ -95,8 +95,13 @@ media/shared/tokens.css Colors · Typography · Spacing · Radius · Border
media/shared/controls.css Button(primary/secondary/mini/ghost/icon) · Input · Select · Checkbox/Switch
· Tag · Card · Toolbar · SectionTitle · Empty/Broken/Hint · Divider
· Clickability rules ([role=button], actual-button/clickable-row categories)
· .has-codicon / .is-icon-only (icon button alignment and size)
media/shared/codicons/ @vscode/codicons 0.0.36 (codicon.css + codicon.ttf, vendored unchanged)
media/shared/icons.js OkIcons.icon / label / iconOnly — the single way panels create icons
```

**Icon rule (2026-10-09):** UI icons always use codicons (the same set as native VS Code UI). Emoji and Unicode glyphs (`▶ ⚙ ⇄ ⟲ + 👁 × ↻` and similar) are no longer used: they drift with the font and screen readers read out the symbol names. Icon-only buttons must have both `title` and `aria-label` (`OkIcons.iconOnly` handles this). One meaning, one icon: sync defaults `sync`, restore factory defaults `discard`, swap annotations `arrow-swap`, delete `trash`, view original `go-to-file` / `eye`. Panel HTML must load `__SHARED_CODICONS_URI__` and `__SHARED_ICONS_URI__`, and the CSP must include `font-src __CSP_SOURCE__`.

Connect a new panel in **three steps; omitting any step silently breaks styling**:

1. In `index.html`, load `__SHARED_TOKENS_URI__` → `__SHARED_CONTROLS_URI__` → panel styles in that order. This is cascade precedence; panel styles may override the shared layer.
Expand All @@ -122,7 +127,7 @@ Connect a new panel in **three steps; omitting any step silently breaks styling*

## Implementation Progress

2026-10-01 addendum: box panels/galleries share `media/boxPanel`, connected through `src/boxPanels.ts` and included in the static audit. The table and six-panel record below describe the 2026-09-23 migration baseline, not a reason to omit newer panels.
2026-10-09 addendum: the standalone box panel/gallery (`media/boxPanel`, `src/boxPanels.ts`) was folded into the unified annotation editor and resource preview and has been removed; the position-preview helpers used by hover and completion now live in `src/positionPreview.ts`. The table and six-panel record below describe the 2026-09-23 migration baseline; new panels must still be registered in the static audit.

| Stage | Work | Status |
|---|---|---|
Expand Down
16 changes: 13 additions & 3 deletions docs/design-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[简体中文](design-system.md) | [English](design-system.en.md)

> 本文件是全项目 UI 的唯一权威规范。所有 webview 面板(console / templatePanel /
> templateAssetPanel / tempScreenshots / annotationPanel / characterManager / boxPanel)必须遵循。
> templateAssetPanel / tempScreenshots / annotationPanel / characterManager)必须遵循。
> 实现真源:`media/shared/tokens.css`(Design Tokens)+ `media/shared/controls.css`(共享控件),
> **页面只负责组合这些类,不得自行重定义视觉规则。**

Expand Down Expand Up @@ -59,7 +59,7 @@ Dialog·Modal / 状态提示 / Loading / 空状态 / 错误状态。同类组件

## 4. 统一尺寸体系

- 间距:`--space-xs(4) / sm(6) / md(10) / lg(14) / xl(20)`
- 间距:`--space-xs(4) / sm(8) / md(12) / lg(16) / xl(24)`
- 控件高度:`--control-h-sm(24) / md(30) / lg(34)`
- 圆角:`--radius-sm(5) / md(8) / lg(11) / pill`
- 字号:`--font-xs(11) / sm(12) / md(13) / lg(15)`;字重仅 `--weight-regular(400)` / `--weight-medium(500)`
Expand Down Expand Up @@ -106,8 +106,18 @@ media/shared/tokens.css Colors · Typography · Spacing · Radius · Border
media/shared/controls.css Button(主/次/迷你/幽灵/图标) · Input · Select · Checkbox/Switch
· Tag · Card · Toolbar · SectionTitle · Empty/Broken/Hint · Divider
· 可点击性硬规范([role=button]、真按钮/行级区分层清单)
· .has-codicon / .is-icon-only(图标按钮的对齐与尺寸)
media/shared/codicons/ @vscode/codicons 0.0.36(codicon.css + codicon.ttf,原样内置)
media/shared/icons.js OkIcons.icon / label / iconOnly —— 面板里生成图标的唯一入口
```

**图标规范(2026-10-09)**:界面图标一律用 codicon(与 VS Code 原生 UI 同源),
不再用 emoji 或 Unicode 符号(`▶ ⚙ ⇄ ⟲ + 👁 × ↻` 等字形随字体漂移、读屏会念出符号名)。
仅图标的按钮必须同时有 `title` 与 `aria-label`(`OkIcons.iconOnly` 自动处理)。
同一语义只用一个图标:同步默认值 `sync`、恢复出厂 `discard`、交换标注 `arrow-swap`、删除 `trash`、
查看原图 `go-to-file` / `eye`。面板 HTML 需引入 `__SHARED_CODICONS_URI__` 与 `__SHARED_ICONS_URI__`,
CSP 需含 `font-src __CSP_SOURCE__`。

新增面板接入方式(**三步,缺一步样式就静默失效**):

1. `index.html` 按顺序引入 `__SHARED_TOKENS_URI__` → `__SHARED_CONTROLS_URI__` → 面板自身样式
Expand Down Expand Up @@ -138,7 +148,7 @@ media/shared/controls.css Button(主/次/迷你/幽灵/图标) · Input · Se

## 落地进度

2026-10-01 补充:框面板与框画廊共用 `media/boxPanel`,由 `src/boxPanels.ts` 接入共享层,静态审计已包含此目录。下表与“六个面板”记录的是 2026-09-23 的迁移基线,不能据此漏掉新增面板。
2026-10-09 补充:独立的框面板 / 框画廊(`media/boxPanel`、`src/boxPanels.ts`)已并入统一标注编辑器与资源预览并被移除;悬停与补全使用的位置预览逻辑移到 `src/positionPreview.ts`。下表与“六个面板”记录的是 2026-09-23 的迁移基线,新增面板仍须登记进静态审计。

| 阶段 | 内容 | 状态 |
|---|---|---|
Expand Down
2 changes: 1 addition & 1 deletion docs/interaction-parity-audit.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Sources: [parent registration](../package.json), [VS Code task page](../media/co
| 06 | Template / Rect / Point modes | Three adjacent buttons, with the active mode highlighted | Mode combo box | All modes are immediately visible on one side; the other requires opening a dropdown |
| 07 | Insert, copy, source buttons | Three persistent buttons at the bottom right of every thumbnail, directly bound to that card | Insert/copy/open in the top toolbar operate through `selectedValue`; no buttons inside the card | Direct target-card actions versus selecting a target and then using the toolbar |
| 08 | Selection and target feedback | No list selection state used by these buttons; each button captures its resource | Single-selection `JBList`; renderer changes background, text, and border for selection | Persistent selection and toolbar dependence differ |
| 09 | Single/double-click timing | Delayed single-click insertion, double-click copy, fixed 500 ms window; card buttons execute immediately | Same basic gestures, using system `awt.multiClickInterval` or a 500 ms fallback; insertion also checks that selection still matches the clicked item | Gesture results broadly match, but timing and selection dependencies differ |
| 09 | Single/double-click timing | (Since 2026-10-09) click = select, double-click / Enter = insert, Ctrl+C = copy, no delay window; card buttons execute immediately; all three thumbnail grids share these gestures and support arrow keys | Still click-to-insert and double-click copy, using system `awt.multiClickInterval` or a 500 ms fallback; insertion also checks that selection still matches the clicked item | **Needs sync**: VS Code moved to "click selects / double-click or Enter runs the primary action"; JetBrains `ThumbnailActions.kt` has not followed yet |
| 10 | Grid and card geometry | Responsive CSS grid, 118 px minimum column width, 96 px thumbnail area, left-aligned names | `JList.HORIZONTAL_WRAP`, fixed cell width of 120 plus scaled margins, scaled 72 thumbnail height, centered 10 pt bold names truncated by character count | Density, space usage, alignment, and truncation differ; values are source constants rather than measured screen pixels |
| 11 | Counts, empty/loading states | Filter/total counts, successful/failed thumbnail counts, explicit empty/no-match messages | Current preview component contains only toolbar, search, and list; failed loading results become an empty collection without equivalent count/empty/failure widgets | Empty data and loading failure are less distinguishable in this page; this does not assess every lower-level error path |

Expand Down
2 changes: 1 addition & 1 deletion docs/interaction-parity-audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
| 06 | Template / Rect / Point 切换 | 三个并排按钮,当前模式按钮突出显示 | 下拉框选择模式 | 一端直接可见三个模式,另一端需要打开下拉框 |
| 07 | 插入、复制、原图按钮 | 每张缩略图右下角常驻三个按钮,直接操作该卡片 | 顶部工具栏的插入、复制、打开按钮,通过 `selectedValue` 操作选中项;卡片内无按钮 | 直接点目标卡片按钮,与先选目标再点顶部按钮,两条操作路径不同 |
| 08 | 选中反馈与目标 | 卡片无用于这些按钮的列表选中态;每个按钮闭包绑定自身资源 | `JBList` 单选;渲染器按选中态改变背景、文字和边框 | 另一端有持续选中项,顶部按钮依赖它;操作目标的表达方式不同 |
| 09 | 单击/双击判定 | 卡片单击延迟插入,双击复制;统一使用 500 ms;卡片按钮立即执行 | 同样单击插入、双击复制,但等待系统 `awt.multiClickInterval`,不可用时才是 500 ms;插入还要求当前选中项与点击项相同 | 单击/双击结果大体相同,但时序与选中依赖不同 |
| 09 | 单击/双击判定 | (2026-10-09 起)单击 = 选中、双击 / Enter = 插入、Ctrl+C = 复制,无延迟窗口;卡片按钮立即执行;三处缩略图同一套手势并支持方向键 | 仍是单击插入、双击复制,等待系统 `awt.multiClickInterval`,不可用时才是 500 ms;插入还要求当前选中项与点击项相同 | **待同步**:VS Code 已改为「单击选中 / 双击或 Enter 主操作」,JetBrains 端 `ThumbnailActions.kt` 尚未跟进 |
| 10 | 网格与卡片规格 | CSS 自适应网格,最小列宽 118 px;缩略图区域 96 px;名称靠左 | `JList.HORIZONTAL_WRAP`,固定格宽为 120 加缩放边距;缩略图 72 加宿主缩放;名称居中,10 pt 粗体,按字符截短 | 排列密度、空间利用、标题对齐和截断方式不同;数值来自源码,非实测像素 |
| 11 | 计数、空态、缩略图状态 | 展示筛选数/总数、加载成功/失败数;无资源、无匹配有明确文字 | 当前预览组件只有工具栏、搜索和列表;加载结果异常回退为空集合,没有同等计数、空态和失败统计控件 | 空列表与加载失败更难从页面区分;这里未判断全部底层错误处理 |

Expand Down
Loading
Loading