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
Open
Editor: hide the autosave tag after it fades, so the title gets its space back in the topbar#258bouzidanas wants to merge 1 commit into
bouzidanas wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The
.ed-autosavedtag ("Saved" / "Backed up in this browser") appears beside the title input and then fades out throughopacity: 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
hiddenwhile idle.flashSavedunhides 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 setsdisplay, 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 -bandnpm run build:singlefrom slides (clean; shell 1358KB → 664KB compressed), andnode scripts/shell-gate.mjson the built shell (splice contract OK). Measured the layout claim in the live editor: a faded tag atopacity: 0occupies 135px and pins the title at 48px; withhiddenset, 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
npm run build:singlesucceeds (from slides)node scripts/test-sync.tsif I touched sync (not touched)