Skip to content

refactor: move save status indicator to sticky overlay in editor area#14

Merged
j4rviscmd merged 2 commits intomainfrom
refactor/save-indicator-position
Mar 22, 2026
Merged

refactor: move save status indicator to sticky overlay in editor area#14
j4rviscmd merged 2 commits intomainfrom
refactor/save-indicator-position

Conversation

@j4rviscmd
Copy link
Copy Markdown
Owner

Summary

  • Move SaveStatusIndicator from the auto-hide header to a sticky overlay inside the scroll container so it remains visible regardless of header visibility
  • Replace null return with an invisible placeholder to prevent layout shifts when the indicator appears/disappears
  • Fix stale closure in useEffect by using isTimerActiveRef instead of reading display state

Details

SaveStatusIndicator changes

  • Unified the two wrapper <span> elements into a single return with conditional invisible class via cn()
  • Replaced the display state read inside useEffect with an isTimerActiveRef ref to avoid stale closures and satisfy react-hooks/exhaustive-deps
  • Fixed clearTimeout non-null assertion by using undefined instead of null for the ref type

App.tsx changes

  • Removed SaveStatusIndicator from the <header> element
  • Added a sticky top-5 overlay inside the scroll container with pointer-events-none so it doesn't interfere with scrolling
  • Flattened the header ternary to cn() conditional class pattern

Test plan

  • Scroll down to hide the header — save indicator should remain visible
  • Trigger auto-save — checkmark should appear without layout shift
  • Verify no scroll event interference from the overlay (pointer-events-none)
  • Confirm error state ("Save failed") displays correctly

🤖 Generated with Claude Code

j4rviscmd and others added 2 commits March 22, 2026 23:24
Move SaveStatusIndicator from the auto-hide header to a sticky overlay
inside the scroll container so it remains visible regardless of header
state. Use invisible placeholder to prevent layout shifts when the
indicator appears/disappears.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@j4rviscmd j4rviscmd merged commit 4ccde5b into main Mar 22, 2026
@j4rviscmd j4rviscmd deleted the refactor/save-indicator-position branch March 22, 2026 14:31
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