Skip to content

💄 style(topic): one-click collapse/expand all topic groups#15484

Merged
arvinxx merged 3 commits into
canaryfrom
feat/topic-collapse-expand-all
Jun 5, 2026
Merged

💄 style(topic): one-click collapse/expand all topic groups#15484
arvinxx merged 3 commits into
canaryfrom
feat/topic-collapse-expand-all

Conversation

@arvinxx

@arvinxx arvinxx commented Jun 5, 2026

Copy link
Copy Markdown
Member

💡 What

Adds a one-click collapse / expand all toggle to the topic sidebar header (the "话题/Topics" row), sitting next to the existing filter and more-actions buttons.

State Icon Action
Any group expanded Shrink Collapse all groups
All groups collapsed Expand Expand all groups

🔧 How

  • New ToggleGroups component under Sidebar/Topic/, wired into the header action slot in Topic/index.tsx.
  • Reuses the existing expandTopicGroupKeys global status (same state that per-group accordion toggling writes), so the button and manual toggling stay in sync. Collapse → [], expand → all group ids.
  • Computes the group list with the same groupedTopicsForSidebar selector used by GroupedAccordion, so it respects the current grouping mode (byStatus / byTime / byProject).
  • Hides itself when there are fewer than two groups (e.g. flat mode), where toggling is meaningless.
  • i18n: sidebar.collapseAll / sidebar.expandAll added to default + zh-CN + en-US (other locales via pnpm i18n).

✅ Test

Verified locally in the Electron app via local-testing:

  • Clicking collapse all sets expandTopicGroupKeys to [] and flips the icon to Expand; all groups fold.
  • Clicking expand all restores all group keys and flips the icon back to Shrink; all groups unfold.
  • Button renders next to Filter + Actions in the header.

🤖 Generated with Claude Code

Add a toggle button in the topic sidebar header (next to Filter and the
more-actions menu) that collapses or expands all topic groups at once.
It reuses the existing `expandTopicGroupKeys` global status, so it stays
in sync with manual per-group toggling, and hides itself when there are
fewer than two groups (e.g. flat mode).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lobehub Ready Ready Preview, Comment Jun 5, 2026 5:40am

Request Review

@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. feature:topic Topic/Conversation/Session management labels Jun 5, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We've reviewed this pull request using the Sourcery rules engine

@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: a1248ba650

ℹ️ 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 src/routes/(main)/agent/_layout/Sidebar/Topic/ToggleGroups.tsx Outdated
@codecov

codecov Bot commented Jun 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.85%. Comparing base (65ba086) to head (4f4eb86).
⚠️ Report is 2 commits behind head on canary.

Additional details and impacted files
@@            Coverage Diff             @@
##           canary   #15484      +/-   ##
==========================================
- Coverage   70.85%   70.85%   -0.01%     
==========================================
  Files        3256     3256              
  Lines      321442   321442              
  Branches    29378    35044    +5666     
==========================================
- Hits       227754   227752       -2     
- Misses      93506    93508       +2     
  Partials      182      182              
Flag Coverage Δ
app 61.55% <ø> (-0.01%) ⬇️
database 92.54% <ø> (ø)
packages/agent-manager-runtime 49.69% <ø> (ø)
packages/agent-runtime 81.08% <ø> (ø)
packages/builtin-tool-lobe-agent 18.52% <ø> (ø)
packages/context-engine 84.19% <ø> (ø)
packages/conversation-flow 91.29% <ø> (ø)
packages/device-gateway-client 90.51% <ø> (ø)
packages/eval-dataset-parser 95.15% <ø> (ø)
packages/eval-rubric 76.11% <ø> (ø)
packages/fetch-sse 85.57% <ø> (ø)
packages/file-loaders 87.89% <ø> (ø)
packages/memory-user-memory 74.99% <ø> (ø)
packages/model-bank 99.99% <ø> (ø)
packages/model-runtime 84.22% <ø> (ø)
packages/prompts 72.51% <ø> (ø)
packages/python-interpreter 92.90% <ø> (ø)
packages/ssrf-safe-fetch 0.00% <ø> (ø)
packages/types 35.38% <ø> (ø)
packages/utils 84.98% <ø> (ø)
packages/web-crawler 88.08% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Store 68.53% <ø> (ø)
Services 54.77% <ø> (ø)
Server 71.85% <ø> (-0.01%) ⬇️
Libs 57.03% <ø> (ø)
Utils 81.71% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

In flat mode, groupedTopicsForSidebar falls through to time grouping so
the computed group count can exceed one, but List renders FlatMode with
no accordion for the toggle to affect. Hide the control explicitly when
topicGroupMode === 'flat' instead of relying on the group count.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@arvinxx arvinxx changed the title ✨ feat(topic): one-click collapse/expand all topic groups 💄 style(topic): one-click collapse/expand all topic groups Jun 5, 2026
@arvinxx arvinxx merged commit 64b7ab2 into canary Jun 5, 2026
34 of 35 checks passed
@arvinxx arvinxx deleted the feat/topic-collapse-expand-all branch June 5, 2026 17:33
This was referenced Jun 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature:topic Topic/Conversation/Session management size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant