Skip to content

feat: add collapsible sidebar with persistent state#4906

Merged
qinxuye merged 3 commits into
mainfrom
feat/sidebar-collapse-toggle
May 13, 2026
Merged

feat: add collapsible sidebar with persistent state#4906
qinxuye merged 3 commits into
mainfrom
feat/sidebar-collapse-toggle

Conversation

@m199369309
Copy link
Copy Markdown
Collaborator

@m199369309 m199369309 commented May 13, 2026

Summary

  • Add collapse/expand toggle button to the sidebar navigation
  • Collapsed mode shows only icons with tooltips, expanding to full width on toggle
  • Sidebar state is persisted in localStorage across page reloads
  • Smooth CSS transitions for width, logo, and toolbar elements

Test plan

  • Verify sidebar renders normally on page load (expanded by default)
  • Click the collapse toggle button at the bottom — sidebar shrinks to icon-only mode
  • Hover nav items in collapsed mode — tooltips appear with labels
  • Click toggle again — sidebar expands back to full width
  • Refresh the page — sidebar remembers its collapsed/expanded state
  • Test on different screen widths to ensure responsive behavior is preserved

Add collapse/expand toggle to the sidebar navigation. The collapsed
state is persisted in localStorage so it survives page reloads.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@XprobeBot XprobeBot added this to the v2.x milestone May 13, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements a collapsible sidebar for the web UI, featuring state persistence via local storage and responsive width adjustments. The review feedback highlights a few technical improvements: ensuring the setState updater function remains pure by moving side effects outside, correcting a CSS transition limitation where height: auto hinders animations, and addressing missing localization keys for the new toggle button tooltips.

Comment thread xinference/ui/web/ui/src/components/MenuSide.js
Comment thread xinference/ui/web/ui/src/components/MenuSide.js
Comment thread xinference/ui/web/ui/src/components/MenuSide.js Outdated
Copy link
Copy Markdown
Contributor

@qinxuye qinxuye left a comment

Choose a reason for hiding this comment

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

Reviewed the sidebar collapse change and left one inline comment for a small i18n issue.

Comment thread xinference/ui/web/ui/src/components/MenuSide.js Outdated
- Make toggleCollapsed a pure function by moving writeCollapsed outside setState
- Replace height:auto with maxHeight for working CSS transition
- Add menu.expand/collapse keys to all locale files (en/zh/ja/ko)
- Remove dead || fallbacks from tooltip text

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@qinxuye qinxuye left a comment

Choose a reason for hiding this comment

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

LGTM

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@qinxuye qinxuye merged commit 3db0c6f into main May 13, 2026
10 of 13 checks passed
@qinxuye qinxuye deleted the feat/sidebar-collapse-toggle branch May 13, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants