Stax — hybrid sort, a real auto-sort toggle, and settings that finally live where they should
Stax groups browser tabs into color-coded groups. Local domain rules by default, plus an optional AI pass (Claude or Gemini, your own key) for tabs that don’t match anything obvious.
What I did
Local rule matching and AI grouping used to be two separate paths. Smart Sort only ran local rules. A separate button re-ran AI on everything from scratch and ignored what local rules had already sorted, so tabs the local rules couldn’t place just sat there ungrouped even with an API key set. I merged these into one pipeline: local rules run first since they’re instant, free, and work offline, and only the leftover tabs get handed to AI. If the AI call fails, it now falls back to the local result instead of breaking the whole action.
The auto-sort-on-new-tab toggle in Preferences used to be fake. It wrote a value to storage that nothing ever read, so flipping the switch did literally nothing. Wired it up for real, debounced per window so restoring a saved session doesn’t fire a sort for every single tab.
Settings and the custom domain-rule editor used to live on a separate page you had to open in a new tab. Moved the whole thing into the popup as a second screen, and built a side panel that mirrors it with live updates as tabs and groups change, so you’re not stuck refreshing manually.
Issues I ran into and fixed
-
Keyword classifier false positives. The fallback classifier (kicks in when a domain isn’t in the built-in list) was doing plain substring matching on hostnames. “shop” was matching
photoshop.adobe.com, “dev” was matching random domains that just happened to contain those letters. Switched it to match whole hostname tokens instead, which kills the false positives without losing the keyword coverage. -
Extension pages slipping through.
chrome-extension://pages weren’t excluded from sorting the waychrome://pages were. The old regex only matched schemes ending right after the browser name, so extension pages like the built-in PDF viewer could end up grouped under a garbage name based on the extension ID. Fixed the exclusion list to cover that too. -
Silent save failures. Settings saves had zero error handling around
chrome.storage.sync.set. That API has an 8KB-per-item quota, so enough custom rules could make a save fail silently while the UI still said “Saved.” Wrapped it in a try/catch so a failed save actually tells you it failed now. -
Dead options page. After moving settings into the popup, the old separate
options.html/options.jspage wasn’t wired to anything in the manifest anymore. It was just dead code sitting in the repo doing nothing. Deleted it instead of fixing a page nobody could ever reach.
What’s next
Nothing blocking, the extension works end to end. For later: popup.js and sidepanel.js currently duplicate a few small helper functions (glyph lookup, sending messages), so I’d like to pull those into one shared file so I’m not editing the same logic twice.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.