fix: UX polish — z-index, header, scroll, persistence, sticky buy-all#21
Merged
Conversation
- Raise powerup/bug spawn buttons to z-60 with pointer-events-auto so they render above drawers and stay clickable while drawers are open - Restructure TopBar: LoC counter full-height on left, stats + Ship button stacked on right for mobile; desktop layout unchanged - Drop '(x/s each)' from building cards; total /s on bottom is enough - Add scrollbar-gutter:stable to shop/stats/editor scrollers and switch ActiveBuffBar to overflow-x-hidden to eliminate scrollbar flicker - Persist buy-quantity selector to localStorage via a small useLocalStorageState hook with type-guard validation - Pin 'Buy All Affordable' button to the top of the upgrades list with position: sticky so it stays reachable while scrolling Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Addresses PR #21 review comments: - Adds vitest coverage: empty storage, existing value, invalid JSON, validate-rejects, validate-accepts, write-back. - Documents that `key` is expected to be stable for the component lifetime; changing it won't re-read storage. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- ShopPanel: drop redundant re-sort of upgrades (selectVisibleUpgrades already sorts by cost) and use the render-snapshot state for the 'Buy All Affordable' disabled check instead of re-reading the store inside a .some() callback - ActiveBuffBar: restore overflow-x-auto so many active buffs stay reachable; use scrollbar-gutter:stable to eliminate the flicker - useLocalStorageState: guard against JSON.stringify returning undefined (functions/symbols/undefined values) by removing the key instead of writing the literal string "undefined"; added a test Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Addresses PR #21 review feedback: - Relocates the hook from src/utils/ to src/hooks/ to match the existing convention (useAutoSave, useGameLoop, etc.) - Expands the stable-key doc comment to note that a `key` change would persist the current in-memory value under the new key - Updates imports in ShopPanel and the test file Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Summary
Six small UX fixes surfaced during play:
z-60withpointer-events-autoso they stay visible and clickable while a drawer is open.scrollbar-gutter: stableto shop, stats, code editor, and theActiveBuffBarscrollers so the gutter stays reserved and width no longer oscillates.useLocalStorageStatehook with a type-guard stores the selection undercodeclicker_buy_qty, separate from the game save so no migration is needed.position: stickyband at the top of the upgrades list with a solid background so it stays reachable while scrolling.Test plan
lg— LoC is full-height on the left, stats and Ship button stack on the right. Desktop unchanged.🤖 Generated with Claude Code