Skip to content

fix(web-ui): align spacing of sidebar threads header icons - #1402

Merged
iruriQ merged 1 commit into
mainfrom
fix/sidebar-header-icon-spacing
Nov 29, 2026
Merged

iruriQ merged 1 commit into
mainfrom
fix/sidebar-header-icon-spacing

Conversation

@iruriQ

@iruriQ iruriQ commented Nov 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes uneven horizontal spacing of the five action icons beside the sidebar Threads / Sessions header (Activity, Search, New section, View options, Add workspace) on touch devices and in the mobile drawer.

Root Cause

  1. Under @media (hover: none), (pointer: coarse) and :global([data-phone-drawer]), .iconButton, .searchButton, and .searchSlot expanded to 44px and .headerActions expanded to 148px, while .activitySlot remained capped at max-width: 28px (and lacked overflow: hidden). As a result, the first (Activity) 44px button overflowed its 28px slot into the neighbor, producing uneven center-to-center spacing of [32px, 48px, 48px, 48px].
  2. In the mobile drawer (320px max width → 284px inner header width on 375px/390px viewports), five 44px buttons with 4px gaps require 236px, leaving less than the width of the English "Sessions" label (~59px) + gap and causing .searchSlot (flex: 1; min-width: 0) to shrink.

Changes

  • apps/web-ui/packages/client/ui-workspace/src/client/rows/WorkspaceBrowser.module.css:
    • Add overflow: hidden to .activitySlot to match .headerActions during width collapse transitions.
    • Under @media (hover: none), (pointer: coarse) and :global([data-phone-drawer]):
      • Size .iconButton, .searchButton, .activitySlot:not(.activitySlotHidden), .searchSlot, and .search consistently to 36px (keeping .sectionHeader at 44px height and preserving gap: 4px so search-expand negative collapse margins stay aligned).
      • Update .headerActions:not(.headerActionsHidden) max-width to 120px (3 × 36px + 2 × 4px = 116px), keeping :not(.activitySlotHidden) / :not(.headerActionsHidden) guards so search expansion cleanly collapses all sibling slots to 0px.

Visual & Behavioral Verification

Verified in an isolated Web UI instance via Chrome CDP across mobile (390×844, 375×812) and desktop (1440×900), light/dark themes, and Chinese/English locales with 0 console errors:

Scenario Before (center-to-center) After (center-to-center) Title Gap / Clipping Search Expand & Collapse
Phone 390×844 zh dark (会话) [32, 48, 48, 48] px [40, 40, 40, 40] px 60px, unclipped Expands to 284×36, collapses cleanly
Phone 375×812 en dark (Sessions) [32, 48, 48, 48] px [40, 40, 40, 40] px 29.1px, unclipped Expands to 284×36, collapses cleanly
Desktop 1440×900 zh light (会话) [32, 32, 32, 32] px [32, 32, 32, 32] px 72px, unclipped Expands to 256×30, collapses cleanly
Desktop 1440×900 en dark (Sessions) [32, 32, 32, 32] px [32, 32, 32, 32] px 41.1px, unclipped Unchanged

(Sanitized before/after screenshots were captured and inspected locally for mobile dark zh, mobile dark en 375×812, and desktop light zh; maintainers can attach them to this PR if desired.)

Validation

  • npx prettier --check apps/web-ui/packages/client/ui-workspace/src/client/rows/WorkspaceBrowser.module.css — passed
  • npx vitest run --config tests/vitest.config.js apps/web-ui/packages/client/ui-workspace/test/ — 2 test files / 11 tests passed
  • Isolated Web UI CDP inspection (desktop + mobile, zh/en, light/dark, search expand/collapse, console errors = []) — passed

@coderabbitai

coderabbitai Bot commented Nov 29, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • 样式
    • 触屏设备上的工作区浏览器控件尺寸调整为 36px;展开时动作区宽度上限缩小至 120px。
    • 溢出按钮仍保持至少 44px 高。

工作区浏览器的触屏样式和手机抽屉样式将图标按钮、搜索按钮、搜索槽、活动槽及搜索框调整为 36px,并将展开动作区的宽度上限从 148px 调整为 120px。溢出按钮仍保持至少 44px 高。活动槽新增溢出裁剪。

Changes: 工作区浏览器触屏尺寸

Layer / File(s) Summary
调整触屏控件尺寸
apps/web-ui/packages/client/ui-workspace/src/client/rows/WorkspaceBrowser.module.css
活动槽新增 overflow: hidden。通用触屏样式和手机抽屉样式将图标按钮、搜索按钮、搜索槽、活动槽和搜索框设为 36px,并将展开动作区宽度上限从 148px 调整为 120px。溢出按钮仍保持至少 44px 高。

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: hhucz

Merge Risk: Minimal · up to 93e33

This change evens out the spacing of the sidebar header icons on touch devices and in the mobile drawer. It only adjusts CSS sizes, and no concrete regression was found, so it is low risk to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed 标题“fix(web-ui): align spacing of sidebar threads header icons”准确描述了主要变更:修复侧边栏会话标题栏图标的间距。变更内容为 WorkspaceBrowser.module.css 中触屏与抽屉样式的尺寸调整,与标题一致。
Description check Passed 描述详细说明了问题根因、具体 CSS 修改(36px 尺寸、120px 最大宽度、overflow: hidden)以及验证步骤,与变更集直接相关。
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c1ea889 and 93e335e.

Files selected for processing: 1

  • apps/web-ui/packages/client/ui-workspace/src/client/rows/WorkspaceBrowser.module.css

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Recent review details

Context from checks skipped due to timeout: 4

  • GitHub Check: CodeRabbit
  • GitHub Check: Web Host tests
  • GitHub Check: Static checks
  • GitHub Check: Vitest
Additional context used

Code guidelines: 3

AGENTS.md — auto-discovered
docs/product/standalone-web.md — auto-discovered
CLAUDE.md — auto-discovered
Path-based instructions: 3

Source excerpt: `codexhost` runs external Agent Harnesses as independent Threads inside Codex Desktop, preserving the official shell and native Codex path.

CodeRabbit inference engine (AGENTS.md)

Files:

  • apps/web-ui/packages/client/ui-workspace/src/client/rows/WorkspaceBrowser.module.css
Applicability reference: AGENTS.md: # Repository Guidelines `npm start` / `npm start web` rebuild and relaunch the user's Desktop / Web and may restart the shared Host; `npm stop` stops all local codexhost services across worktrees.

CodeRabbit inference engine (docs/product/standalone-web.md)

Files:

  • apps/web-ui/packages/client/ui-workspace/src/client/rows/WorkspaceBrowser.module.css
Source excerpt: Do not write browser, e2e, or component tests for Web pages (`apps/web-ui`); the user checks page changes directly.

CodeRabbit inference engine (AGENTS.md)

Files:

  • apps/web-ui/packages/client/ui-workspace/src/client/rows/WorkspaceBrowser.module.css
Stylelint (17.14.0)

apps/web-ui/packages/client/ui-workspace/src/client/rows/WorkspaceBrowser.module.css

[error] 752-752: Unknown pseudo-class selector ":global" (selector-pseudo-class-no-unknown)

(selector-pseudo-class-no-unknown)

[error] 756-756: Unknown pseudo-class selector ":global" (selector-pseudo-class-no-unknown)

(selector-pseudo-class-no-unknown)

[error] 760-760: Unknown pseudo-class selector ":global" (selector-pseudo-class-no-unknown)

(selector-pseudo-class-no-unknown)

[error] 764-764: Unknown pseudo-class selector ":global" (selector-pseudo-class-no-unknown)

(selector-pseudo-class-no-unknown)

[error] 768-768: Unknown pseudo-class selector ":global" (selector-pseudo-class-no-unknown)

(selector-pseudo-class-no-unknown)

Additional comments: 1

apps/web-ui/packages/client/ui-workspace/src/client/rows/WorkspaceBrowser.module.css: 1

162-162: Functional Correctness

The focus-indicator concern does not hold. The Activity button's :focus-visible outline uses a negative offset, so it stays inside the button edge. The touch and drawer rules size that button and its visible slot to the same 36px limit, so the slot does not clip the focus ring.

@iruriQ
iruriQ merged commit f0b3d71 into main Nov 29, 2026
7 checks passed
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.

2 participants