Skip to content

Editor: hide the autosave tag after it fades, so the title gets its space back in the topbar - #258

Open
bouzidanas wants to merge 1 commit into
nyblnet:mainfrom
bouzidanas:fix-autosaved-tag-space
Open

Editor: hide the autosave tag after it fades, so the title gets its space back in the topbar#258
bouzidanas wants to merge 1 commit into
nyblnet:mainfrom
bouzidanas:fix-autosaved-tag-space

Conversation

@bouzidanas

Copy link
Copy Markdown

What & why

The .ed-autosaved tag ("Saved" / "Backed up in this browser") appears beside the title input and then fades out through opacity: 0. However, while invisible, the element still has a width, and thus, never leaves the layout. So the first backup of a session permanently taxes the title: measured at a 900px window, the faded tag holds 135px while the title sits crushed at its 48px floor. The flash was designed to be transient and yet its footprint isnt.

The fix is small: the tag is hidden while idle. flashSaved unhides it, forces one frame at opacity 0 so the fade-in still runs, and after the 1400ms flash plus the 0.25s fade-out it leaves layout again. No CSS change needed (the element never sets display, so the UA's [hidden] rule does the collapsing). Same measurement after the fix: the title gets 103px back (48px → 151px) the moment the tag goes idle.

One file, +8 lines, no new strings (the tag's messages already exist in every catalog), no format change.

How I verified it

Ran node_modules/.bin/tsc -b and npm run build:single from slides (clean; shell 1358KB → 664KB compressed), and node scripts/shell-gate.mjs on the built shell (splice contract OK). Measured the layout claim in the live editor: a faded tag at opacity: 0 occupies 135px and pins the title at 48px; with hidden set, the title recovers to 151px. Timer churn is covered — a save landing mid-fade re-clears both timeouts, so the tag cannot be hidden out from under a visible flash.

Checklist

  • Read the relevant parts of CLAUDE.md / docs before changing them
  • npm run build:single succeeds (from slides)
  • Ran node scripts/test-sync.ts if I touched sync (not touched)
  • New UI strings added to every catalog in i18n (none added — reuses existing strings)
  • Document format changes are additive and backward-compatible (no format changes)
  • Did not bump the version or cut a release (maintainers sign releases)

The .ed-autosaved tag beside the title fades to opacity 0 but stayed
in layout, so after the first backup the width of 'Backed up in this
browser' was permanently taken from the title input. The tag is now
hidden while idle and only occupies the bar during its flash.
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