diff --git a/docs/mockups/github-integration.html b/docs/mockups/github-integration.html new file mode 100644 index 0000000..ae44f01 --- /dev/null +++ b/docs/mockups/github-integration.html @@ -0,0 +1,333 @@ + + + + + +Mori · GitHub 集成 Mockup + + + +
+

Mori · GitHub 集成 mockup

+
+ + + +
+
+ +
+
+
+
mori — feat/sidebar-redesign
+
⌘K⌘G⌘⇧G
+
+ +
+ + + + +
+
mori feat/sidebar-redesign ~/workspace/mori
+
❯ swift build
+
Building for debugging...
+
[142/142] Compiling Mori MainWindowController.swift
+
Build complete! (8.41s)
+
+
gh pr checks 91
+
build-and-test 2m13s
+
swiftlint 14s
+
bundle-app 1m02s
+
 
+
+ + +
+
+ + gh dash — mori + ⌘⇧G +
+
+
+ My Pull Requests + Needs Review + Issues +
+
+ + #91 + redesign the sidebar — calmer, two levels + ●12 ✓ +
+
+ + #88 + fix tmux session list + switching + ◷3 +
+
+ + #93 + MoriGitHub: gh dash + PR strip mockup + draft +
+
+ + #84 + MoriRemote: rework key bar by role + ●2 ✓✓ +
+
+ + #82 + MoriIPC: SSH endpoint reconnect backoff + running +
+
+ checkout + o browser + c comment + d diff + / filter +
+
+
+
+
+ +
+ Tier 1gh dash 作为 companion tool 跑在右侧面板,⌥G 唤起,复用 lazygit 那套架构 + Tier 2 — 仅选中 worktree 展开 PR 状态条:编号 / 状态 / CI checks,点击 ↗ 开浏览器 +
+ + + + diff --git a/docs/mockups/github-integration.md b/docs/mockups/github-integration.md new file mode 100644 index 0000000..c9d3d42 --- /dev/null +++ b/docs/mockups/github-integration.md @@ -0,0 +1,33 @@ +# GitHub 集成 — 提案 mockup + +> 配套可视化:[`github-integration.html`](./github-integration.html)(浏览器打开,顶部按钮切换 Tier 1 / Tier 2 / 叠加) + +让 Mori 更好地管理 PR,但**不**嵌 github.com 整页 WebView(认证两套 token、不 native、脱离 worktree 上下文)。分两层落地。 + +## Tier 1 — `gh dash` 作为 companion tool(性价比最高,先做) + +把官方扩展 [`gh dash`](https://github.com/dlvhdr/gh-dash) 当成一个内嵌 TUI,跑在右侧 ~420pt 的 companion pane,**⌘⇧G** 唤起 —— 完全复用现有的 lazygit 集成架构(`CompanionToolPaneController`)。 + +- 新增 `CompanionTool.githubDash` 枚举值 + `tools.ghDash` 键位(⌘⇧G),几乎零新 UI。 +- **lazygit(⌘G)/ yazi(⌘E)完全不动**:三者平级共用一个面板,按各自键互相切换,和现状逻辑一致。 +- PR / Issue 列表、review 队列、checkout、评论、看 diff,全在终端里。 +- 前提:用户已装 `gh` 和 `gh-dash` 扩展(启动时探测,缺了给一行提示)。 + +## Tier 2 — worktree PR 状态条(小幅 native,让它有上下文) + +**仅选中的 worktree** 展开一条 PR 状态条(其余行收起,保持 sidebar 干净),绑定该 branch: + +- `gh pr view --json number,state,statusCheckRollup,reviewDecision` +- 显示 编号 / 状态(open·draft·review)/ CI checks(✓ ✕ ●)。 +- 点击 → `gh pr view --web`(开浏览器)。 +- 新建 `MoriGitHub` 包,沿用 `MoriGit` 的 actor + 轮询模式(`GitStatusCoordinator` 同款)。 + +这是 Mori 比裸 `gh` 强的地方:把 GitHub 状态钉在 worktree 上。 + +## 暂不做 — Tier 3 富 PR WebView + +真要内嵌富 diff / review 线程,再考虑只嵌**单个 PR URL** 的 WKWebView(注入 `gh auth token`)。先验证前两层需求,大概率发现不需要。 + +--- + +**本 PR 只含 mockup,无功能代码。** 确认方向后再分 Tier 实现。