Skip to content

feat(sidebarAutoHide): add left-edge hover trigger - #485

Merged
Nagi-ovo merged 6 commits into
mainfrom
Nagi-ovo/sidebar-hover-reveal
Mar 12, 2026
Merged

feat(sidebarAutoHide): add left-edge hover trigger#485
Nagi-ovo merged 6 commits into
mainfrom
Nagi-ovo/sidebar-hover-reveal

Conversation

@Nagi-ovo

@Nagi-ovo Nagi-ovo commented Mar 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • When auto-hide is enabled and the sidebar is collapsed, an invisible 6px zone at the left viewport edge expands the sidebar on hover (macOS Dock-style behavior)
  • Uses relatedTarget on mouseleave to cancel expand only if mouse didn't enter the sidebar
  • Integrates with existing isMouseOverSidebarArea() to prevent accidental collapse while hovering the edge zone

Test plan

  • All 588 existing tests pass
  • TypeScript typecheck passes
  • Lint passes (no new warnings)
  • Manual: enable auto-hide → sidebar collapses → move mouse to left edge → sidebar expands after 300ms
  • Manual: quick mouse pass-through at left edge should NOT trigger expand (debounce)
  • Manual: disable auto-hide → edge trigger removed, sidebar stays expanded

🤖 Generated with Claude Code


Open with Devin

…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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

devin-ai-integration[bot]

This comment was marked as resolved.

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>
devin-ai-integration[bot]

This comment was marked as resolved.

…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>
devin-ai-integration[bot]

This comment was marked as resolved.

…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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +505 to +506
if (isSidebarCollapsed()) {
showEdgeTrigger();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

devin-ai-integration[bot]

This comment was marked as resolved.

Nagi-ovo and others added 2 commits March 12, 2026 16:35
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>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 12 additional findings in Devin Review.

Open in Devin Review

Comment thread src/pages/popup/Popup.tsx
setQuoteReplyEnabled(res?.gvQuoteReplyEnabled !== false);
setCtrlEnterSendEnabled(res?.gvCtrlEnterSend === true);
setSidebarAutoHideEnabled(res?.gvSidebarAutoHide === true);
setSidebarFullHideEnabled(res?.gvSidebarFullHide === true);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔴 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.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@Nagi-ovo
Nagi-ovo merged commit a90baab into main Mar 12, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +429 to +430
if (isSidebarCollapsed()) {
showEdgeTrigger();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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