Posterverse: don't overwrite a link to a tab that arrives with the manifest

The first-paint write is skipped when the address names a tab the shell
doesn't know yet (a row that only resolves once the manifest is in). Writing
tab 0 there would replace the link before applyManifest could honour it;
applyManifest's own first-paint replace writes the honoured tab.
This commit is contained in:
Doxa Maps 2026-10-03 05:26:59 +00:00
parent 32cba5f8fe
commit 8c674c0447

View file

@ -227,8 +227,12 @@ export default defineComponent({
mounted() {
this.watchHostLang()
// Paint the rail at once; the manifest completes the rows in the background and re-drives the mount.
// First paint is a REPLACE, so a reload or a shared link keeps the tab without adding a Back step.
this.select(this.initialIndex(), { firstPaint: true })
// First paint is a REPLACE, so a reload or a shared link keeps the tab without adding a Back step. If the
// address names a tab that only arrives with the manifest (a provisional row), write nothing yet: writing
// tab 0 here would overwrite the link, and applyManifest's own first-paint replace writes the honoured tab.
const want = this.requestedTab()
const known = !want || this.tabs.some((t) => t.id === want)
this.select(this.initialIndex(), { firstPaint: true, fromHistory: !known })
// Back / Forward re-apply the tab from the address and never write (writing would lose Forward).
this._offAddress = onAddressChange(({ tab }) => {
const i = this.tabs.findIndex((t) => t.id === tab)