Skip to content

Move heatmap to first-party code#37262

Merged
bircni merged 6 commits intogo-gitea:mainfrom
silverwind:heat
Apr 20, 2026
Merged

Move heatmap to first-party code#37262
bircni merged 6 commits intogo-gitea:mainfrom
silverwind:heat

Conversation

@silverwind
Copy link
Copy Markdown
Member

@silverwind silverwind commented Apr 17, 2026

Replaces @silverwind/vue3-calendar-heatmap with an inlined SVG implementation. Renders pixel-identically to main, drops the onMounted legend viewBox workaround, and uses tippy's createSingleton for the hover tooltip. Adds an e2e test for tooltip display.

This is a prereq for migrating tippy.js to floating-ui to avoid having two tooltip libs active.

image

This PR was written with the help of Claude Opus 4.7

Replaces the `@silverwind/vue3-calendar-heatmap` dependency with an inlined
implementation tailored to Gitea's single use. Drops the onMounted legend
viewBox workaround (rendered correctly from the start), uses tippy's
`createSingleton` for the shared hover tooltip with move transition, and
adds an e2e test for tooltip display.

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Apr 17, 2026
@silverwind silverwind changed the title Vendor calendar heatmap component Move calendar heatmap to first-party code Apr 17, 2026
@silverwind silverwind added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label Apr 17, 2026
@silverwind silverwind requested a review from Copilot April 17, 2026 21:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Replaces the third-party Vue calendar heatmap component with a first-party SVG-rendered implementation, including a shared tippy.js singleton tooltip and an e2e regression test, while removing the external dependency.

Changes:

  • Inline SVG-based activity heatmap rendering (weeks/days/month labels + legend) and tippy.js singleton tooltip setup.
  • CSS tweak for legend alignment.
  • Add Playwright e2e coverage for tooltip-on-hover; remove @silverwind/vue3-calendar-heatmap from dependencies/lockfile.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
web_src/js/components/ActivityHeatmap.vue Replaces component dependency with computed SVG grid + singleton tooltip wiring
web_src/css/features/heatmap.css Adds legend wrapper margin adjustment previously done imperatively
tests/e2e/heatmap.test.ts Adds Playwright test ensuring tooltip becomes visible on hover
package.json Removes @silverwind/vue3-calendar-heatmap dependency
pnpm-lock.yaml Removes locked package entries for the removed dependency
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web_src/js/components/ActivityHeatmap.vue
Comment thread web_src/js/components/ActivityHeatmap.vue Outdated
Comment thread web_src/js/components/ActivityHeatmap.vue Outdated
@silverwind
Copy link
Copy Markdown
Member Author

Will do a bit more refactoring, like renaming the vch__* classes and variable names to conform the codebase more.

@silverwind silverwind changed the title Move calendar heatmap to first-party code Move heatmap to first-party code Apr 18, 2026
@bircni
Copy link
Copy Markdown
Member

bircni commented Apr 18, 2026

ping me when your done :-)

@silverwind silverwind marked this pull request as draft April 19, 2026 20:36
@silverwind silverwind marked this pull request as ready for review April 19, 2026 23:37
Drop the legacy BEM-style class names inherited from the upstream
`vue3-calendar-heatmap` library and use the codebase's kebab-case
convention (`heatmap-*`). Also drop the redundant `vch__container` and
`vch__legend-left`/`-right` wrappers, and the empty `vch__legend__wrapper`
`<g>`. Variables/constants renamed to camelCase, a few small cleanups
while here. Rendering remains pixel-identical.

Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
@silverwind
Copy link
Copy Markdown
Member Author

silverwind commented Apr 19, 2026

Renames and cleanups done. @bircni ping.

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Apr 20, 2026
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Apr 20, 2026
@lunny lunny added this to the 1.27.0 milestone Apr 20, 2026
@bircni bircni merged commit 1d25bb2 into go-gitea:main Apr 20, 2026
26 checks passed
@silverwind silverwind deleted the heat branch April 20, 2026 20:24
silverwind added a commit to silverwind/gitea that referenced this pull request Apr 20, 2026
…-lang

* origin/main:
  Update go js dependencies (go-gitea#37312)
  Update GitHub Actions to latest major versions (go-gitea#37313)
  Revert "Add WebKit to e2e test matrix (go-gitea#37298)" (go-gitea#37315)
  Add `form-fetch-action` to some forms, fix "fetch action" resp bug (go-gitea#37305)
  Move heatmap to first-party code (go-gitea#37262)
  Use updated yaml fields for snapcraft (go-gitea#37318)
  Remove dead code identified by `deadcode` tool (go-gitea#37271)
  Enable strict TypeScript, add `errorMessage` helper (go-gitea#37292)
  Fix vite manifest update masking build errors (go-gitea#37279)
  bump snapcraft base (go-gitea#37301)

# Conflicts:
#	web_src/js/modules/errors.ts
silverwind added a commit to 6543-forks/gitea that referenced this pull request Apr 21, 2026
…n-better

* origin/main: (645 commits)
  When the requested arch rpm is missing fall back to noarch (go-gitea#37236)
  Fix `relative-time` error and improve global error handler (go-gitea#37241)
  Enhance styling in actions page (go-gitea#37323)
  fix(oauth): Error on auth sources with spaces (go-gitea#37327)
  Fix actions concurrency groups cross-branch leak (go-gitea#37311)
  Fix bug when accessing user badges (go-gitea#37321)
  Fix AppFullLink (go-gitea#37325)
  Update go js dependencies (go-gitea#37312)
  Update GitHub Actions to latest major versions (go-gitea#37313)
  Revert "Add WebKit to e2e test matrix (go-gitea#37298)" (go-gitea#37315)
  Add `form-fetch-action` to some forms, fix "fetch action" resp bug (go-gitea#37305)
  Move heatmap to first-party code (go-gitea#37262)
  Use updated yaml fields for snapcraft (go-gitea#37318)
  Remove dead code identified by `deadcode` tool (go-gitea#37271)
  Enable strict TypeScript, add `errorMessage` helper (go-gitea#37292)
  Fix vite manifest update masking build errors (go-gitea#37279)
  bump snapcraft base (go-gitea#37301)
  Add WebKit to e2e test matrix (go-gitea#37298)
  Don't add useless labels which will bother changelog generation (go-gitea#37267)
  Fix Repository transferring page (go-gitea#37277)
  ...

# Conflicts:
#	options/locale/locale_en-US.ini
#	templates/package/content/debian.tmpl
zjjhot added a commit to zjjhot/gitea that referenced this pull request Apr 22, 2026
* main: (25 commits)
  Add URL to `Learn more about blocking a user` (go-gitea#37355)
  fix: use TriggerEvent instead of Event in workflow runs API response for scheduled runs (go-gitea#37288)
  Add event.schedule context for schedule actions task (go-gitea#37320)
  Fix typos (go-gitea#37346)
  Fix an issue where changing an organization’s visibility caused problems when users had forked its repositories. (go-gitea#37324)
  Fail vite build on rolldown warnings via NODE_ENV=test (go-gitea#37270)
  Use modern "git update-index --cacheinfo" syntax to support more file names (go-gitea#37338)
  Fix URL related escaping for oauth2 (go-gitea#37334)
  When the requested arch rpm is missing fall back to noarch (go-gitea#37236)
  Fix `relative-time` error and improve global error handler (go-gitea#37241)
  Enhance styling in actions page (go-gitea#37323)
  fix(oauth): Error on auth sources with spaces (go-gitea#37327)
  Fix actions concurrency groups cross-branch leak (go-gitea#37311)
  Fix bug when accessing user badges (go-gitea#37321)
  Fix AppFullLink (go-gitea#37325)
  Update go js dependencies (go-gitea#37312)
  Update GitHub Actions to latest major versions (go-gitea#37313)
  Revert "Add WebKit to e2e test matrix (go-gitea#37298)" (go-gitea#37315)
  Add `form-fetch-action` to some forms, fix "fetch action" resp bug (go-gitea#37305)
  Move heatmap to first-party code (go-gitea#37262)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/refactoring Existing code has been cleaned up. There should be no new functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants