Skip to content

Hide the tab marker on the current tab - #736

Merged
david-tejada merged 1 commit into
mainfrom
fix/current-tab-marker-in-filename
Oct 24, 2026
Merged

david-tejada merged 1 commit into
mainfrom
fix/current-tab-marker-in-filename

Conversation

@david-tejada

Copy link
Copy Markdown
Owner

Fixes #707.

Browsers use the current tab's title as the default filename when I save a page (with the browser or an extension like Save Page WE) or drag its URL out of the address bar to create a shortcut. So the tab marker ended up in the filename. The current tab doesn't need a marker to be targeted, so Rango now only adds it to the other tabs. When I switch away from a tab, it gets its marker back. The URL in the title stays on the current tab, because Talon reads it from there.

A code review turned up three cases this change exposed, which I also fixed:

  • Marker left in the middle of the title. A page that builds its title from the decorated one while in the background, like adding a notification count to get (1) B | Inbox, left the marker in the middle, where it wasn't removed when the tab became current. Rango now remembers the exact marker it added and removes it wherever it is.
  • Copying gave an old title. With the URL in the title turned off, the current tab's title has no decorations. So a page changing Inbox to (1) Inbox was taken for a page editing our decorated title (the Bandcamp case), and copying a markdown link still gave Inbox. That branch now only applies when Rango decorated the title.
  • Quick tab switches. An older title update could finish last and put the marker back on the current tab. Each update now stops if a newer one started while it waited.

One thing this doesn't handle: after a browser restart or an extension update, Rango reads each tab's marker back from its title, so the tab that was current gets a new marker. It's one tab per restart, so I left it.

Testing

  • npm test -- e2e/decorateTitle: all 12 tests pass, after lint, the type check and the build. I updated the current-tab expectations to have no marker and added tests for the marker coming back on an inactive tab, the marker in the middle of the title, and copying a title the page built from its previous one.
  • Each of the two new bug tests fails with its fix removed: the title keeps (1) B | Document - …, and the copied link is [Document](…) instead of [(1) Document](…).
  • The race fix has no test.
  • I haven't tried it in Firefox or Safari.

🤖 Generated with Claude Code

Browsers use the current tab's title as the default filename when I save a
page or drag its URL out to create a shortcut, so the tab marker ended up in
the filename. The current tab doesn't need a marker to be targeted, so Rango
now only adds it to the other tabs. The URL in the title stays, because Talon
reads it from the current tab.

A code review turned up three cases this exposed, which I also fixed:

- A page that builds its title from the decorated one while in the background,
  like `(1) B | Inbox`, left the marker in the middle of the title, where it
  wasn't removed when the tab became current. Rango now removes the exact
  marker it added wherever it is.
- With the URL in the title turned off, the current tab's title has no
  decorations, so a page changing `Inbox` to `(1) Inbox` was taken for a page
  editing our decorated title, and copying the title gave `Inbox`. That branch
  now only applies when Rango decorated the title.
- Quick tab switches could let an older title update finish last and put the
  marker back on the current tab. An update now stops if a newer one started
  while it waited.

Fixes #707

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for voluble-crisp-6e2a75 ready!

Name Link
🔨 Latest commit f503cc8
🔍 Latest deploy log https://app.netlify.com/projects/voluble-crisp-6e2a75/deploys/6adc854eeba0b597daa3e85e
😎 Deploy Preview https://deploy-preview-736--voluble-crisp-6e2a75.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@david-tejada
david-tejada merged commit 9e2e0cd into main Oct 24, 2026
8 checks passed
@david-tejada
david-tejada deleted the fix/current-tab-marker-in-filename branch October 24, 2026 10:19
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.

Hint used in filename

1 participant