Skip to content

Project Topic Tabs and Context Inspector#2925

Merged
esengine merged 18 commits into
esengine:main-v2from
SivanCola:codex/feat-project-topic-tabs-context
Jun 5, 2026
Merged

Project Topic Tabs and Context Inspector#2925
esengine merged 18 commits into
esengine:main-v2from
SivanCola:codex/feat-project-topic-tabs-context

Conversation

@SivanCola

@SivanCola SivanCola commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds browser-style project/global topic tabs so separate projects and topics can run concurrently.
  • Replaces the flat session-focused sidebar with a project workspace tree and topic management.
  • Adds a right-side workspace dock for files, changed files, and topic context, with chat-centered split-pane behavior.
  • Refines per-message actions for forking, summarizing, and rolling back conversation/code from a chosen user turn.
  • Adds persisted desktop preferences for language, appearance, close behavior, tab modes, and workspace layout.

Project topic tabs and context inspector

What This PR Does

Project/topic workspace model

  • Introduces workspace tabs with project/global scopes, topic ids, topic titles, active-tab delegation, tab ordering, and persisted restore.
  • Routes controller events by tab id so background tabs keep streaming output, tool state, approvals, asks, jobs, cost, balance, and transcript state while another tab is active.
  • Stores tab mode (normal, plan, yolo) per tab and restores it with the tab metadata instead of treating mode as one global composer state.
  • Normalizes Wails-bound arrays before they reach React so empty Go slices render as [] rather than null.

Sidebar, tab bar, and dock layout

  • Reworks the left project tree and top tab strip into a browser-like workspace shell with compact active states, stable row alignment, and yolo mode badges.
  • Makes the right dock a real split pane owned by the web layout, not by native-window resizing side effects.
  • Keeps the right-side toggle responsible only for collapsing/expanding the right dock; it no longer collapses the left sidebar or changes the native window size.
  • Moves the 文件 / 改动 controls to the left side of the right dock header and makes them responsive as the dock is dragged narrower.
  • Uses the requested first-open layout as the default when no user layout preference exists: left sidebar about 17.5% of the window, right file tree about 25%, and the chat pane gets the remaining centered space.
  • Persists manual sidebar and right-dock widths after the user drags them, so the default ratio applies only before the first manual layout change.
  • Splits right-dock width preferences by mode: file-tree width is compact by default, while preview mode can expand independently.

Message actions and rollback UX

  • Replaces the old message menu wording with the clearer action set:
    • 分叉会话
    • 总结这条之后
    • 总结这条之前
    • 仅回滚对话
    • 仅回滚代码
    • 回滚代码和对话
  • Removes the redundant 从这条消息开始 label.
  • Adds checkpoint metadata for whether a turn can roll back conversation and/or code, and disables impossible menu actions with a concrete reason.
  • Adds confirmation states for destructive rollback actions and surfaces changed-file counts where code rollback is available.
  • Wires the desktop frontend through tab-aware checkpoint and message-action controller calls so the action applies to the selected tab, not an arbitrary active controller.

Desktop preferences and native shell behavior

  • Moves desktop UI language and theme persistence from frontend-only localStorage into desktop config, with one-time migration from older localStorage values.
  • Adds a General settings section for language and close behavior.
  • Adds a close behavior preference: close-to-background or quit.
  • Adds native single-instance behavior so launching the app again restores/shows the existing desktop window instead of creating an ambiguous second instance.
  • Adds a native menu quit path that can bypass close-to-background when the user explicitly quits.

Config and CLI support

  • Extends config edit/migration/render paths to include desktop preferences without mixing them into CLI prompt language semantics.
  • Keeps CLI language behavior separate from desktop UI language.
  • Updates boot/config/control tests around the new config fields, tab modes, and message action state.

Root Cause

  • The desktop app was centered on one active controller/session, so switching workspaces replaced the active conversation instead of preserving multiple project-specific conversations.
  • Background tab events needed durable routing by tab identity; dropping non-active events caused streaming output, tool state, approvals, asks, and rollback checkpoints to disappear when users switched tabs.
  • The right-side workspace area had overlapping ownership between native window size, chat width, and dock width, which caused the right dock toggle to produce unrelated layout changes such as sidebar collapse or clipped controls.
  • Layout defaults were fixed pixel values, so first-open proportions did not match the intended left/chat/right balance on common desktop widths.
  • Wails-bound Go slices can serialize as null, which made React list rendering brittle when project/topic/context arrays were empty or absent.

Technical Approach

  • Introduced workspace tab management with per-tab controllers, tab metadata, persistence, active-tab delegation, and tabId event routing.
  • Added workspace-root-aware boot/config loading so project tabs scope config, skills, memory, hooks, commands, codegraph, and LSP state without changing process cwd.
  • Extended session metadata with scope, workspace root, topic id, topic title, and tab mode so topics can be restored and resumed.
  • Reworked frontend controller state into a per-tab state map and added TabBar, ProjectTree, ContextPanel, right-dock layout preferences, and shared Wails array normalization.
  • Collapsed right-dock sizing into a deterministic grid allocator: left sidebar width, chat width, and dock width are separate state concepts, and the dock width is clamped against the available chat budget.
  • Added rightDockTreeWidth and rightDockPreviewWidth layout preferences so compact file browsing and wider previewing do not fight each other.
  • Added checkpoint capability metadata plus tab-aware message-action APIs for fork/summarize/rollback operations.
  • Added desktop config fields and migration helpers for appearance, language, and close behavior.
  • Added Wails SingleInstanceLock, close interception, and explicit quit handling for native desktop lifecycle behavior.

Focused Optimization Points

  • Preserves background tab streaming, tool, approval, ask, transcript, and mode state while only switching the active view.
  • Restores persisted tab ids and resumes the latest session for each topic id.
  • Ensures Wails-bound array responses encode as [] instead of null, with regression coverage.
  • Aligns the left project tree, top tab strip, and right workspace dock with the expected browser-like workspace layout.
  • Keeps the chat pane as the visual center and prevents the right dock from causing horizontal overflow at common desktop widths.
  • Keeps file-tree-only right dock compact on first open while allowing preview mode to expand when needed.
  • Neutralizes the light theme surfaces away from the previous warm beige tone for a cleaner product workspace presentation.
  • Keeps desktop UI language separate from CLI/model language so changing the desktop interface does not rebuild or perturb model prompt behavior.

Verification

  • npm run build in desktop/frontend
  • go test ./... in desktop
  • go test ./internal/boot ./internal/config ./internal/control ./internal/cli ./internal/fileref ./internal/agent
  • git diff --check
  • git diff --cached --check
  • Playwright/Chrome DOM audit for first-open layout after clearing reasonix.layoutPreferences.v1:
    • 2048px window: sidebar 358px, chat 1170px, right dock 512px, horizontal overflow 0
    • 1920px window: sidebar 336px, chat 1096px, right dock 480px, horizontal overflow 0
    • 1600px window: sidebar 280px, chat 912px, right dock 400px, horizontal overflow 0
    • 1280px window: sidebar 228px, chat 760px, right dock 284px, horizontal overflow 0
  • Playwright/Chrome persistence audit with saved layout preferences:
    • saved sidebarWidth=300 and rightDockTreeWidth=420 remain 300/420 after refresh, proving user manual layout overrides the first-open default

@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 3, 2026
@SivanCola SivanCola marked this pull request as ready for review June 3, 2026 12:29

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b7e09d0ea2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/app.go Outdated
Comment thread desktop/app.go Outdated
@SivanCola SivanCola marked this pull request as draft June 3, 2026 19:22
# Conflicts:
#	desktop/app.go
#	desktop/app_test.go
#	desktop/bound_array_contract_test.go
#	desktop/frontend/src/App.tsx
#	desktop/frontend/src/components/Composer.tsx
#	desktop/frontend/src/components/ContextPanel.tsx
#	desktop/frontend/src/components/EffortSwitcher.tsx
#	desktop/frontend/src/components/ModelSwitcher.tsx
#	desktop/frontend/src/components/ProjectTree.tsx
#	desktop/frontend/src/components/TabBar.tsx
#	desktop/frontend/src/lib/bridge.ts
#	desktop/frontend/src/lib/types.ts
#	desktop/frontend/src/lib/useController.ts
#	desktop/frontend/src/styles.css
#	desktop/skills_app_test.go
#	desktop/tabs.go
#	internal/agent/branch.go
#	internal/agent/save.go
#	internal/boot/boot.go
@SivanCola

Copy link
Copy Markdown
Collaborator Author

@codex review

@SivanCola

Copy link
Copy Markdown
Collaborator Author

Addressed the Codex bot findings in 2aae4a1e.

  • File-reference APIs now resolve against the active tab workspace root instead of the process cwd. This covers ListDir, SearchFileRefs, ReadFile, OpenWorkspacePath, and RevealWorkspacePath, with path containment still enforced by the shared workspace path resolver.
  • Added a regression test proving a project tab whose workspace differs from the launch cwd lists/searches/previews files from the project root only.
  • Confirmed provider/effort resolution is workspace-root aware via LoadForRoot(tab.WorkspaceRoot) and added a regression test where a project reasonix.toml defines the active provider effort.

Verification:

  • go test . -run 'Test(FileRefsUseActiveTabWorkspaceRoot|SearchFileRefsFindsNestedBasename|EffortForTabResolvesProjectProviderConfig|SetEffortForTabIsTabLocal)' in desktop
  • go test ./... in desktop (first run hit a TempDir cleanup race in an unrelated test; immediate rerun passed)
  • go test ./internal/boot ./internal/config ./internal/control ./internal/cli ./internal/fileref ./internal/agent
  • git diff --check

@SivanCola SivanCola marked this pull request as ready for review June 5, 2026 01:59

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7d8fc83649

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread desktop/frontend/src/App.tsx Outdated
Comment thread desktop/app.go Outdated
SivanCola and others added 3 commits June 5, 2026 10:09
…dex/

The project-tabs branch carried 30 throwaway screenshots, a mock HTML,
and a codex env file into the tree because tmp/ and .codex/ were never
ignored. Remove them and add the ignore rules so scratch output stays
out of future commits.
@esengine esengine self-requested a review June 5, 2026 02:14
The new project/topic/workspace tests only overrode HOME and
XDG_CONFIG_HOME, but desktopConfigDir() and config.MemoryUserDir()
resolve through os.UserConfigDir(), which reads %AppData% on Windows and
ignores those vars. With AppData pointed at one shared TestMain dir, the
project/topic/workspace registries leaked across tests: full-package
runs failed (project tree len 2 want 1, trash mixing other tests'
sessions, Plugins[0] reading a neighbor's MCP entry) while each test
passed alone.

Route every test through isolateDesktopUserDirs, which already sets
HOME, USERPROFILE, XDG_CONFIG_HOME, and AppData to a per-test temp dir.
go test ./... (and -race) now pass on Windows.
@esengine esengine merged commit b87a878 into esengine:main-v2 Jun 5, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants