Skip to content

[codex] add interactive Markmap view#9

Closed
ryan-wong-coder wants to merge 34 commits into
text2future:mainfrom
ryan-wong-coder:feat/markmap-view
Closed

[codex] add interactive Markmap view#9
ryan-wong-coder wants to merge 34 commits into
text2future:mainfrom
ryan-wong-coder:feat/markmap-view

Conversation

@ryan-wong-coder

Copy link
Copy Markdown

What

Add an interactive Markmap document view alongside the existing editor. The new view renders the complete Markdown structure, supports zooming, panning, folding, fullscreen presentation, and a reading-focused zoom shortcut. Clicking text nodes opens a right-side preview for rich content including prose, tables, code, Mermaid diagrams, and AI thread cards.

Why

Long documents are difficult to understand from the editor's linear view alone. This gives users a readable overview while preserving the original Markdown as the single source of truth. Long Chinese text is constrained to a comfortable node width with a two-line preview instead of collapsing into narrow columns or disappearing.

Closes #8.

How tested

  • cargo test --workspace
  • cargo fmt --check
  • cargo clippy --workspace -- -D warnings
  • npm run lint (no lint script is defined)
  • npx vitest run app/flowix-web/features/document/components/markmap/markmap-data.test.ts — 6 tests passed
  • npm run build
  • npm run tauri:build:mac
  • Manual verification on macOS: switched between editor and map, inspected long text and table nodes, exercised pan/zoom and reading-fit controls; screenshot attached to feat(document): add interactive Markmap view #8

Risks

  • Very large documents produce a correspondingly large SVG tree; lazy loading keeps the Markmap runtime out of the editor's initial bundle.
  • Rich previews reuse the existing Mermaid renderer and agent conversation store, so behavior follows those components' current loading and error states.

Checklist

  • No secrets / tokens / .env files touched
  • No force-push to main
  • If interface change: CHANGELOG / docs updated
  • If schema change: not applicable

htommr and others added 30 commits July 11, 2026 01:26
- Tauri 2 + Rust backend, React 19 + TS + Tiptap frontend
- rllm v1.1 OpenAI/Anthropic/DeepSeek via openai_compatible provider
- Status bar 'new version' pill wired to tauri-plugin-updater (ed25519 signed)
- Supabase product_update_notices with per-platform CTA (cta_mac_url / cta_win_url)
- Edge Function product-update-notices with strict semver gating
- Workspace package.version = 1.0.2 unified source of truth
Removes 60+ *.raw.jsonl / *.report.json files from tracking;
untracked deletion leaves local tmp/ untouched (those were
debug artifacts, not source).
- CONTRIBUTING.md: branch naming, commit message style, secrets rules,
  release process. Provides anchors (feat/, fix/, refactor/) for code
  review tooling.
- .github/PULL_REQUEST_TEMPLATE.md: forces author to document
  'what / why / how tested / risks' before merge.

No code change. Reviewers skip into actual surface via the template
hints, not the diff.
- product-update-pill.tsx: plugin-updater's DownloadEvent is
  'Started' | 'Progress' | 'Finished' (capital), not lowercase,
  and 'Progress.data' is per-chunk length, not cumulative.
  Replaced with manual accumulator (Started sets total from
  contentLength, Progress adds chunkLength).
- agent-thread-card-view.tsx: segments.at(-1) doesn't compile
  under tsconfig target=ES2020 (Array.prototype.at is ES2022).
  Replaced with segments[segments.length - 1]; same semantics.
- prepare-tauri-production-config.mjs: macOS branch now sets
  bundle.targets = ['app', 'dmg'] instead of just ['dmg']. Reason:
  tauri-plugin-updater downloads the .app bundle as a tar.gz; without
  the 'app' target, only .dmg is produced and the updater has nothing
  to fetch. DMG is still kept for human-download distribution.

- tauri.conf.json + tauri.conf.dev.json: rotate plugins.updater.pubkey
  to a minisign-native keypair (tauri-cli's signer subcommand hits
  a macOS keychain bug in this environment; a fresh 'minisign -G' pair
  works reliably). Old Tauri-generated keypair is preserved at
  ~/.tauri/keys/backup-tauri/.

- tauri.conf.json: updater endpoint placeholder
  flowix/flowix -> text2future/flowix (the actual repo).
End-to-end orchestrator:
  1. npm run tauri:build:production (already signed via TAURI_SIGNING_PRIVATE_KEY)
  2. tar.gz the macOS .app bundle, minisign-sign with the
     ~/.tauri/keys/flowix-dev.key file (the same one tauri build consumes)
  3. emit update.json pointing at the future GitHub release URL
  4. (CI only) gh release create + upload artifacts

Local dev: FLOWIX_SKIP_PUBLISH=1 default; build + sign + write update.json
to app/target/release/updater/, no GitHub write.

CI: GH_TOKEN + FLOWIX_SKIP_PUBLISH=0 enables publish; otherwise the same
script produces identical artifacts in app/target/release/updater/ that
.github/workflows/release.yml can `gh release upload`.

Tauri CLI's `signer sign` is currently broken on this macOS due to a
keychain round-trip; minisign is installed via brew and used directly.
Replaces a Windows NSIS-only pipeline with a 4-platform matrix
(macos aarch64 + x86_64, linux x86_64, windows x86_64) that runs
`tauri-action` to drive the full tauri build + sign + publish flow.

Why tauri-action over hand-rolled matrix jobs:
- tauri-action reads TAURI_SIGNING_PRIVATE_KEY (minisign) and signs
  updater archives per matrix entry, generating the correct
  *.app.tar.gz + .app.tar.gz.minisig for each platform.
- It bundles the freshly-signed `update.json` manifest back into the
  GitHub release as `latest/download/update.json`, which is the
  endpoint tauri.conf.json points at.
- mac/win/linux build matrices produce full asset set; we no longer
  ship a Windows-only release.

Required secrets (set in repo Settings -> Secrets and variables):
  TAURI_SIGNING_PRIVATE_KEY            - minisign private key (no password)
  TAURI_SIGNING_PRIVATE_KEY_PASSWORD   - optional
  GITHUB_TOKEN                         - implicit

Optional: APPLE_* and WINDOWS_* for native installer signing.
If those secrets are unset, tauri-action skips those signing steps
and ships unsigned installers (still verifiable via the updater's
minisign signature).
- security_bookmark: 拆分 record_directory / record_directory_bookmark,
  引入 start_accessing_for_path 公共入口与 activate_bookmark 复用,
  错误传播更明确
- providers/tools: ToolScope 持有 SecurityBookmarkStore,所有文件工具
  (read/write/edit/delete/ls/grep/glob) 在 IO 前激活 bookmark;
  glob 绝对路径统一 canonicalize,避免符号链接穿透
- commands: helpers 新增 start_security_bookmark_access 转发器;
  dialog/file/memo 在每个 IO 入口激活 bookmark,覆盖 attachment 读写、
  文档读写、版本管理、附件复制等全路径
- agent: AgentManager 注入 SecurityBookmarkStore 并下传到 execute_tool
- lib: 装配点补齐 security_bookmarks_arc 注入
- build: sign-cli.sh 给 ad-hoc 与 Developer ID 签名加上
  --entitlements,CLAUDE.md 同步补充 sidecar 先签、外层后签的步骤
- docs: README 拆分为中文 README.md + 英文 README.en.md
- git rm homepage/(8 个文件:index.html、favicon、图标、3 张主题图)
- README.md / README.en.md:移除主题预览区块及对应图片引用
- CLAUDE.md:架构图说明移除 homepage/ 列举
- CLAUDE.md:本地的 Claude 工作指令,保留在本地但不入远端
- 前端 *.test.ts(20 个)、Rust 集成测试(2 个)、memo_file/tests.rs:
  本地保留、远程不再纳入
- .gitignore 新增以上路径,本地不会被 status 噪音打扰
撤销 1d6a5d2 的 untrack 决策,把测试代码重新纳入远端:

- 前端 *.test.ts(20 个)
- flowix-cli 集成测试:cli_smoke.rs、serve_e2e.rs
- flowix-core memo_file/tests.rs(单元测试)

.gitignore 同步移除对应忽略规则,CLAUDE.md 保持本地专属。

Co-Authored-By: Claude <noreply@anthropic.com>
- 顶部加 readme-banner.png 替换原 PAGE 2-1.png
- 顶部加 Platform + Latest Release 徽章
- AI 能力段加 readme-agent.png 配图
- 删除 CLI / Distribution / Contributing / Secrets / License 段
- 中英文 README 同步修改
- 图片用 sips + oxipng 压缩到 < 1 MB

Co-Authored-By: Claude <noreply@anthropic.com>
- feat(web): agent-thread-card 拆为多个 controller(access / submit / composer / fullscreen / role / settings)
- feat(web): agent store / i18n / preferences / shell / platform 配套更新
- chore(deps): Cargo.toml + package.json 依赖更新
- chore(build): tauri 配置文件、scripts/build-cli.sh、scripts/release.sh、vite.config.ts
- feat(supabase): product_update_notices 表初始化 + drop cta_label 迁移
- chore(cargo): app/.cargo/config.toml 把 target-dir 重定向到 .flowix-build/

Co-Authored-By: Claude <noreply@anthropic.com>
release 脚本自动生成的版本号改动:

- app/Cargo.toml: workspace.version 1.0.1 → 1.0.3
- app/flowix-desktop/tauri.conf.json: 1.0.1 → 1.0.3
- app/flowix-desktop/tauri.conf.dev.json: 1.0.1 → 1.0.3
- package.json: 0.9.0 → 1.0.3
- app/Cargo.lock: 配套更新

Co-Authored-By: Claude <noreply@anthropic.com>
把顶部 `[中文] · [English]` 从独立一行改为
`# Flowix Memo <sup>[中文] · [English]</sup>`,
避免 H1 之前裸放的正文链接视觉上偏大、与标题脱节。

中英文 README 同步修改。

Co-Authored-By: Claude <noreply@anthropic.com>
把 `<sup>` 上标小字改为独立一行 HTML 链接:

- 用 `<a>` 标签保留点击行为
- `style="color: inherit"` 继承正文字色,去掉 GitHub 默认链接蓝
- 单独一行渲染为正文字号,不再有视觉突兀

中英文 README 同步修改。

Co-Authored-By: Claude <noreply@anthropic.com>
- 顶部徽章文案中文化:Platform → 支持平台、Latest Release → 版本号
- 删除 ✨ 简介 标题(首段已自解释)
- 删除整段:🏠 本地优先 / ✏️ 编辑体验 / 🖥️ 桌面原生 / 🚀 快速开始
- AI 段收敛为「多 Provider / 多 Agent」两条核心能力
- 删除 AI 段下「典型 AI 场景」列表
- 顶部重新整理水平分割线位置

Co-Authored-By: Claude <noreply@anthropic.com>
- 编号列表改为小节标题(→ 调研 & 开发项目管理 / 适合和 AI Agent 一起处理笔记)
- 新增「长期记忆沉淀资料」小节描述
- 适合轻量写作 标题改为 & 写法
- AI 段去掉 emoji,标题改为「AI 能力」
- AI 段重写:强调 BYOK 模式与本地 CLI Agent 支持

Co-Authored-By: Claude <noreply@anthropic.com>
需求都已落地,调研 / 计划 / 评审类笔记保留在本地工作流就够,
不再随仓库发布。docs/ 现在只保留 images/。

删除的 11 个文件:

- docs/README.md
- docs/MCP 实现原理调研笔记.md
- docs/codex-agent-architecture.md
- docs/frontend-design-architecture-issues.md
- docs/i18n-plan.md
- docs/mcp-implementation-notes.md
- docs/production-readiness-review.md
- docs/supabase-product-update-notices.md
- docs/test.md
- docs/前端问题.md
- docs/还有几类加载性能问题没处理,按影响排序.md

Co-Authored-By: Claude <noreply@anthropic.com>
- 应用场景四个小节从 ### 降为 ####,三个加「→」前缀
- AI 段标题改为「强大的 AI 管理能力」(####)
- 去掉两处多余的 --- 分割线,让段落更紧凑

Co-Authored-By: Claude <noreply@anthropic.com>
- 顶部顺序:语言切换 → # Flowix Memo → 徽章 → banner
- 第二段「…放进同一套文档」补「进行管理」
- 第三段 Flowix 文档定位说明放进代码块强调引用感
- 末尾环境要求改写:
  - 改为「安装需求 macOS 14+ 或 Windows 10+」
  - 二次开发补充 Node.js 20+、Rust 1.75+
- dev 配置 bundle identifier 改为 com.flowix.app.dev
  让 dev 与生产 app 身份完全隔离(系统 TCC / 权限不再共享)

Co-Authored-By: Claude <noreply@anthropic.com>
- 中英文 README 顶部导航各加 2 条:
  - 产品路线 / Roadmap → https://flowix-memo.com/roadmap
  - 近期更新 / Updates → https://flowix-memo.com/updates
- 链接样式从 inherit → 固定 #38362F(与 flowix-memo.com 主色对齐)
- hex 比 OKLCH 在 GitHub CSS sanitizer 下更稳,确保颜色实际生效

Co-Authored-By: Claude <noreply@anthropic.com>
GitHub 渲染时 hex / rgb color 都没生效,去掉所有
`<a style="color: ...">` 写法,链接回退为 GitHub 默认样式。

保留用户最新改的链接文案与分隔符:

- README.md:简体中文 / English / Roadmap / What's New
- README.en.md:中文 · English · Roadmap · Updates

Co-Authored-By: Claude <noreply@anthropic.com>
- agent-thread-card:单体 view 拆为分层控制器,事件订阅生命周期可清理、可重订阅
  - access/  IPC 调用边界
  - chrome/  header / badge / title-edit UI 控制器
  - composer/ 输入与发送
  - messages/ viewport / 缓存 / 渲染 / 单条渲染
  - runtime/  runtime / 订阅 / 会话 / 运行状态
  - view/    DOM 工厂(仅渲染)
- thread-history store 重构与单元测试补齐
- 版本:workspace.package 与两个 Tauri 配置同步升至 1.0.5

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
- Rust: 精简 CLI 路径解析,迁移历史/线程/工具层重构
- Web: agent-thread-card 拆为 access / runtime / settings / chrome / composer / view 子模块
- 新增 access-entries / access-popover-controller / agent-runtime-spec 单元测试
- 补 i18n 文案与 Tauri client IPC 入口
- 同步 types/agent.ts 与 editor CSS

Co-Authored-By: Claude <noreply@anthropic.com>
- Rust: flowix-desktop src/ 由扁平文件拆为分层模块
  - src/agent.rs → src/agent/{context,factory,persistence,provider,state,stream,tests,tools,wire}.rs
  - src/commands/memo.rs → src/commands/memo/{creates,deletes,helpers,mod,reads,versions}.rs
  - claude_*/codex_*/hermes_*/simple_cli.rs + external_run.rs → src/external_runtime/{claude,codex,hermes,simple_cli}/ + shared.rs
  - src/providers/openai_compatible.rs → src/providers/openai_compatible/{constants,media,mod,retry,stream,types}.rs
  - src/providers/tools/filesystem.rs → src/providers/tools/filesystem/{constants,edit,frontmatter,mod,operations,path,schema,search}.rs
  - src/threads.rs → src/session/{error,mod,store,tests,types}.rs
  - 新增 src/app/{bootstrap,mod,panic,paths,watchdog}.rs
  - 新增 src/config/{mod,access,path_scope,security_bookmark,user}.rs
  - 新增 src/device_registration.rs
  - agent_access / security_bookmark / path_scope / user_config 迁到对应子模块
- Web: agent-thread-card access/runtime/settings 迭代
  - 新增 initial-runtime-config / display-limits / external-agent-settings-controller 单元测试
  - agent-thread-card-{extension,submit-controller,view,messages/*,view/*} 配套更新
  - apply-chunk.test / codex-options / chat-store / tool-chunks / agent-runtime-spec / agent-conversation-store 调整
- 样式: editor-agent-thread-card.css / theme/light.css 微调
- i18n: locales.ts 补文案

Co-Authored-By: Claude <noreply@anthropic.com>
桌面端首次启动后异步向 Supabase 上报本机指纹,用于装机量统计与异常排查。

- register-device Edge Function:
  - 入参 deviceId / machineId / machineFingerprint / hostnameHash / os / arch
    / appVersion / locale / timezone / installedAt / appUserAgent
  - 仅 service_role 写入 device_registrations
- 20260712000000_device_registrations.sql:
  - device_registrations 表 (device_id unique, machine_id, os/arch/app_version,
    locale/timezone, hostname FNV-1a 16hex, 时间戳)
  - 入站唯一约束在 device_id 上,匿名默认 deny

Co-Authored-By: Claude <noreply@anthropic.com>
- Rust: external_runtime 各 CLI (claude/codex/hermes/simple_cli) 适配新模块边界
  - commands/agent / commands/thread 调整与 external_runtime 协同
  - config/user 调整
- Web agent store: 进一步拆分为单一职责模块
  - 新增 chunk-result / message-chunks / conversation-run-sync / stream-event-dispatcher
  - 新增 run-lifecycle / thread-runtime-state / thread-titles (+test)
  - 新增 primary-workspace / snapshot-reconcile (+test)
  - 新增 load-thread-actions / chat-thread-accessors (+test)
  - 新增 chat-store-migration (+test) / external-session (+test)
  - 既有 chat-store / agent-conversation-store / initial-runtime-config / tool-chunks 配套调整
- Web agent thread card: role picker + run status presenter
  - 新增 role/agent-role-picker-controller 与 quick-phrases 单元测试
  - 新增 runtime/run-status-presenter 单元测试
  - settings/external-agent-settings-controller (+test) 调整
  - agent-thread-card-view / agent-thread-card.test 配套更新
- Web preferences: 新增 quick-phrases 速记面板
  - sections/quick-phrases (+ user-settings-store.test)
  - preferences-view / sections/{document-properties,index} / store/user-settings-store 调整
- i18n / types / constants: locales / types/agent / lib/constants 同步

Co-Authored-By: Claude <noreply@anthropic.com>
- agent-runtime-spec: PrimaryWorkspaceSource empty 变体收窄后再取 path
- agent-conversation-store: 接口补 lockInstanceFileSeed 声明 (同时修掉 instanceId 隐式 any)
- external-agent-settings-controller: 删除只写不读的死属性 lastFilesControlSource
- 测试 fixture: agentType/status/role 加 as const; zh -> zh-CN; 删未用 AgentTypeKey import

均为不改运行时行为的类型修正,让 tauri build 的 beforeBuildCommand (tsc) 通过。

Co-Authored-By: Claude <noreply@anthropic.com>
htommr and others added 4 commits July 13, 2026 20:58
…gpt-codex

fix(agent): detect Codex bundled with ChatGPT.app
Add a readable document map with rich block previews and focused navigation.\n\nCloses text2future#8
@ryan-wong-coder

Copy link
Copy Markdown
Author

Rebuilt from the rewritten 1.0.6 main history in #11. The replacement branch contains only the Markmap feature commit on top of the new upstream root.

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.

feat(document): add interactive Markmap view

3 participants