Skip to content

fix(sidebar): align credits chip with panel toggle and square the collapsed rail - #6691

Merged
j15z merged 3 commits into
stagingfrom
fix/realign-credits-button
Aug 14, 2026
Merged

fix(sidebar): align credits chip with panel toggle and square the collapsed rail#6691
j15z merged 3 commits into
stagingfrom
fix/realign-credits-button

Conversation

@j15z

@j15z j15z commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Credits chip on the new chat page now shares the panel toggle's vertical centerline and sits 1px from it — the same chip gap the sidebar header cluster uses. When the resource panel is open, the chip takes the standard 16px corner inset (matching the toggle's inset in its own corner) and its move animates with the panel
  • Collapsed sidebar rail icons are now uniform 32×30 icon chips (the natural icon-only chip width), centered in the rail, that hold perfectly still on collapse/expand — previously they were 35×30 rectangles with off-center glyphs
  • Collapsed rail width goes 51px → 48px so the geometry is commensurate (32px chip + 8px gutter each side). At 51px, "centered in the rail" and "doesn't move on toggle" were mutually exclusive by 1.5px (rail midline at 25.5 vs the expanded rows' 24px glyph column). All three width definitions (CSS var, pre-hydration blocking script, SIDEBAR_WIDTH.COLLAPSED) move together
  • Fixed the flash when reopening the sidebar from the workspace icon: the header cluster's width snapped from w-0 to auto, momentarily crushing the flex-1 workspace chip to zero and landing the hover-filled Search chip exactly under the cursor. Both width endpoints are now explicit so the cluster tweens in step with the rail
  • Consolidation: one overlay geometry class replaces the per-callsite contentTop/controls magic offsets, the toggle size is a shared CSS var, duplicated resource-activity Set-pruning is extracted into one helper, and the toggle's inline expand closure is a named handler

Type of Change

  • Bug fix

Testing

Tested manually. Verified the expand animation frame-by-frame with a Playwright geometry probe: before, the Search chip jumped to the workspace icon's position with a hover fill at the click frame; after, it stays right of the workspace chip through the whole animation. Sidebar store tests pass. Lint, type-check, and check:audits pass.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

🤖 Generated with Claude Code

@vercel

vercel Bot commented Aug 14, 2026

Copy link
Copy Markdown

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 14, 2026 2:41am

Request Review

@cursor

cursor Bot commented Aug 14, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Layout and animation tweaks in sidebar and home chrome only; no auth, data, or API changes.

Overview
Collapsed sidebar rail width moves from 51px to 48px (CSS vars, blocking script, and SIDEBAR_WIDTH.COLLAPSED) so 32px icon chips sit in 8px gutters and icons stay on the same column as expanded rows.

A shared SIDEBAR_RAIL_CHIP_CLASS tweens rail chips to 32px width when the aside is collapsed (group/rail + group-data-[collapsed]/rail), applied across sidebar header, nav, footer, settings, and collapsed menus.

Sidebar expand flash is fixed by giving the header Search/Collapse cluster explicit widths (65px, or 32px when the desktop title bar hides collapse) instead of animating to auto, so the workspace chip does not crush to zero and Search does not jump under the cursor.

On the home empty state, the credits chip uses the same overlay header geometry as the resource panel toggle: 1px gap to the 30px toggle when collapsed, standard end inset when open, with a right position transition. Resource expand/collapse and activity clearing are consolidated into expandResource / clearResourceActivity.

Reviewed by Cursor Bugbot for commit afe5df9. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR standardizes collapsed-sidebar chip geometry, synchronizes the header-control cluster with sidebar animation, and aligns resource-header controls through shared positioning constants.

  • Adds a shared 32px collapsed-rail chip width and applies it across navigation, settings, workspace, and footer controls.
  • Gives the sidebar header cluster explicit widths for standard and inset desktop layouts.
  • Consolidates resource-header overlay geometry and resource-activity cleanup while preserving existing state behavior.

Confidence Score: 5/5

The PR appears safe to merge, with no concrete changed-code failure identified.

The explicit control widths match the rendered chip geometry, hover-peek removes the collapsed-width constraint before showing labels, and the resource-panel refactor preserves the existing state transitions.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/home/components/mothership-view/components/resource-tabs/resource-tab-controls.ts Consolidates resource-header control geometry into shared overlay and toggle-size constants.
apps/sim/app/workspace/[workspaceId]/home/home.tsx Reuses resource-activity cleanup and animates the credits chip between collapsed and expanded panel positions.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/constants.ts Defines shared width-transition geometry for icon-only controls in the collapsed sidebar rail.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/sidebar.tsx Applies collapsed chip sizing and explicit header-control widths synchronized with sidebar animation.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/sidebar-footer/sidebar-footer.tsx Applies the shared collapsed-rail geometry to profile and help controls.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-sidebar/settings-sidebar.tsx Applies uniform collapsed-rail sizing to settings navigation controls.

Reviews (1): Last reviewed commit: "fix(sidebar): align credits chip with pa..." | Re-trigger Greptile

@j15z
j15z merged commit c6047ef into staging Aug 14, 2026
22 of 24 checks passed
@j15z
j15z deleted the fix/realign-credits-button branch August 14, 2026 03:02
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.

1 participant