Skip to content

feat(ui): always show changes button in file changes panel top bar#1272

Merged
arnestrickmann merged 2 commits intogeneralaction:mainfrom
jschwxrz:emdash/feat-always-show-changes-button-7vc
Mar 4, 2026
Merged

feat(ui): always show changes button in file changes panel top bar#1272
arnestrickmann merged 2 commits intogeneralaction:mainfrom
jschwxrz:emdash/feat-always-show-changes-button-7vc

Conversation

@jschwxrz
Copy link
Collaborator

@jschwxrz jschwxrz commented Mar 4, 2026

summary:

  • the Changes button (opens diff viewer) only rendered when there were file changes
  • since the diff viewer now also provides access to history, it should always be accessible

changes:

  • unified the two separate top-bar layouts in FileChangesPanel.tsx into one consistent layout
  • changes button renders unconditionally, no longer gated behind hasChanges
  • empty state shows emdashes in green/red (— · —) instead of a static "Changes" text label
  • all PR logic (create, draft, view, merge) unchanged

@vercel
Copy link

vercel bot commented Mar 4, 2026

@jschwxrz is attempting to deploy a commit to the General Action Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 4, 2026

Greptile Summary

This PR unifies the two conditional top-bar layouts in FileChangesPanel.tsx into a single consistent layout so that the "Changes" (diff viewer) button is always rendered when onOpenChanges is provided, regardless of whether there are uncommitted file changes.

Key changes:

  • Removed the hasChanges-gated branch that produced two entirely separate top-bar structures; replaced with one <div> that conditionally renders only the content within it.
  • The left-side stats now show —·— (em-dashes in green/red) when there are no changes, instead of a static "Changes" text label.
  • The "Changes" / FileDiff button is no longer gated behind hasChanges; it renders whenever onOpenChanges is passed as a prop.
  • All PR action logic (create, draft, view PR, merge) is preserved identically — only the surrounding layout structure changed.
  • flex-wrap that existed on the old hasChanges = true container was not carried over to the new unified container, which could cause overflow on narrow panels at small viewport widths.

Confidence Score: 4/5

  • This PR is safe to merge with one minor layout concern to consider.
  • The change is well-scoped to a single file, the business logic for all PR actions is unchanged, and the conditional rendering logic has been correctly translated into the new unified structure. The only issue is a missing flex-wrap that was present in the old hasChanges branch, which could cause UI overflow on very narrow panels.
  • No files require special attention beyond the minor flex-wrap concern in src/renderer/components/FileChangesPanel.tsx.

Important Files Changed

Filename Overview
src/renderer/components/FileChangesPanel.tsx Two separate conditional top-bar layouts unified into one; "Changes" button is now always rendered when onOpenChanges is provided; empty state shows —·— instead of a static "Changes" label; all PR action logic preserved unchanged. Minor: flex-wrap was present on the old hasChanges container but is absent from the new unified one.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Top Bar Renders] --> B{hasChanges?}
    B -- Yes --> C["Left: +additions · -deletions"]
    B -- No --> D["Left: — · — (em-dashes)"]
    C --> E[Right side]
    D --> E

    E --> F{onOpenChanges prop?}
    F -- Yes --> G["Always render 'Changes' button ✅"]
    F -- No --> H[No Changes button]
    G --> I{hasChanges?}
    H --> I

    I -- Yes --> J[PrActionButton]
    I -- No --> K{isPrLoading?}
    K -- Yes --> L[Spinner]
    K -- No --> M{pr exists?}
    M -- Yes --> N[View PR button]
    M -- No --> O{branchStatusLoading\nor branchAhead > 0?}
    O -- Yes --> P[PrActionButton]
    O -- No --> Q[No PR for this task]
Loading

Last reviewed commit: bcf0a78

@arnestrickmann
Copy link
Contributor

Great catch, and makes a lot of sense. Thanks!

@arnestrickmann arnestrickmann merged commit b5d9a27 into generalaction:main Mar 4, 2026
2 of 3 checks passed
@jschwxrz jschwxrz deleted the emdash/feat-always-show-changes-button-7vc branch March 10, 2026 13:30
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.

2 participants