UI: use hover capability detection for sidebar actions and add collapsible nav#548
Open
whefter wants to merge 2 commits intoThe-Vibe-Company:mainfrom
Open
UI: use hover capability detection for sidebar actions and add collapsible nav#548whefter wants to merge 2 commits intoThe-Vibe-Company:mainfrom
whefter wants to merge 2 commits intoThe-Vibe-Company:mainfrom
Conversation
…ollapsible nav Replace sm:group-hover: breakpoint logic with @media (hover: hover) custom variant so session action buttons (archive, three-dot menu) are always visible on touch devices like tablets. Add a collapsible toggle to the sidebar footer navigation with localStorage persistence, freeing vertical space on constrained viewports. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@whefter is attempting to deploy a commit to the The Vibe Company Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
No issues found across 4 files
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
Contributor
Greptile SummaryThis PR makes two independent UI improvements: it fixes a real tablet accessibility bug by swapping Key observations:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Device renders SessionItem] --> B{can-hover media query?}
B -- "No - touch only" --> C[Three-dot menu: always visible]
B -- "No - touch only" --> D[Archive button: always hidden]
C --> E[User taps menu to access Archive]
B -- "Yes - pointer device" --> F{Group hover active?}
F -- No --> G[Both buttons hidden]
F -- Yes --> H[Three-dot menu visible]
F -- Yes --> I[Archive quick button visible]
subgraph SidebarFooter["Sidebar Footer Nav"]
J[Read localStorage on mount] --> K{navExpanded?}
K -- true --> L[Render nav sections and resources]
K -- false --> M[Hide nav sections and resources]
N[Toggle button click] --> O[Toggle state + write localStorage]
O --> K
end
Prompt To Fix All With AIThis is a comment left during a code review.
Path: web/src/components/SessionItem.tsx
Line: 266
Comment:
**Archive button invisible on all touch devices**
The archive quick-action button now has `opacity-0 pointer-events-none` as its base state with `can-hover:group-hover:*` to reveal it only on hover-capable devices. This means on **any** touch-only device (phone or tablet) the button is permanently invisible with no interaction affordance — there is no equivalent "always visible" baseline the way the three-dot menu has (`opacity-100 pointer-events-auto` at the top of its class list).
This is intentional only if the expectation is that touch users always reach Archive through the three-dot context menu. If so, it's worth adding a code comment confirming that — the asymmetry between the two buttons (three-dot is always visible on touch, archive is always hidden) is non-obvious and the current comment `/* Archive button — hover reveal (desktop), always visible (mobile) */` is now stale/misleading.
```suggestion
className="absolute right-7 top-1/2 -translate-y-1/2 p-1 rounded-md opacity-0 pointer-events-none can-hover:group-hover:opacity-100 can-hover:group-hover:pointer-events-auto hover:bg-cc-border text-cc-muted hover:text-cc-fg transition-all cursor-pointer"
```
At a minimum, update the comment above the button (line 259) from `always visible (mobile)` to reflect the new reality that touch users access archive via the three-dot menu.
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: web/src/components/Sidebar.tsx
Line: 715-721
Comment:
**Chevron SVG uses fill on an open path**
The chevron path `M4 6l4 4 4-4` is an open path (no `Z`/close command), but the SVG uses `fill="currentColor"`. SVG fills an open path by implicitly closing it — drawing a straight line from end `(12, 6)` back to start `(4, 6)` — which renders a solid filled triangle rather than two hairline strokes. At `w-2.5 h-2.5` (10 × 10 CSS px) this may look slightly thick/blurry.
A stroke-based approach is more conventional for chevron indicators and produces a sharper appearance at small sizes:
```suggestion
<svg
viewBox="0 0 16 16"
fill="none"
stroke="currentColor"
strokeWidth="2"
strokeLinecap="round"
strokeLinejoin="round"
className={`w-2.5 h-2.5 transition-transform duration-150 ${navExpanded ? "rotate-180" : ""}`}
>
<path d="M4 6l4 4 4-4" />
</svg>
```
How can I resolve this? If you propose a fix, please make it concise.
---
This is a comment left during a code review.
Path: web/src/components/Sidebar.tsx
Line: 708-712
Comment:
**Missing `aria-controls` on the toggle button**
The toggle button correctly uses `aria-expanded`, but without `aria-controls` pointing to the `<nav>` element, screen readers cannot automatically jump to the controlled region. Adding the relationship makes the component more conformant with ARIA authoring practices for disclosure widgets.
```suggestion
<button
onClick={toggleNav}
aria-expanded={navExpanded}
aria-controls="sidebar-nav"
aria-label={navExpanded ? "Collapse navigation" : "Expand navigation"}
className="w-full flex items-center justify-between px-2 py-1 text-[10px] font-semibold uppercase tracking-[0.14em] text-cc-muted/75 hover:text-cc-fg hover:bg-cc-hover rounded-md transition-colors cursor-pointer"
>
```
And add a matching `id` to the `<nav>`:
```
<nav id="sidebar-nav" className="flex flex-col gap-1.5 mt-1" aria-label="Navigation">
```
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: d0ca679 |
- Update stale comment on archive button to reflect can-hover behavior - Switch nav toggle chevron from fill to stroke for correct open-path rendering - Add aria-controls linking nav toggle button to navigation element Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sm:group-hover:breakpoint logic with@media (hover: hover)via a Tailwind v4@custom-variant can-hoverso session action buttons (archive, three-dot menu) are always visible on touch devices like tabletsWhy
sm:= 640px) to decide whether to show action buttons on hover. Tablets exceed 640px but are touch devices with no hover capability, making archive/rename completely inaccessible (only double-tap rename worked).Changes
web/src/index.css— new@custom-variant can-hover (@media (hover: hover))web/src/components/SessionItem.tsx—sm:→can-hover:on archive + three-dot buttonsweb/src/components/Sidebar.tsx— collapsible footer nav with "Navigation" toggle, default expanded, state in localStorageweb/src/components/Sidebar.test.tsx— updated class assertions + 4 new toggle testsTesting
Review provenance