Skip to content

Forget oldest tab history entry, instead of newest - #155

Open
AjaxGb wants to merge 2 commits into
FabricMC:mainfrom
AjaxGb:fix-full-history
Open

Forget oldest tab history entry, instead of newest#155
AjaxGb wants to merge 2 commits into
FabricMC:mainfrom
AjaxGb:fix-full-history

Conversation

@AjaxGb

@AjaxGb AjaxGb commented Jul 7, 2026

Copy link
Copy Markdown

Currently, when the tab history hits 50 entries, new entries stop being added entirely. This means that if you open more than 50 tabs and then close one, focus jumps to whatever arbitrary tab was the 50th. Since loading the most recent history entry happens when any tab is closed, not just the active one, the tab you close doesn't even have to be the one that's open. This continues to happen until the history has been reduced to under 50 entries, making navigation very annoying.

Improvements in this PR:

  • Forget the oldest tab history entry when history is full, instead of blocking new entries from being added. This way, loading the latest history entry can only fail if the user opens more than 50 tabs and then closes the most recent 50 without opening any new ones.
  • Only load the latest history entry when the active tab is closed, instead of unconditionally. This prevents unnecessary flickering when a background tab is closed, and fixes the active tab changing because a background tab was closed if the history is exhausted as described above.
  • As a minor taste change, if history is exhausted and the active tab is closed, open the rightmost tab instead of the leftmost tab. In general I would assume that the rightmost tab was opened more recently than the leftmost.

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