Skip to content

feat(agent): adaptive layout for control-tab previews#1533

Open
Hindol Roy Choudhury (Hindolch) wants to merge 2 commits into
browseros-ai:mainfrom
Hindolch:feat/control-tab-previews
Open

feat(agent): adaptive layout for control-tab previews#1533
Hindol Roy Choudhury (Hindolch) wants to merge 2 commits into
browseros-ai:mainfrom
Hindolch:feat/control-tab-previews

Conversation

@Hindolch

Copy link
Copy Markdown

feat(agent): add Alt+Q tab switcher with adaptive preview layouts

Summary

Implements an Alt+Tab-inspired tab switcher for BrowserOS, providing a fast, keyboard-driven interface for navigating between open tabs.

The switcher uses MRU (Most Recently Used) ordering, displays live tab previews, and adapts its layout based on the number of open tabs to remain performant and usable for both small and large tab sets.

Features

Tab Switcher

  • Added Alt+Q shortcut to open the tab switcher overlay.
  • While holding Alt, pressing Q repeatedly cycles through tabs in MRU order.
  • Releasing Alt activates the currently highlighted tab.
  • Esc dismisses the overlay without switching.
  • Enter activates the selected tab.

Adaptive Layout

  • ≤ 7 tabs: horizontal preview strip with large cards.
  • 8+ tabs: responsive grid layout with dynamically computed columns.
  • Automatic centering of the selected tab in strip mode.

Navigation

  • Linear cycling via Q.
  • Spatial navigation via arrow keys in grid mode.
  • Mouse wheel and click interactions supported.

Tab Previews

  • Displays:
    • tab thumbnail/screenshot
    • favicon
    • tab title
  • Thumbnail cache maintained in the background for instant rendering.

Visual Improvements

  • Enhanced selected-state styling.
  • Dimmed inactive tabs.
  • Two-line title clamping.
  • Dynamic card sizing based on layout mode.

Background Changes

  • Added MRU tab tracking using chrome.storage.session.
  • Added thumbnail capture on tab activation.
  • Limited thumbnail cache size to prevent unbounded memory usage.
  • Added executeScript fallback for invalidated extension contexts.

Build & Infrastructure

  • Added esbuild: { jsxDev: false } to avoid jsxDEV runtime failures when building with NODE_ENV=development.
  • Addressed lint issues:
    • removed non-null assertions
    • replaced as any usages
    • removed unused constructor code

Files Changed

  • entrypoints/tab-switcher/types.ts
  • entrypoints/tab-switcher/TabPreviewCard.tsx
  • entrypoints/tab-switcher/TabSwitcherOverlay.tsx
  • entrypoints/tab-switcher/useTabSwitcher.tsx
  • entrypoints/tab-switcher.content.ts
  • entrypoints/background/mruStore.ts
  • entrypoints/background/index.ts
  • wxt.config.ts

Known Limitations

  • Content scripts cannot run inside Chrome's built-in PDF viewer (chrome://pdfjs), so the switcher cannot be opened while a PDF viewer tab has focus.

Verification

  • bunx @biomejs/biome check passes.
  • Production build succeeds.
  • Verified with:
    • single-tab scenarios
    • 7-tab strip layout boundary
    • multi-tab grid layout
    • large tab sets with filtering enabled.

Video recording

browseros-tab-demo.mp4

Closes: Discord feature request for an Alt+Tab-style tab preview switcher.

@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

PR author is not in the allowed authors list.

@Hindolch

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@Hindolch

Hindol Roy Choudhury (Hindolch) commented Jul 2, 2026

Copy link
Copy Markdown
Author

Hey I would like to introduce this feature as it is very browserOS-y thing to be done as suggested by one of a guy in the discord server, check this out and lmk! Felarof (@felarof99)

@Hindolch

Hindol Roy Choudhury (Hindolch) commented Jul 3, 2026

Copy link
Copy Markdown
Author

recheck

@Hindolch

Copy link
Copy Markdown
Author

hey Nikhil (@shadowfax92) any review on this, so I can fix or just can be merged :)

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