diff --git a/docs/start-page-design.md b/docs/start-page-design.md new file mode 100644 index 0000000..70aa2ca --- /dev/null +++ b/docs/start-page-design.md @@ -0,0 +1,52 @@ +# Default-page design + +Endor is a working object and UI environment. This page should help someone begin +working, with three existing actions, rather than explain the VM or advertise +future model connections. Layout, painting and callbacks live in Endor source. + +## Reference decisions + +| User reference | Adopt | Adapt for Endor | +| --- | --- | --- | +| Codex | Clear selected tab and restrained grouped actions | Keep the existing rounded tabs and continuous top/left chrome; omit its tool directory | +| Chrome | A recognizable visual center and immediately usable actions | Use a compact centered start surface; no search field without working search | +| Obsidian | A short vertical list of equal-sized quick actions | Three 360 × 40 logical-pixel action rows with consistent text alignment and spacing | +| VS Code | Quiet branding and aligned action/shortcut information | 28 px wordmark, 14 px supporting text, separate shortcut rows; no oversized slogan | + +## Tokens and composition + +- Chrome: #E6E9ED; canvas: existing #F7F7F5; action rows have no fill or border. +- Text: #30343B; supporting text: #80858D; action labels use existing native interface text. +- Typeface: existing native interface family with CJK fallback. A desktop tool + should follow the OS text conventions; a decorative web font is inappropriate. +- Type scale: 28 px wordmark, 14 px labels and supporting information. +- Action height: 40 px; no visible container; vertical rhythm: 8 px. +- Group width: 360 px; page centered in content constraints. The app's current + minimum window is 720 × 480, leaving room for the full group and chrome. +- Keep the normal native button focus outline and existing event handling. + +```text + Endor + 创建页面,或从一个示例开始。 + + + 创建页面 + ↗ 共享对象示例 + ◇ 界面组合示例 + + 新建标签页 ⌘T / Ctrl+T + 关闭标签页 ⌘W / Ctrl+W +``` + +## Review before implementation + +The rejected surface had two competing large titles, prose wider than its actions, +blue buttons of different widths and one long shortcut sentence. Replace those +with one small wordmark, one functional hint, quiet text actions and paired +shortcut rows. The first screenshot review still showed three white bordered +blocks that the user found too prominent; those surfaces were removed, bringing +the action treatment closer to VS Code while retaining Obsidian's short list. + +Guidance reviewed: Anthropic's frontend-design SKILL.md (upstream main, retrieved +2026-10-24), using its plan/review/build/critique process. Only a temporary copy +was fetched; no global skill, hooks, browser runtime or frontend dependency was +installed. Native screenshot review and button activation checks follow the build. diff --git a/docs/ui-workspace-audit.md b/docs/ui-workspace-audit.md index e18a242..03a6d85 100644 --- a/docs/ui-workspace-audit.md +++ b/docs/ui-workspace-audit.md @@ -89,3 +89,21 @@ white fill and dark text; inactive titles use muted text. Geometry and borderles selection are unchanged. After rebuilding and restarting, the native window showed one startup tab; a + click added a second tab and the two states were visually checked. Formatting, all-target offline Clippy and release bundling passed. + +## Start-page visual redesign + +Reviewed the four user-supplied Codex/Chrome/Obsidian/VS Code references and +Anthropic's frontend-design skill. Reference decisions and tokens are recorded in +`docs/start-page-design.md`. The default page now uses one 28 px wordmark, a short +14 px hint, aligned action rows and separate shortcut rows. A first pass with +white outlined buttons was rejected by the user; the action fill and border were +removed in the final pass. The Endor Button subclass keeps a 360 × 40 hit target +but returns an empty background display list; its label and native focus indicator +still render through the existing tree. + +Native screenshot review confirmed the final text-row treatment. Clicking the +shared-object action opened its Page; Tab focused the first action with a visible +outline. Startup displayed one default Page. Formatting, all-target offline Clippy, +release bundling and diff whitespace checks passed. No automated test suite was run. +The design skill was read from a temporary download only; no global skill, hooks +or new application dependency was installed. diff --git a/src/ui_bridge/start_page.endor b/src/ui_bridge/start_page.endor index a4d0212..44b4944 100644 --- a/src/ui_bridge/start_page.endor +++ b/src/ui_bridge/start_page.endor @@ -11,6 +11,21 @@ class StartRow: Row { return MeasureResult(constraints.maxWidth, measured.height) } } +// Quiet action rows retain native hit targets and keyboard focus without card chrome. +class StartButton: Button { + function measure(self: StartButton, mount: Mount, constraints: Constraints): MeasureResult { + return MeasureResult(360, 40) + } + function paint(self: StartButton, mount: Mount, geometry: Bounds): DisplayList { + return DisplayList(ObjectList()) + } +} +class StartLine: Row { + function measure(self: StartLine, mount: Mount, constraints: Constraints): MeasureResult { + measured = Row.measure(self, mount, constraints) + return MeasureResult(360, measured.height) + } +} class StartActions { home: Page function blank(self: StartActions, event: Event): Unit { @@ -39,18 +54,24 @@ function newTab(): Page { page = StartPage() page.title = "新标签页" actions = StartActions(page) - blank = Button("+ 创建页面") - counter = Button("↗ 试试共享对象") - compose = Button("▦ 探索界面组合") + blank = StartButton("+ 创建页面") + counter = StartButton("↗ 共享对象示例") + compose = StartButton("◇ 界面组合示例") blank.on("click", actions.blank) counter.on("click", actions.counter) compose.on("click", actions.compose) - content = Column(0, 14, - TextBlock("Endor", 3, "#292B2D"), - TextBlock("从一个对象开始。", 2, "#484B50"), - TextBlock("用代码组织对象,让同一份内容成为可交互的界面。", 1, "#7D8085"), - Spacer(16), blank, counter, compose, Spacer(16), - TextBlock("⌘ / Ctrl + T 新建标签页 · ⌘ / Ctrl + W 关闭", 1, "#8B8E93")) + heading = StartLine(0, 0, TextBlock("Endor", 2, "#30343B")) + heading.mainAlign = "center" + subtitle = StartLine(0, 0, TextBlock("创建页面,或从一个示例开始。", 1, "#80858D")) + subtitle.mainAlign = "center" + newHint = StartLine(0, 0, TextBlock("新建标签页", 1, "#8A8F97"), TextBlock("⌘ T / Ctrl + T", 1, "#747B85")) + newHint.mainAlign = "space-between" + closeHint = StartLine(0, 0, TextBlock("关闭标签页", 1, "#8A8F97"), TextBlock("⌘ W / Ctrl + W", 1, "#747B85")) + closeHint.mainAlign = "space-between" + content = Column(0, 8, + heading, subtitle, Spacer(20), + blank, counter, compose, Spacer(20), + newHint, closeHint) row = StartRow(24, 0, content) row.mainAlign = "center" page.mainAlign = "center"