Skip to content

fix(ui): hide Open PRs section while loading instead of showing spinner#1419

Merged
arnestrickmann merged 1 commit intomainfrom
emdash/fix-ugly-open-prs-state-91i
Mar 11, 2026
Merged

fix(ui): hide Open PRs section while loading instead of showing spinner#1419
arnestrickmann merged 1 commit intomainfrom
emdash/fix-ugly-open-prs-state-91i

Conversation

@arnestrickmann
Copy link
Contributor

Summary

Removes the loading spinner state from the Open PRs section header, returning null instead so the section is completely hidden until PR data has loaded.

Changes

  • Replace the spinner-with-header loading state in OpenPrsSection with return null to match the existing pattern used for error and empty states
  • Remove unused Spinner import

Motivation

The loading spinner in the section header created an ugly flash of UI before PR data was available. Hiding the section entirely until data is ready provides a cleaner experience, consistent with how the error and empty states already behave.

@vercel
Copy link

vercel bot commented Mar 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Mar 11, 2026 5:56pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 11, 2026

Greptile Summary

This PR removes the "Open PRs" header + spinner shown during initial PR data loading, replacing it with return null to hide the section entirely until data is ready. The change is a one-liner swap that aligns the loading state with the existing error and totalCount === 0 guard clauses, all of which already return null. The unused Spinner import is also cleaned up.

Key observations:

  • The three early-return guards (loading, error, totalCount === 0) now all consistently return null, making the conditional logic easier to follow at a glance.
  • Subsequent re-fetches (when prs.length > 0) are unaffected — the section stays visible with stale data, which is the expected behavior.
  • Loader2 from lucide-react is still used (for the per-PR "creating worktree" spinner and the "Load more" button), so the remaining import is correct.
  • No logic changes outside the loading guard; the rest of the component is untouched.

Confidence Score: 5/5

  • Safe to merge — minimal, well-scoped UX change with no logic side-effects.
  • The change is a single guard-clause swap with a matching import removal. It cannot regress error or empty-state handling, and it improves the loading UX by eliminating a flash of partial UI.
  • No files require special attention.

Important Files Changed

Filename Overview
src/renderer/components/OpenPrsSection.tsx Replaces the spinner-with-header loading state with return null when loading && prs.length === 0, and removes the unused Spinner import. Clean, minimal change consistent with the existing error/empty-state pattern.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[OpenPrsSection renders] --> B{loading && prs.length === 0?}
    B -- "Yes (before)" --> C["Show spinner header\n(removed by this PR)"]
    B -- "Yes (after)" --> D[return null\nhide section entirely]
    B -- No --> E{error && prs.length === 0?}
    E -- Yes --> F[return null]
    E -- No --> G{totalCount === 0 && prs.length === 0?}
    G -- Yes --> H[return null]
    G -- No --> I[Render PR list]
Loading

Last reviewed commit: a7c3640

@arnestrickmann arnestrickmann merged commit 82b4c6a into main Mar 11, 2026
5 checks passed
@arnestrickmann arnestrickmann deleted the emdash/fix-ugly-open-prs-state-91i branch March 12, 2026 00:15
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