Skip to content

fix(zoom): keep a zoomed SVG's own clip paths, so a stacked chart keeps its bars - #465

Merged
vite-hub[bot] merged 2 commits into
mainfrom
t3/fix-chart-zoom-bars
Nov 18, 2026
Merged

vite-hub[bot] merged 2 commits into
mainfrom
t3/fix-chart-zoom-bars

Conversation

@onmax

@onmax onmax commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

Zooming a stacked bar chart shows its legend, labels, value labels and notes, but no bars. Grouped and plain bar charts zoom fine.

A stacked chart rounds the ends of its bars with a <clipPath>, referenced by id. The zoom's strip() drops every id from its copy, so the copy's clip-path="url(#…)" points at the original chart's clip path. The original is visibility: hidden while it's zoomed, and SVG leaves hidden children out of a clip path, so the clip region is empty and every bar is clipped away.

This PR keeps the ids inside an SVG in the copy, renamed with a -cz<n> suffix, and rewrites the url(#…) and href="#…" references to them, so the copy clips with its own paths. Ids outside SVG are still dropped.

The new e2e test zooms a stacked and a grouped chart and counts the bar color's pixels in the zoomed copy. On main the stacked chart's copy has 225 of them (only its legend swatch); with this PR it passes. The charts, zoom, zoom-dialog, annotate and carousel e2e files pass (75 tests), and so do zoom's unit tests.

Before/after: https://drop.vitehub.dev/d/v585jhj2d5hq/chart-zoom-bars

Found on Drop, where the zoomed stacked chart in a review doc had no bars.

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-18T13:35:20.293818Z
We couldn’t complete this review. Comment @codex review to try again.
d816a49 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@vite-hub

vite-hub Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Completed 2026-11-18T14:17:17.286Z 4m 33s
View session Last seen running 2026-11-18T13:52:14.807Z 32s

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

View session

PR #465 is ready. The current commit restores stacked bars in zoom and fixes all three resolved review findings: solid colors, whitespace in SVG references, and ID collisions. All current-head GitHub checks passed. Local lint passed; 31 of 32 zoom tests passed, with the remaining unchanged WebM test blocked by the sandbox’s child-process restriction. No repair push was needed.

@onmax
onmax force-pushed the t3/fix-chart-zoom-bars branch from d816a49 to 755ebda Compare November 18, 2026 13:36

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Important

The change restores stacked bars, but the SVG rewrite can also turn a valid solid fill black. Please fix the attribute matching before merging.

Approach: Renaming IDs in the zoom copy is the right fix for references to hidden originals, provided the copy uses unclaimed IDs and rewrites only actual references.

Reviewed changes — I traced the shared clone path and verified the rendering in Chromium.

  • Zoom copies: SVG IDs and fragment references are rewritten in the main view, asides, and thumbnails, while HTML IDs are still stripped.
  • Chart regression test: The new test counts bar-colored pixels in zoomed stacked and grouped charts, so a legend swatch alone cannot pass. All 75 browser tests across charts, zoom, zoom-dialog, annotate, and carousel passed, and all 32 zoom package tests passed. Separate Chromium fixtures confirmed the inline findings.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.2-sol(high) | 𝕏

Comment thread packages/zoom/src/script.ts Resolved
Comment thread packages/zoom/src/script.ts Resolved
Comment thread packages/zoom/src/script.ts Resolved
@pkg-pr-new

pkg-pr-new Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

pnpm add https://pkg.pr.new/comark-annotate@465

comark-badge

pnpm add https://pkg.pr.new/comark-badge@465

comark-bundle

pnpm add https://pkg.pr.new/comark-bundle@465

comark-cards

pnpm add https://pkg.pr.new/comark-cards@465

comark-carousel

pnpm add https://pkg.pr.new/comark-carousel@465

comark-cast

pnpm add https://pkg.pr.new/comark-cast@465

comark-charts

pnpm add https://pkg.pr.new/comark-charts@465

comark-chat

pnpm add https://pkg.pr.new/comark-chat@465

comark-chips

pnpm add https://pkg.pr.new/comark-chips@465

comark-cjk

pnpm add https://pkg.pr.new/comark-cjk@465

comark-code

pnpm add https://pkg.pr.new/comark-code@465

comark-code-notes

pnpm add https://pkg.pr.new/comark-code-notes@465

comark-colors

pnpm add https://pkg.pr.new/comark-colors@465

comark-comments

pnpm add https://pkg.pr.new/comark-comments@465

comark-critic

pnpm add https://pkg.pr.new/comark-critic@465

comark-deflist

pnpm add https://pkg.pr.new/comark-deflist@465

comark-details

pnpm add https://pkg.pr.new/comark-details@465

comark-diagrams

pnpm add https://pkg.pr.new/comark-diagrams@465

comark-diff

pnpm add https://pkg.pr.new/comark-diff@465

comark-embed

pnpm add https://pkg.pr.new/comark-embed@465

comark-fields

pnpm add https://pkg.pr.new/comark-fields@465

comark-figure

pnpm add https://pkg.pr.new/comark-figure@465

comark-file-tree

pnpm add https://pkg.pr.new/comark-file-tree@465

comark-footnotes

pnpm add https://pkg.pr.new/comark-footnotes@465

comark-git-graph

pnpm add https://pkg.pr.new/comark-git-graph@465

comark-github

pnpm add https://pkg.pr.new/comark-github@465

comark-icon

pnpm add https://pkg.pr.new/comark-icon@465

comark-include

pnpm add https://pkg.pr.new/comark-include@465

comark-keys

pnpm add https://pkg.pr.new/comark-keys@465

comark-links

pnpm add https://pkg.pr.new/comark-links@465

comark-linter

pnpm add https://pkg.pr.new/comark-linter@465

comark-magic-move

pnpm add https://pkg.pr.new/comark-magic-move@465

comark-mark

pnpm add https://pkg.pr.new/comark-mark@465

markdown-it-to-comark

pnpm add https://pkg.pr.new/markdown-it-to-comark@465

marked-to-comark

pnpm add https://pkg.pr.new/marked-to-comark@465

comark-mathml

pnpm add https://pkg.pr.new/comark-mathml@465

comark-media

pnpm add https://pkg.pr.new/comark-media@465

comark-metrics

pnpm add https://pkg.pr.new/comark-metrics@465

migrate-to-comark

pnpm add https://pkg.pr.new/migrate-to-comark@465

comark-outline

pnpm add https://pkg.pr.new/comark-outline@465

comark-properties

pnpm add https://pkg.pr.new/comark-properties@465

comark-qr

pnpm add https://pkg.pr.new/comark-qr@465

comark-quiz

pnpm add https://pkg.pr.new/comark-quiz@465

comark-reading-time

pnpm add https://pkg.pr.new/comark-reading-time@465

remark-to-comark

pnpm add https://pkg.pr.new/remark-to-comark@465

comark-sources

pnpm add https://pkg.pr.new/comark-sources@465

comark-steps

pnpm add https://pkg.pr.new/comark-steps@465

comark-table

pnpm add https://pkg.pr.new/comark-table@465

comark-tabs

pnpm add https://pkg.pr.new/comark-tabs@465

comark-tests

pnpm add https://pkg.pr.new/comark-tests@465

comark-time

pnpm add https://pkg.pr.new/comark-time@465

comark-ui

pnpm add https://pkg.pr.new/comark-ui@465

comark-xref

pnpm add https://pkg.pr.new/comark-xref@465

comark-zoom

pnpm add https://pkg.pr.new/comark-zoom@465

commit: 6992260

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No new issues found. No P0 or P1 findings remain.

Reviewed changes — Reviewed the SVG reference fixes since d816a49. The workspace build, 80 Chromium tests, and 32 zoom unit tests passed.

  • Preserved SVG paint. Limited bare fragment rewrites to href and xlink:href, and remapped quoted and whitespace-padded url(…) references without changing solid colors.
  • Avoided ID collisions. Skipped suffixes that would collide with existing document IDs and added browser coverage for the collision and reference cases.

Pullfrog  | View workflow run | Using gpt-6.2-sol(high) | 𝕏

onmax added a commit to vite-hub/drop that referenced this pull request Nov 18, 2026
…chart keeps its bars (#237)

* fix(deps): pin comark-ui at onmax/comark-ui#465, so a zoomed stacked chart keeps its bars

* fix: allow every script a properties box writes, now that its dates are relative
@vite-hub
vite-hub Bot merged commit c3f9fac into main Nov 18, 2026
7 checks passed
@vite-hub
vite-hub Bot deleted the t3/fix-chart-zoom-bars branch November 18, 2026 14:35
This was referenced Nov 18, 2026
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