feat(ui): header user menu (hidden logout) + export/import saved queries#10
Merged
Conversation
…ries
Header: replace the standalone email + "Log Out" button with a compact
short-name control (email local-part + chevron) that opens a dropdown
holding the full email and a red Log out item. Esc / outside-click close it;
Log out signs out immediately (no confirm), per design handoff.
Saved panel: pinned Export / Import row. Export downloads all saved queries
as JSON ({format,version,exportedAt,queries}); Import merges + dedupes
(skip exact name+SQL dups, update on id-match, add the rest) and reports
"Added N · updated N · skipped N".
New pure modules carry the logic at 100% coverage:
- core/format.js: userShortName(email)
- core/saved-io.js: buildExportDoc / parseImportDoc / mergeSaved
- state.js: importSaved (persists via injected save + genId seams)
FileReader is injected through createApp(env) like the other side-effects.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QennTvGKAtJZrv9EpQagef
It was position:sticky; bottom:0, so it stayed glued to the viewport bottom over a scrolling list. Drop sticky — margin-top:auto still sinks it to the bottom when the list is short, but a long list now scrolls it out of view. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QennTvGKAtJZrv9EpQagef
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
Two additions from the design handoff (
Altinity Play), both verified live on antalya.1. Hide logout behind a header user control
The header showed the full email plus a standalone Log Out button — heavy and easy to mis-click. Replaced with a compact short-name + chevron control (
btyshkevich ▾, the email local-part) that opens a dropdown:2. Export / Import of saved queries
Saved queries live only in
localStorage— no backup, no portability. Added a pinned Export / Import row at the bottom of the Saved panel.{format, version, exportedAt, queries}). Disabled when the list is empty.name+SQLduplicates, update on id-match, add the rest. ReportsAdded N · updated N · skipped N. Validates format/version and reports a✕toast on malformed input.Layering / tests
New pure logic at 100% per-file coverage:
core/format.js—userShortName(email)core/saved-io.js(new) —buildExportDoc/parseImportDoc/mergeSavedstate.js—importSaved(persist via injectedsave+genIdseams)FileReaderis injected throughcreateApp(env)like the other side-effect seams.npm testgreen, coverage gate held (406 tests).Verification
Deployed to antalya
/sqland checked in-browser: short-name menu opens → email + red Log out, Esc closes; Export downloadssql-browser-queries-<date>.jsonand toastsExported 1 query.🤖 Generated with Claude Code
https://claude.ai/code/session_01QennTvGKAtJZrv9EpQagef