fix(tabs): repair stale browser-tabs schema, never-empty strip; move usage to title bar#3345
Conversation
|
😎 Merged manually by @adamleithp - details. |
58c55f8 to
825a8aa
Compare
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
There was a problem hiding this comment.
Gates denied this PR because it touches database migrations and billing code, both of which are on the deny-list for automated approval. It also has zero reviews despite being a complex, multi-area change. A human reviewer must approve before this can be merged.
|
Reviews (1): Last reviewed commit: "fix(tabs): repair stale browser-tabs sch..." | Re-trigger Greptile |
825a8aa to
4d3249b
Compare
|
/trunk merge |
|
/trunk cancel |
|
/trunk merge |
|
/trunk cancel |
|
/trunk merge |
|
/trunk cancel |
|
/trunk merge |
|
/trunk cancel |
…usage to title bar Browser tabs (bluebird follow-ups): - Add repair migration 0020: profiles that dogfooded a pre-merge bluebird build have migration 0013 recorded as applied but the old panes-era browser_windows schema (no active_tab_id), which killed the whole browser-tabs service at boot and left a dead "+" strip. Tolerated ALTERs heal stale DBs and no-op on healthy ones. - BrowserTabsService now seeds a blank tab at boot when none survived (the strip should never be empty) and heals an unknown windowId on newBlankTab/openOrFocus to the primary window. - The renderer snapshot seed retries with backoff and logs terminal failure instead of swallowing it; the "+" handler re-pulls the authoritative snapshot instead of silently no-oping when the mirror has no window. - Make the empty title-bar space around the tab strip a native window drag region (container inherits drag; pills and "+" opt out). Usage CTA: - Move the sidebar usage bar into the title bar as a "Usage: N%" button (left of PostHog Web); the full plan card (bar, reset time, Upgrade) shows in a quill Popover on hover via openOnHover. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Radix scale classes (text-gray-11, bg-accent-9) don't resolve inside the data-quill popover portal, so the card rendered colorless. Use quill Progress and foreground/muted-foreground/primary tokens instead. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- sync-quill.sh: portable hashing (shasum) and sed rewrite (temp file + mv) so the script works on Linux, not just BSD/macOS - UsageButton: mark the portalled PopoverContent no-drag — it opens under the title bar's drag region and clicks near its top edge were draggable - new-tab recovery: resolve the primary window from the snapshot returned by reseedMirror, not the mirror — the store apply is skipped when a local write or newer remote push races the fetch Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
/trunk merge |
9cf2736 to
692f31f
Compare
|
/trunk cancel |
- Migration 0020: CREATE TABLE IF NOT EXISTS (full current schema) before the tolerated ALTERs, so a stale variant missing the browser tables entirely heals instead of failing the migration transaction on "no such table"; document the type/NOT NULL divergence limitation. Verified against healthy, panes-era, and tables-missing lineages. - New-tab reseed failure now logs instead of a silent catch. - Contribution seed loop is abort-aware: stop() cancels the backoff and a late snapshot can't apply after teardown; repeated start() can't stack loops. - UsageButton: loading skeleton reserves the button's spot (no title-bar layout shift), the popover is controlled so the trigger click closes the card before opening settings, and hover-card opens track UPGRADE_PROMPT_SHOWN (new titlebar_card shown-surface). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
/trunk merge |
k11kirky
left a comment
There was a problem hiding this comment.
Automated review pass (high effort, 8 finder angles + verification). Overall the fix is solid and well-tested for the reported symptom; flagging a few gaps in the fix's scope and one cleanup nit. Nothing here blocks merge in my view, but worth a look before shipping to the affected dogfood population.
|
One more from the same review pass, not inline-able since the file isn't part of this diff: |
|
/trunk cancel |
- migrate.ts: repair migrations (0020) are best-effort — statements tolerate any SQLite error, so an unforeseen schema divergence degrades to the pre-repair status quo instead of rolling back the batch and killing boot. Covered by migrate.test.ts including a pathological browser_tabs-as-VIEW variant, plus lineage tests for the panes-era and tables-missing variants. - service.ts: document why windowId healing is creation-only (reorder and focus mutations from a desynced mirror carry stale tab ids; the shared transforms no-op safely). - BrowserTabStrip: log when no window is resolvable after a reseed instead of silently skipping. - __root.tsx: gate the title-bar right-side group on billingEnabled || channelsEnabled so an empty Flex can't claim a no-drag rect in the drag region. - backoff.ts: sleepWithBackoff takes an optional AbortSignal; the seed retry loop uses the shared helper instead of a local reimplementation. - UsageButton: Upgrade CTA is a quill Button variant=link per CLAUDE.md. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
/trunk merge |
|
Re-reviewed the two follow-up commits (
The Traced the |
Browser tabs — dead "+" on an empty strip (bluebird follow-up)
Root cause: migration
0013was amended in place on the bluebird branch (same folderMillis). Profiles that dogfooded a pre-merge build have it recorded as applied but kept the old panes-erabrowser_windowsschema — noactive_tab_id. Every browser-tabs query then throwsno such column: active_tab_id, the whole service dies at boot, the renderer's snapshot seed swallowed the failure, and the strip rendered a permanently dead "+" (the handler bailed on a windowless mirror, and no mutation could bootstrap a window — deadlock).Fix, four layers:
0020: toleratedALTER TABLE ADD COLUMNrepairs (browser_windows.active_tab_id, plusbrowser_tabs.task_id/channel_section/app_viewfor other stale variants). No-op on healthy DBs (the runner tolerates "duplicate column name"); heals divergent ones.BrowserTabsServiceseeds a blank tab at boot when none survived — the strip should never be empty — andnewBlankTab/openOrFocusheal an unknownwindowIdto the primary window..catch(() => undefined).reseedMirror()) and creates the tab against the fresh primary window instead of silently returning.Verified live on an affected profile: schema healed on boot, persisted tabs restored, "+" and Cmd+T work.
Title bar
Usage: N%outline button left of "PostHog Web"; hover opens the full plan card (plan · % used, progress bar, reset time, Upgrade) in a quill Popover (openOnHoveron the trigger). Same gating as before (posthog-code-billing+ free-plan usage). Newtitlebar/titlebar_cardanalytics surfaces.no-dragrectangle; pills and "+" opt out individually (click/close/reorder unaffected).Tests
service.test.ts: boot seeds primary window + blank tab from empty/tab-less stores, leaves populated snapshots untouched, creation mutations heal stale window ids.🤖 Generated with Claude Code