Skip to content

Show GitHub activity on the new-chat canvas - #882

Open
woosal1337 wants to merge 11 commits into
zeronsh:mainfrom
woosal1337:feat/new-chat-github-activity
Open

woosal1337 wants to merge 11 commits into
zeronsh:mainfrom
woosal1337:feat/new-chat-github-activity

Conversation

@woosal1337

@woosal1337 woosal1337 commented Oct 12, 2026 •

Copy link
Copy Markdown

Summary

  • Show the signed-in GitHub account under the empty new-chat composer. A "Last 30 days" heading sits above four counts: contributions, PRs opened, PRs merged, and reviews. Each count shows its change from the 30 days before as a green or red number.
  • Show the year heatmap with month labels under the counts. The heatmap uses the full panel width.
  • Load the data from the local gh account with one GraphQL call. Hide the panel when gh is missing or signed out.
  • Keep the last snapshot in github-activity.json in the data directory, keyed by the gh account, as the pull request board does. At launch the panel shows the stored copy, then refreshes behind it. Keep the last good snapshot when a refresh fails. With no stored copy, show a skeleton in the same layout when the first request runs for more than 200 ms. When the first data arrives, fill the heatmap from left to right in about 0.8 s. Reduced motion shows the data at once.
  • Show the panel only when all of it fits under the composer. Give it the width of the composer pill.
  • Add a "GitHub activity" switch to Settings > General. It is on by default. When it is off, the panel does not show and makes no GitHub request.
  • Put the agent update notice above the destination selectors, so that it does not cover the panel or the folder picker.

Test plan

  • cargo test -p zeron-engine --lib github_activity
  • cargo test -p zeron-engine --lib forward
  • cargo test -p zeron-proto --lib
  • cargo test -p zeron-ui --lib github_activity, which includes github_activity_stays_inside_the_window_at_each_size. The panel shows at 1512x903, 1320x880, 1200x760, and 1110x676, and hides at 900x600 and 1512x560.
  • Run the GraphQL query with gh api graphql on a real account: no errors, 53 weeks.
  • Time the launch in a macOS build: the panel shows after 5.1 s with no stored copy, and after 0.9 to 1.3 s with a stored copy. The refresh behind it writes a new copy about 3 s later.
  • Open a new chat in a macOS build at 1416x884, 1320x880, 1110x676, 1000x640, and 900x600. The panel fits at the first four sizes and hides at 900x600. The update notice stays above the folder picker at all sizes.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Show the 30-day counters and the year heatmap only. Remove the streak,
peak, and attention rows, the period and repository filters, and the
repository list from the panel, the engine, and the wire types.

Show the panel only when all of it fits under the composer, and give it
the width of the composer pill. Put the agent update notice above the
destination selectors so that it does not cover the heatmap or the
folder picker.
Add a shell test that sizes the window from 1512x903 to 900x600 and
1512x560. When the panel shows, the test makes sure that it starts
under the composer, matches the composer width, and ends inside the
window. The test also makes sure that the panel shows in a full window
and hides in a short window. Format the new files with rustfmt.
The first partial week took a label of its own, so that label touched the next month at the left edge. Each week that contains the 1st of a month now carries that label, and no other week does.
Name the 30-day period one time in the heading, and remove "vs last month" from each count. Show the change as a colored number with no dot, and show no change line when the change is 0. Shorten the pull request labels. Remove the Less/More legend and the weekday labels, so that the heatmap gets the full panel width.
Remove the module comments from the three new files, the comment on GET_GITHUB_ACTIVITY, and the comment above the update notice in the shell.
The heatmap now sits under the counts. Remove year_total from the snapshot and totalContributions from the year query, because the panel no longer shows them.
The GraphQL call takes 3 to 4 seconds, and the engine kept its result only in memory, so each launch waited for GitHub. The engine now writes each snapshot to github-activity.json in the data directory, keyed by the gh account, the same way the pull request board keeps its first pages. The panel asks for the stored copy first, shows it, and then asks GitHub for a new snapshot. In a macOS build the panel now shows 0.9 to 1.3 seconds after launch, not 5.1 seconds.
The switch is on by default. When it is off, the new chat canvas shows no panel and the panel makes no GitHub request. The window-size test also makes sure that the switch hides the panel.
With no stored copy, the first request takes about 4 seconds and the panel stayed empty. When that request runs for more than 200 ms, the panel now shows its labels, pulsing bars for the counts, and an empty heatmap grid. The skeleton has the same layout as the data, so nothing moves when the data arrives. It uses the pull request skeleton bar and the shared pulse clock, so it holds still under reduced motion. A stored copy loads in less than 200 ms, so a warm launch shows no skeleton. A failed request hides the skeleton.
…oads

When the first snapshot arrives, each heatmap column changes from the empty color to its level color over 0.3 seconds, and each column starts 10 ms after the one before it. The month labels and the counts fade in with the same timing. The full fill takes about 0.8 seconds. Later refreshes change the data with no animation, and reduced motion shows the data at once.
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