Skip to content

feat(code): use chosen diff source for badge#1865

Open
adboio wants to merge 1 commit into04-23-feat_code_add_pr_diff_sourcefrom
04-23-feat_code_use_chosen_diff_source_for_badge
Open

feat(code): use chosen diff source for badge#1865
adboio wants to merge 1 commit into04-23-feat_code_add_pr_diff_sourcefrom
04-23-feat_code_use_chosen_diff_source_for_badge

Conversation

@adboio
Copy link
Copy Markdown
Contributor

@adboio adboio commented Apr 23, 2026

Problem

diff badge always shows counts from local state even when another source is chosen

Changes

updates diff badge to use the same diff source as the review panel (user-selected, or automatically selected)

Screenshot 2026-04-23 at 10.48.58 AM.png

Screenshot 2026-04-23 at 10.49.10 AM.png

How did you test this?

manually

Copy link
Copy Markdown
Contributor Author

adboio commented Apr 23, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@adboio adboio force-pushed the 04-23-feat_code_use_chosen_diff_source_for_badge branch from 4b3c7ed to ac10d2a Compare April 23, 2026 14:55
@adboio adboio force-pushed the 04-23-feat_code_use_chosen_diff_source_for_badge branch from ac10d2a to 60dc9f6 Compare April 23, 2026 19:21
@adboio adboio force-pushed the 04-23-feat_code_add_pr_diff_source branch from 0459081 to 82824d0 Compare April 23, 2026 19:21
@adboio adboio force-pushed the 04-23-feat_code_use_chosen_diff_source_for_badge branch from 60dc9f6 to 0e73fab Compare April 24, 2026 21:33
@adboio adboio force-pushed the 04-23-feat_code_add_pr_diff_source branch 2 times, most recently from 1ff05ce to ce4f443 Compare April 24, 2026 22:14
@adboio adboio force-pushed the 04-23-feat_code_use_chosen_diff_source_for_badge branch 2 times, most recently from 4e86a3d to 7dafcbd Compare April 24, 2026 22:29
@adboio adboio force-pushed the 04-23-feat_code_add_pr_diff_source branch from ce4f443 to 58ec2e3 Compare April 24, 2026 22:29
@adboio adboio requested a review from a team April 24, 2026 22:35
@adboio adboio force-pushed the 04-23-feat_code_use_chosen_diff_source_for_badge branch from 7dafcbd to 58ca4e0 Compare April 24, 2026 22:47
@adboio adboio marked this pull request as ready for review April 24, 2026 22:48
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 24, 2026

Prompt To Fix All With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/git-interaction/hooks/useGitQueries.ts
Line: 183-184

Comment:
**Silent badge staleness when branch changes**

`refetchInterval: false` means the badge will show branch-diff counts from up to 5 minutes ago without any background refresh. If a user pushes a new commit while watching the badge, the count won't update until they trigger a manual refetch. The previous 30-second interval was actively keeping the displayed counts fresh. Given the badge is specifically meant to reflect the *current* diff, consider whether `false` is the right choice here, or whether a longer-but-nonzero interval (e.g., 60 s) would be a better trade-off.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "feat(code): use chosen diff source for b..." | Re-trigger Greptile

Comment on lines +183 to +184
staleTime: pollFast ? 10_000 : 5 * 60_000,
refetchInterval: pollFast ? 10_000 : false,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Silent badge staleness when branch changes

refetchInterval: false means the badge will show branch-diff counts from up to 5 minutes ago without any background refresh. If a user pushes a new commit while watching the badge, the count won't update until they trigger a manual refetch. The previous 30-second interval was actively keeping the displayed counts fresh. Given the badge is specifically meant to reflect the current diff, consider whether false is the right choice here, or whether a longer-but-nonzero interval (e.g., 60 s) would be a better trade-off.

Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/git-interaction/hooks/useGitQueries.ts
Line: 183-184

Comment:
**Silent badge staleness when branch changes**

`refetchInterval: false` means the badge will show branch-diff counts from up to 5 minutes ago without any background refresh. If a user pushes a new commit while watching the badge, the count won't update until they trigger a manual refetch. The previous 30-second interval was actively keeping the displayed counts fresh. Given the badge is specifically meant to reflect the *current* diff, consider whether `false` is the right choice here, or whether a longer-but-nonzero interval (e.g., 60 s) would be a better trade-off.

How can I resolve this? If you propose a fix, please make it concise.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@adboio adboio force-pushed the 04-23-feat_code_add_pr_diff_source branch 2 times, most recently from 9e9fb6d to db71e1d Compare April 24, 2026 22:50
@adboio adboio force-pushed the 04-23-feat_code_use_chosen_diff_source_for_badge branch from 58ca4e0 to af51513 Compare April 24, 2026 22:50
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