Skip to content

fix(tabs): a blank session numbers its tabs from 1 again (closes #631) - #632

Merged
danielnuld merged 1 commit into
mainfrom
fix/tab-counter
Sep 28, 2026
Merged

danielnuld merged 1 commit into
mainfrom
fix/tab-counter

Conversation

@danielnuld

Copy link
Copy Markdown
Owner

Closes #631.

  • Cause: the number in "Consulta N" was the tab id, and the id counter (seq) survives restarts on purpose (Una pestaña nueva abre con el grid de la anterior (o como panel de filtros sin editor) #355), so a blank session started at "Consulta 48".
  • Fix: a title counter of its own, TabState.num. blankSession() opens the first tab with num: 0 (→ "Consulta 1") and the id after seq; openTool/openSnippetTab now spread the state so they keep it; the workspace stores num, and a resumed session continues from its own (from seq for a workspace saved before this).
  • Ids are untouched: they still only move forward, so resuming the saved tabs after the blank one never collides.
  • Tests (tabs.test.ts): a blank session after 47 ids starts at "Consulta 1" with id 48; with nothing stored; through a tool, a snippet and a closed tab; a resumed session (old format and new) goes on from its own number. Full frontend suite: 166 files pass.

The number in "Consulta N" was the tab's id, and the id counter (seq) is
stored with the workspace so ids never repeat across a restart (#355): a
session that started blank went on from the last one's numbers. Titles get
a counter of their own (TabState.num), reset when the app opens on a blank
tab, carried by openTool and openSnippetTab, and stored with the workspace
so a resumed session goes on from its own titles (from seq for one saved
before the counter). Ids keep moving forward, so resuming after the blank
tab still collides with nothing.

A stored workspace with a single empty tab now also opens as a fresh blank
tab instead of re-showing the old one's title.
@danielnuld danielnuld added the area:frontend Interfaz web sobre webview label Sep 28, 2026
@danielnuld
danielnuld merged commit fe59588 into main Sep 28, 2026
13 checks passed
@danielnuld
danielnuld deleted the fix/tab-counter branch September 28, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:frontend Interfaz web sobre webview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Al empezar una sesión en blanco, las pestañas siguen numerándose desde la sesión anterior

1 participant