Repository navigation
feat(tabs): replace segmented control with custom profile tabs - #19
Merged
Merged
Conversation
Co-Authored-By: David Gidwani <david.gidwani@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Co-Authored-By: David Gidwani <david.gidwani@gmail.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
Replaces the stock
NSSegmentedControlinTabStripViewwith a custom row of profile tabs (option B from the tab-strip investigation). The publicTabStripViewcontract (update(windows:selectedWindowID:),onSelectWindow,onReorderWindow,onMove, …) is unchanged; two callbacks are added.Built and tested only via macOS CI (the dev box is Linux); not yet exercised interactively on a Mac.
Layout, left to right:
TabButton(custom-drawnNSView): selected tab = profile-color tint + ring + semibold label; hover/pressed fills; close×on hover (reserved space, so no relayout on hover); middle-click closes. Selection fires on mouse-down; a >4pt drag switches to reorder, where the tab follows the pointer (lifted) and neighbours animate into new slots (NSAnimationContext, 0.16s).TabStripLayout(pure, unit-tested): clamps tabs to 96–180pt, water-fills shrink (widest shrink first), and once tabs no longer fit at 96pt moves the rest into an overflow+Nmenu, always keeping the selected tab visible. Leftover width is filled with dashed ghost tabs for picker-visible profiles that have no open window (click → open that profile).TabStripLayout.labels(for:)→["Personal", "Work", "Window 3", "Personal 2"].+button pops a menu ofProfileChoice.pickerChoicesfor this browser.ContainerController.updatecallstabStrip.setBrowserActive(frontmost pid == selected pid); tints desaturate and labels fade..tabGroup; window tabs are.radioButtonwith selected value, "Window i of n" help, and a "Close Window" custom action; ghosts are buttons labelled "Open …".New plumbing:
BrowserLauncher.launchnow shares a privaterun(browser:arguments:)helper; its arguments are unchanged.Things worth checking on a Mac (none exercised yet):
.activeAlways).-new-window about:newtabfrom the command line, and Chromium--new-windowagainst an already-running instance.Link to Devin session: https://app.devin.ai/sessions/3feca0145cfc45de90b3030ab28f7a89
Open in Devin Desktop: https://app.devin.ai/desktop/session/3feca0145cfc45de90b3030ab28f7a89?variant=devin
Requested by: @darvid