Skip to content

feat(sidebar): sort topics by activity, add collapse/expand all#3698

Open
ttmouse wants to merge 77 commits into
esengine:main-v2from
ttmouse:pr/sidebar-clean
Open

feat(sidebar): sort topics by activity, add collapse/expand all#3698
ttmouse wants to merge 77 commits into
esengine:main-v2from
ttmouse:pr/sidebar-clean

Conversation

@ttmouse

@ttmouse ttmouse commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

侧边栏改进

主题按活动时间排序

  • 侧边栏中的主题(global + project)现在按 lastActivityAt 降序排列,最近活跃的靠前
  • 同活动时间时按标题字母序排序
  • 替换旧的 orderedTopicIDs() 实现

全部折叠/展开

  • Projects 标题旁增加一个折叠/展开全部按钮(双向箭头图标)
  • 动态判断当前状态:全部已展开时显示 "Collapse all",否则显示 "Expand all"
  • 样式与旁边的 "+" 按钮一致

Go changes only

  • desktop/tabs.go: add sortTopicIDsByActivity, topic read tracking infrastructure
  • desktop/frontend/src/components/ProjectTree.tsx: add collapse/expand button
  • desktop/frontend/src/locales/en.ts, zh.ts: i18n labels
  • desktop/frontend/src/styles.css: collapse button styles

Files changed

6 files, +307/−23 lines

SivanCola and others added 30 commits June 8, 2026 11:35
- 删除 TabBar 组件及其所有相关 state/handlers(tabOrderIds、tabRevealSignal、
  visibleTabs、handleTabChange/Close/Reorder/NewTab 等)
- 删除 workspace-tabs-bar 容器及 .workspace-tabs-bar CSS
- 将右侧面板切换按钮移入 topicbar__actions 末尾,使用与 Copy/Export
  一致的 topicbar__action-btn topicbar__action-btn--icon 样式
- 删除之前误加的 chat-pane__topbar 独立条及其 CSS
- 还原被构建过程误删的 dist/.gitkeep
- 非编辑模式:h1 直接显示 tab.topicTitle,不再包含 workspace 前缀
- 编辑模式:去掉 topicbarProjectPrefix / 前缀
- 删除不再需要的 topicbarProjectPrefix 变量
移除 .project-tree__topic 的 margin-right: var(--project-tree-action-column),
该 36px 右间距是为一级菜单的 '+' 按钮预留的,二级菜单没有操作按钮,
却保留了该间距导致右侧出现多余空白,无法撑满全宽。
删除项目行左侧无实际意义的 Folder 图标,只保留展开箭头和颜色标识圆点。
这样一二级菜单的视觉更简洁统一。
- 将 .project-tree__topic 的 margin-left 从 22px 改为 11px
- 文字起始位置 = 11px (margin) + 30px (padding: 14+16) = 41px
- 与一级菜单文字起始位置 8+12+7+7+7=41px 完全对齐
给 .sidebar__new、.project-tree__search、.project-tree__header
添加 flex-shrink: 0,防止当项目列表内容过多时被 flex 容器压缩高度。
在新增项目按钮左侧增加一个双向箭头按钮,点击切换全部折叠/展开。
- 递归收集所有可展开节点 key 判断当前状态
- 动态 Tooltip:全部已展开→'Collapse all',否则→'Expand all'
- 样式与旁边的 '+' 按钮一致
- 双击二级菜单直接进入重命名模式
- 选中状态改为圆角,移除左侧彩色条纹
- 右侧显示相对时间(3 分钟、1 天等),去掉'前'字
- 折叠/展开按钮图标区分状态:展开时 ⥮,折叠时 ⇅
The unread indicator dot in the left sidebar topic list used
`var(--fg-muted)` which was never defined anywhere in the project,
making the dot transparent and invisible.

Replaced with `var(--fg-dim)`, a defined gray variable available
in both dark and light themes.
…betically

Introduce sortTopicIDsByActivity() that accepts a callback to get each
topic's activity timestamp, and returns IDs sorted most-recent-first.
Updates both global and project topic list sections in ListProjectTree
to pass the activity from on-disk sessions or open tabs.

The old orderedTopicIDs() remains (unused) and will be removed in a
follow-up commit.
Replaced by sortTopicIDsByActivity() in the previous commit.
All 5 remaining uses of the undefined var(--fg-muted) are now
replaced with defined variables:
- workspace-branch-indicator → var(--fg-faint)
- settings-model-current__meta span → var(--fg-dim)
- provider-readonly-field--stacked span → var(--fg-faint)
- provider-model-fetch-row span → var(--fg-faint)
- right-panel__tab → var(--fg-dim)

This was the same root cause as the invisible unread dot: --fg-muted
was never defined in the project.
The refresh button (RefreshCw icon) sits on the right side of the
workspace-branch-indicator, calling loadChanges() on click. It shows
a spin animation while loading and is disabled during the request.
Replace the static branch name span in the git branch indicator with
a clickable button that opens a dropdown listing all local branches.
Clicking a branch in the list calls GitCheckout on the backend and
refreshes the changes view.
- Green pulse dot → accent-color spinning ring (process-card__spin style)
- Add will-change: transform for smooth animation on topic switch
- Go backend emits agent:turn-done event for reliable turn-complete detection
- frontend bridge adds onTurnDone() listener
- sound.ts supports 5 configurable sounds (synth + 4 WAV files)
- Settings panel UI for sound selection
- AskCard plays attention chime on mount
- App.tsx uses onTurnDone event for success chime (no tab-switch misfire)
- Settings panel General section: two-row sound picker (success + attention)
- i18n: EN/ZH notification sound labels
- New generative-music.ts engine: oscillator → ADSR → lowpass filter → reverb
- Token-driven playback: fires a note per 4 text/reasoning tokens (not timer loop)
- 4 presets (classic/ethereal/digital/retro) + off switch in Settings
- C major pentatonic scale round-robin with random pitch detune
- 100ms throttle + 4:1 token sampling to handle high-speed DeepSeek output
- Fade-out on stop, preview in settings panel
- 标题栏 min-height 56px→44px,字号 18px→15px,字重 680→600
- 左侧边栏左右 padding 10px→6px
- 右侧分割线 resizer 背景 transparent→var(--chat-bg),消除黑色露底
- 重构 composer 工具栏/状态栏布局,移除 composer-runstatus 改用 statusbar 内联
- resizer 背景从 var(--chat-bg) 改为 var(--workspace-files-bg),
  消除分割线与 dock 之间的黑色间距
- 移除 .footer 的 border-top,消除聊天区与底部任务栏之间的分隔线
- composer-card 添加 margin-left: -1px; margin-right: -1px,
  使 border-box 下 1px 边框不占用内容区,内容与无边框元素左对齐
- 给 .transcript 增加 scrollbar-gutter: stable,预留滚动条空间,
  使内容区宽度不受滚动条出现/消失影响,与底部输入框对齐
- 移除 .transcript 的 scrollbar-width: thin 和 scrollbar-gutter
- Chromium 下 scrollbar-width 会强制 classic 滚动条占用布局空间
- 恢复默认 overlay 滚动条(浮动在内容上不占空间),
  使历史消息内容区与底部输入框始终同宽对齐
- overflow-y: overlay 让滚动条浮在内容之上不占布局空间
- 解决 WKWebView 中滚动条占据 ~8px 导致 transcript 内容区
  比 footer 窄,margin:auto 居中时历史消息偏左的问题
@ttmouse ttmouse requested a review from esengine as a code owner June 9, 2026 12:00
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) labels Jun 9, 2026
@ttmouse

ttmouse commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author
image

@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: 554bceaeef

ℹ️ 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/tabs.go
if abs, err := filepath.Abs(workspaceRoot); err == nil {
workspaceRoot = abs
}
saveWorkspace(workspaceRoot)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Restore project registration when opening tabs

When a project session is resumed from All History, onResumeSession opens the tab via OpenProjectTab(session.workspaceRoot, session.topicId) before resuming the session; if that workspace is not already in desktop-projects.json (for example an older/imported session or a project removed from the sidebar), this method now only saves the active workspace and never re-adds the project. ListProjectTree builds project sections solely from loadProjectsFile().Projects, so the resumed project/topic remains absent from the sidebar even though the tab is open; the removed addProject(workspaceRoot, "") call used to keep that path registered.

Useful? React with 👍 / 👎.

@ttmouse

ttmouse commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author
image

ttmouse added 13 commits June 9, 2026 21:29
生成中显示的停止按钮新增 CSS 动画:0.25s 顺时针转90°、
0.75s 停顿,1s 周期循环。利用正方形转90°与0°视觉一致
的特性,一次旋转即完成视觉闭环。

- 动画装在 .composer-meta__action-btn--stop:not(:disabled) svg
- ease-in-out 缓动,节奏不抢戏但能感知系统在运行
时间筛选面板:
- 菜单改为左侧对齐,去边框描边
- 面板宽度收窄(min-width: 108px→84px)
- 字体缩小至12px,字重400,不加粗
- 选中项颜色改为 accent 蓝色
- 筛选激活时图标旁显示短标签(10/1h/3h/24h)
- 按钮间距统一6px,自适应宽度

ApprovalModal:工具审批弹窗新增 attention chime 提示音
Merge 上游时 auto-merge 用上游版本覆盖了 SettingsPanel.tsx,
导致通知音效设置(生成完成 + AI提问)丢失。手动恢复 import、
state 和 UI 代码。
Merge 上游时 SettingsPanel.tsx 被上游版本覆盖,丢失了
生成式背景音乐预设选择器。恢复 import、state 和 UI。
通知音效(生成完成、AI提问)下拉框统一改为 mem-select,
预览按钮统一改为 chip,与生成式背景音乐保持一致。
…pen support

Each copy of the .app at a different path now gets its own Wails
SingleInstanceLock ID (com.reasonix.desktop.<sha256[:8]>), allowing
them to run side by side. The same binary still prevents double-launch.
@ttmouse ttmouse force-pushed the pr/sidebar-clean branch from ef8ea77 to 9072e03 Compare June 10, 2026 04:33
@github-actions github-actions Bot added tui Terminal UI / CLI (internal/cli, internal/control) config Configuration & setup (internal/config) labels Jun 10, 2026
@ttmouse ttmouse closed this Jun 10, 2026
@ttmouse ttmouse deleted the pr/sidebar-clean branch June 10, 2026 04:35
@ttmouse ttmouse restored the pr/sidebar-clean branch June 10, 2026 04:37
@ttmouse ttmouse reopened this Jun 10, 2026

@esengine esengine 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.

The two headline features — activity-sorted topics and collapse/expand all — are wanted. But the branch ships 72 files / +11.8k lines: the whole fork (sounds, BrowserPanel, GitPanel, a second internal/bot tree that collides with the bot gateway already on main-v2, go.mod churn), not the 6-file change the description scopes. We can't approve fork CI on these contents. Please re-cut: branch from current origin/main-v2, cherry-pick just the sidebar change, and force-push (or open fresh) — then it gets a fast review.

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

Labels

config Configuration & setup (internal/config) desktop Wails desktop app (desktop/**) tui Terminal UI / CLI (internal/cli, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants