Skip to content

feat(demo): show loading overlay during large diff preparation#8

Merged
Zhang-JiahangH merged 1 commit intomainfrom
codex/add-loading-state-for-demo
Apr 7, 2026
Merged

feat(demo): show loading overlay during large diff preparation#8
Zhang-JiahangH merged 1 commit intomainfrom
codex/add-loading-state-for-demo

Conversation

@Zhang-JiahangH
Copy link
Copy Markdown
Owner

Motivation

  • Avoid a hard UI freeze when preparing very large diff datasets (e.g. 100k lines) by showing a visible loading state so users get feedback during the expensive preparation step.
  • Prevent metric updates from being recorded while preparation is still running so performance numbers remain meaningful.

Description

  • Move diff dataset generation out of a blocking useMemo into an effect-driven flow using useEffect + setTimeout(0) so the UI can render a loading state before heavy computation runs.
  • Add isPreparing state and initialize diffData via useState to allow controlled updates and to keep the viewer mounted while new data is prepared.
  • Render an accessible overlay spinner/message on top of the viewer during preparation and skip commit/total metric updates while isPreparing is true.
  • Add overlay CSS (.viewer-loading--overlay) to position and style the loading state (semi-transparent background and blur).

Testing

  • Ran pnpm --filter demo build in the environment, which failed due to missing/unalikeable dev workspace dependencies (e.g. react-router-dom and workspace package resolution), so a full production build could not be validated here.
  • No automated unit tests were added or run as part of this change.

Codex Task

@Zhang-JiahangH Zhang-JiahangH merged commit e8f0b6a into main Apr 7, 2026
1 check passed
@Zhang-JiahangH Zhang-JiahangH deleted the codex/add-loading-state-for-demo branch April 8, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant