Skip to content

feat(settings): 7-pane sidebar + MCP Instructions; home 1:1 calibration (#40)#78

Open
cuic19053-hue wants to merge 3 commits into
appergb:mainfrom
cuic19053-hue:feat-40-settings-mcp-home
Open

feat(settings): 7-pane sidebar + MCP Instructions; home 1:1 calibration (#40)#78
cuic19053-hue wants to merge 3 commits into
appergb:mainfrom
cuic19053-hue:feat-40-settings-mcp-home

Conversation

@cuic19053-hue

Copy link
Copy Markdown
Contributor

Summary

Implements Issue #40: Settings multi-pane layout with MCP Instructions + Home 1:1 calibration.

Closes #40.

Changes

Settings — sidebar + detail layout (7 panes + MCP Instructions)

  • Restructured SettingsView.tsx from single-page scroll to a sidebar + detail layout (mirrors upstream Settings/SettingsView.swift): 180px sidebar with icon + label rows and an active capsule on the left edge.
  • 8 pane entries: General, Appearance, Import, AI, MCP Instructions (new), Storage (new), Notifications (new), About.
  • McpInstructionsPane (the headline feature): surfaces the built-in MCP server URL (http://127.0.0.1:19789/mcp) with a copy button, plus one-line install commands for:
    • Claude Code: claude mcp add --transport http opentake http://127.0.0.1:19789/mcp
    • Codex: codex mcp add opentake --url http://127.0.0.1:19789/mcp
    • Cursor: JSON config for mcpServers
    • Claude Desktop: JSON config for claude_desktop_config.json
    • Each command has its own copy button with copied-feedback.
    • Mirrors upstream Help/MCPInstructionsPane.swift, consolidated into Settings per the issue.
  • StoragePane: cache + search-index fields (simplified placeholder; runtime statistics require Rust commands not yet wired — called out explicitly in the UI).
  • NotificationsPane: generation-complete toggle (front-end-only for now; wiring to system notifications is a follow-up).

Home — 1:1 calibration with upstream ProjectCard.swift / HomeView.swift

  • ProjectCard:
    • Hover scale 1.021.03 (match upstream ProjectCard.swift:97).
    • Title moved inside the thumbnail with a 60px bottom gradient overlay (upstream pattern), replacing the below-card title.
    • Relative time (today / yesterday / N days ago / N weeks ago / N months ago) replaces the raw path display, using the existing RecentProject.openedAt timestamp. Mirrors upstream RelativeDateTimeFormatter.
    • Delete button rounded to a circle (upstream glassEffect pattern).
  • NewProjectCard: hover scale 1.021.03.

i18n

  • 30+ new keys (zh-CN + en) for MCP, Storage, Notifications, and relative-time strings.

Verification

  • pnpm tsc --noEmit — passes
  • pnpm build — passes (vite build OK)

Notes

  • The MCP server URL is hardcoded to http://127.0.0.1:19789/mcp because the Rust server (opentake-agent::mcp::server::DEFAULT_ADDR) binds to a fixed port. A follow-up could add a mcp_get_status Tauri command to surface runtime state (running/stopped, actual port).
  • StoragePane and NotificationsPane are intentionally lightweight — they establish the pane structure and surface the UX, with backend wiring left for follow-ups (cache-clear command, system notification integration).
  • Home elements that depend on remote resources (SampleProjectsStrip, WelcomeOverlay hero image) or an account system (IdentityStrip, Sign in with Google) are out of scope for this PR and left for follow-ups.

…:1 calibration (appergb#40)

Settings:
- Restructure from single-page scroll to sidebar + detail layout (mirrors
  upstream SettingsView.swift): 180px sidebar with icon+label rows and an
  active capsule on the left edge.
- 8 pane entries (General, Appearance, Import, AI, MCP Instructions, Storage,
  Notifications, About) — the 7-pane scope from the issue, with General and
  Appearance kept as separate panes (upstream merges them under "general"
  but OpenTake's existing split is preserved).
- New MCPInstructionsPane: surfaces the built-in MCP server URL
  (http://127.0.0.1:19789/mcp) with copy button, plus one-line install
  commands for Claude Code, Codex, Cursor, and Claude Desktop. Mirrors
  upstream Help/MCPInstructionsPane.swift, consolidated into Settings per
  the issue.
- New StoragePane: cache + search-index fields (simplified placeholder;
  runtime statistics require Rust commands not yet wired).
- New NotificationsPane: generation-complete toggle (front-end-only for now).

Home (1:1 calibration with upstream ProjectCard.swift / HomeView.swift):
- ProjectCard: hover scale 1.02 -> 1.03 (match upstream).
- ProjectCard: title moved inside the thumbnail with a 60px bottom gradient
  overlay (upstream pattern), replacing the below-card title.
- ProjectCard: relative time (today / yesterday / N days ago / N weeks ago /
  N months ago) replaces the raw path display, using the existing
  RecentProject.openedAt timestamp.
- ProjectCard: delete button rounded to a circle (upstream glassEffect
  pattern).
- NewProjectCard: hover scale 1.02 -> 1.03.

i18n: 30+ new keys (zh-CN + en) for MCP, Storage, Notifications, and
relative-time strings.

Closes appergb#40.

@appergb appergb left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cuic19053-hue 自动审核结论:请修改(REQUEST_CHANGES)。代码类型安全、无冲突,但 issue #40 验收仅约 50%,且触发文件规约:

阻塞项:

  1. issue #40 主页 1:1 缺失:Sign in with Google 侧栏按钮、File missing 缺失态遮罩(上游 ProjectCard.swift questionmark.folder + 半透明)、SampleProjectsStrip 示例区、Update vX 徽标/WelcomeOverlay 均未实现。
  2. Settings 缺 pane:#40 要求 Account/Models/Notifications/Privacy/Shortcuts/Storage/MCP 共 7 个;本 PR 缺 Models/Privacy/Shortcuts/Account(对应上游 ModelsPane/PrivacyPane/ShortcutsPane)。
  3. SettingsView.tsx 合并后 ~884 行 > 800 规约;McpInstructionsPane ~90 行、SettingsSidebar ~75 行 > 50 行函数规约。请按上游模式拆为独立文件(McpInstructionsPane.tsx / StoragePane.tsx / NotificationsPane.tsx 等)。

其他(建议一并修):MCP 配置 Cursor 缺 type:http 字段、Claude Desktop 错用 Cursor 的 url 格式(上游用 npx mcp-remote);StoragePane 清缓存是 no-op 却显示成功;NotificationsPane 开关未持久化(上游走 UserDefaults)。请补齐后重新提交并自验 tsc + pnpm build。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

设置多分页(7 panes 含 MCP Instructions)+ 主页 1:1 校准

2 participants