feat(sidebarAutoHide): add left-edge hover trigger - #485
Conversation
…d sidebar When auto-hide is enabled and the sidebar is collapsed, an invisible 6px zone at the left edge of the viewport allows hovering to expand the sidebar (similar to macOS Dock auto-hide behavior). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65fbda9a3d
ℹ️ 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".
| if (!isSidebarCollapsed()) { | ||
| if (clickToggleButton()) { | ||
| autoCollapsed = true; | ||
| showEdgeTrigger(); |
There was a problem hiding this comment.
Show edge trigger when sidebar starts collapsed
showEdgeTrigger() is only called after collapseSidebar() actively clicks the toggle, so enabling auto-hide while the sidebar is already collapsed (for example, from persisted Gemini UI state) leaves the new edge zone hidden forever because createEdgeTrigger() initializes it with display: none. In that state, the commit’s left-edge hover behavior never activates until a future auto-collapse event occurs, which makes the feature appear broken for users who begin in a collapsed state.
Useful? React with 👍 / 👎.
If the sidebar is already collapsed when auto-hide is enabled (e.g. persisted Gemini UI state), show the edge trigger immediately instead of waiting for a future collapse event. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…eserve user collapse state - expandSidebar: only hide edge trigger and clear autoCollapsed when clickToggleButton() succeeds, matching collapseSidebar's pattern - Don't set autoCollapsed=true when sidebar was already collapsed before auto-hide was enabled, so disable() won't forcibly expand it Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…r toggle checkAndReattach() now reconciles edge trigger display with actual sidebar state, so manual hamburger clicks or Gemini-initiated toggles no longer leave the edge trigger out of sync. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd1c399e64
ℹ️ 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".
| if (isSidebarCollapsed()) { | ||
| showEdgeTrigger(); |
There was a problem hiding this comment.
Hide edge trigger when sidebar is not visible
In responsive layouts where bard-sidenav is present but hidden, isSidebarCollapsed() returns true because width is 0, so this sync block keeps calling showEdgeTrigger() even though the sidebar is not interactable. That leaves the 6px fixed hover zone active on the left edge and can steal pointer interactions while repeatedly attempting pointless expand behavior; gate showEdgeTrigger() on isSidebarVisible() (or explicitly hide when not visible) to avoid this regression.
Useful? React with 👍 / 👎.
Gate showEdgeTrigger() on isSidebarVisible() in checkAndReattach() to prevent the edge trigger from appearing in narrow viewports where the sidebar is hidden (width=0 triggers isSidebarCollapsed() but the sidebar is not interactable). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a separate "Fully hide sidebar" toggle (in the same popup card as
auto-hide) that completely hides the collapsed sidebar (width: 0) and
shows a 6px edge trigger at the left viewport edge to reveal it.
- New storage key gvSidebarFullHide + popup toggle
- Full-hide CSS: body:not(.mat-sidenav-opened) bard-sidenav { width: 0 }
- Edge trigger driven by full-hide (not auto-hide)
- Both features share infrastructure (observer, resize, periodic check)
- Works with both auto-hide and manual collapse
- Translations added for all 10 locales
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
| setQuoteReplyEnabled(res?.gvQuoteReplyEnabled !== false); | ||
| setCtrlEnterSendEnabled(res?.gvCtrlEnterSend === true); | ||
| setSidebarAutoHideEnabled(res?.gvSidebarAutoHide === true); | ||
| setSidebarFullHideEnabled(res?.gvSidebarFullHide === true); |
There was a problem hiding this comment.
🔴 Missing gvSidebarFullHide key in chrome.storage.sync.get defaults causes popup toggle to always show OFF
The gvSidebarFullHide key is not included in the defaults object passed to chrome.storage.sync.get() at src/pages/popup/Popup.tsx:721-752. The Chrome storage API only returns keys that are listed in the defaults object; any key not listed will be absent from the result. At line 777, res?.gvSidebarFullHide evaluates to undefined, so setSidebarFullHideEnabled(undefined === true) always sets the toggle to false. This means the "Fully hide sidebar" toggle will always appear OFF when the popup opens, even if the user previously enabled it. The content script (src/pages/content/sidebarAutoHide/index.ts:608) correctly fetches the key, so the feature itself works — but the popup UI won't reflect the stored state, confusing users.
Prompt for agents
In src/pages/popup/Popup.tsx, add `gvSidebarFullHide: false` to the defaults object passed to `chrome.storage.sync.get()`. It should be inserted around line 739-740, after the existing `gvSidebarAutoHide: false` entry. For example:
gvSidebarAutoHide: false,
gvSidebarFullHide: false,
gvSnowEffect: false,
This ensures the key is included in the storage get request and the stored value is properly returned to initialize the popup toggle.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c1e0f2b0b7
ℹ️ 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".
| if (isSidebarCollapsed()) { | ||
| showEdgeTrigger(); |
There was a problem hiding this comment.
Gate edge trigger on actual sidebar visibility
When fullHideEnabled is on, checkAndReattach() shows the left-edge trigger whenever isSidebarCollapsed() is true, but that predicate also returns true when bard-sidenav exists but is hidden by responsive layout (width 0). In that state the sidebar is not interactable, yet the 6px fixed trigger remains active and can intercept pointer actions at the viewport edge while repeatedly trying to expand a non-visible sidebar; add an isSidebarVisible() guard (or explicitly hide the trigger when not visible) before calling showEdgeTrigger().
Useful? React with 👍 / 👎.
Summary
relatedTargeton mouseleave to cancel expand only if mouse didn't enter the sidebarisMouseOverSidebarArea()to prevent accidental collapse while hovering the edge zoneTest plan
🤖 Generated with Claude Code