Skip to content

feat(quill-charts): canvas tick marks and axis-line coexistence - #67990

Merged
sampennington merged 2 commits into
masterfrom
sam/quill-charts-axis-ticks
Jul 3, 2026
Merged

feat(quill-charts): canvas tick marks and axis-line coexistence#67990
sampennington merged 2 commits into
masterfrom
sam/quill-charts-axis-ticks

Conversation

@sampennington

Copy link
Copy Markdown
Contributor

Problem

Part 2 of the quill charts style refresh (stacked on #67989, split from #67982). Charts that draw the L-shaped axis lines can't show tick marks that stay pixel-aligned with the axis (a DOM-overlay attempt needed a 1px overlap fudge and still drifted), the axis color is tied to the tick-label color, and the grid's boxed frame fights the axis-line style — a stray right border and doubled baselines.

Changes

Library-only, opt-in, default-off.

  • showTickMarks — axis tick marks drawn on canvas in the same pass and with the same half-pixel snapping (snapToPixel) as drawAxes/drawGrid, so ticks, axis, grid, and zero baseline land on identical pixels. Tick positions mirror AxisLabels' visible-label computation so every tick pairs with a rendered label (multi-axis gutters and horizontal bars included).
  • theme.axisLineColor via a single resolveAxisLineColor(theme) — mute the axis L and ticks without muting label text. One resolver shared by every call site (a copy-pasted fallback chain caused a stale-memo bug in the earlier draft; centralizing kills the class).
  • Axis-line coexistence when a chart passes showAxisLines: the grid skips its plot-edge frame and category lines, the bottom-hugging gridline yields to the chart-drawn axis (framed/classic grids keep their baseline gridline — the earlier unconditional skip was flagged in review as a default-rendering regression and is now gated), bar/combo charts draw the axis alongside the grid like line charts, and axes render after the data.

How did you test this code?

  • New unit tests: tick-mark geometry (x/left/right, snapping, offsets), frame gating incl. the framed-grid baseline staying put
  • Full charts jest suite: 59 suites / 1528 tests pass
  • Manual visual review across trends/SQL line, bar, and combo charts

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Docs update

packages/quill/packages/charts/AGENTS.md updated with the new options in this PR.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Built with Claude Code with the human directing the visuals against the live app. Part of the four-PR stack replacing the monolithic #67982; folds in the sp-ship review findings (gated bottom-gridline skip, resolveAxisLineColor extraction fixing the missing memo dep, spurious createScales dep dropped, snapToPixel adopted across drawGrid).

🤖 Generated with Claude Code

@greptile-apps

greptile-apps Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "feat(quill-charts): canvas tick marks an..." | Re-trigger Greptile

Comment thread packages/quill/packages/charts/IMPROVEMENTS.md Outdated
Comment thread packages/quill/packages/charts/src/core/types.ts
Comment thread packages/quill/packages/charts/src/core/canvas-renderer.ts
@sampennington
sampennington marked this pull request as ready for review July 2, 2026 19:53
@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested a review from a team July 2, 2026 19:54

@sampennington sampennington left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🤖 sp-ship · 🚫 Blockers

The feature itself is clean: tick marks draw on the static layer (no hover-path cost), pixel-snapping and axis-line colour are centralized, and tick geometry reuses the same visible-label helpers as AxisLabels so ticks can't drift. Two things block merge — IMPROVEMENTS.md, an internal working-notes file whose own text says to keep it untracked and out of the public repo, is committed here; and the new resolveAxisLineColor precedence helper (the shared source of the tick/axis-line colour) ships with no test. Non-blocking: a horizontal-orientation grid/axis-line double-line edge case, a now-stale showAxisLines doc contract, and duplication between the tickMarkCoords memo and AxisLabels.

Comment thread packages/quill/packages/charts/IMPROVEMENTS.md Outdated
Comment thread packages/quill/packages/charts/src/core/canvas-renderer.ts
Comment thread packages/quill/packages/charts/src/core/canvas-renderer.ts Outdated
Comment thread packages/quill/packages/charts/src/charts/LineChart/LineChart.tsx
Comment thread packages/quill/packages/charts/src/core/Chart.tsx
Comment thread packages/quill/packages/charts/src/core/Chart.tsx
@sampennington sampennington added the stamphog Request AI approval (no full review) label Jul 2, 2026 — with PostHog
Comment thread packages/quill/packages/charts/src/core/canvas-renderer.ts Outdated
github-actions[bot]
github-actions Bot previously approved these changes Jul 2, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Both greptile blockers (accidental internal-notes file commit, missing precedence test) were fixed on the current head, remaining review comments are minor deferred cosmetic follow-ups (stale JSDoc, an edge-case double gridline in a rare horizontal config) that the reviewer acknowledged with 👍, and there's no evidence of unresolved production-risk issues in this canvas-rendering-only chart library change.

@github-actions
github-actions Bot dismissed their stale review July 2, 2026 20:40

New commits pushed (delta classified non_trivial_delta) — stamphog approval dismissed; re-review running automatically.

github-actions[bot]
github-actions Bot previously approved these changes Jul 2, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All substantive blockers raised by the independent bot reviewer (internal notes file committed to the public repo, untested color-precedence helper, inconsistent pixel-snapping) were fixed in later commits and the current diff confirms the fixes; remaining items (stale JSDoc, a narrow horizontal-orientation edge case) are cosmetic/visual-only and were explicitly logged as follow-ups rather than left silently unaddressed.

@posthog

posthog Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

👋 Visual changes detected for this PR.

Review and approve in PostHog Visual Review

If these changes are unexpected, they may be caused by a flaky test or a broken snapshot on master. Don't approve — rerun the job or wait for a fix.

Base automatically changed from sam/quill-charts-line-stroke to master July 3, 2026 05:57
Opt-in, default-off axis restyle capabilities:

- showTickMarks: axis tick marks drawn on canvas in the same pass and
  with the same half-pixel snapping (snapToPixel) as drawAxes/drawGrid,
  so ticks, axis, grid, and zero baseline land on identical pixels — a
  DOM overlay can't guarantee that across subpixel rounding
- theme.axisLineColor via resolveAxisLineColor(theme): mute the L-axis
  and tick marks without muting tick-label text; one resolver shared by
  every call site so the precedence can't drift
- with showAxisLines: the grid skips its plot-edge frame (no stray far
  border) and category lines, the bottom-hugging gridline yields to the
  chart-drawn axis (framed grids keep theirs), bar/combo charts draw
  the axis L alongside the grid like line charts, and axes render after
  the data so nothing paints over the baseline; grid frame closing
  strokes share the same snapped pixel grid

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sampennington
sampennington force-pushed the sam/quill-charts-axis-ticks branch from 78ef097 to 066082f Compare July 3, 2026 06:00
@github-actions
github-actions Bot dismissed their stale review July 3, 2026 06:01

New commits pushed (delta classified non_linear_history) — stamphog approval dismissed; re-review running automatically.

@stamphog stamphog 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.

Greptile flagged a concrete rendering bug — the new frameless-grid path skips the zero-tick filter in the horizontal branch of drawGrid, so horizontal bar/combo charts with showAxisLines can double-draw a gridline against the axis — and the author's own reply agrees it's valid but explicitly defers the fix to a follow-up rather than fixing it here; the diff confirms the horizontal value-tick loop still has no !frame guard while the vertical one does. That's a real, reachable defect in the exact feature this PR ships, left unaddressed. Additionally, all reviews (greptile, graphite, and the author's own review-persona comments) are on older commits, not the current head, so there's no independent sign-off on what's actually being merged.

@stamphog stamphog Bot removed the stamphog Request AI approval (no full review) label Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

🤖 CI report

⚠️ Bundle size — 🔺 +1.3 KiB (+0.0%)

Uncompressed size of every built .js bundle, compared against the base branch.

Total: 81.56 MiB · 🔺 +1.3 KiB (+0.0%)

File Size Δ vs base
render-query/src/render-query/render-query.js 25.39 MiB 🔺 +1.3 KiB (+0.0%)

Posted automatically by build-bundle-size-report · uncompressed bytes from dist-report

Eager graph — within budget

How much code each root ships on the eager path — downloaded and parsed before the surface is interactive. Measured from the esbuild output chunks (post-tree-shake, static imports only); lazy import() / React.lazy chunks are not counted.

Root Eager (shipped) Δ vs base Budget
entry (logged-out pages, app bootstrap)
src/index.tsx
3.76 MiB · 695 files no change █████████░ 87.6% of 4.29 MiB
authenticated shell (every logged-in page)
src/scenes/AuthenticatedShell.tsx
11.52 MiB · 2,937 files no change █████████░ 89.5% of 12.87 MiB

🟢 node_modules/monaco-editor/ stays out of src/index.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/index.tsx
🟢 node_modules/monaco-editor/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/scenes/AuthenticatedShell.tsx

Largest files eagerly shipped from src/index.tsx
Size File
275.2 KiB ../node_modules/.pnpm/posthog-js@1.396.5/node_modules/posthog-js/dist/rrweb.js
266.9 KiB ../node_modules/.pnpm/@posthog+icons@0.37.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js
224.5 KiB src/taxonomy/core-filter-definitions-by-group.json
211.3 KiB ../node_modules/.pnpm/posthog-js@1.396.5/node_modules/posthog-js/dist/module.js
126.8 KiB ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js
105.9 KiB src/lib/api.ts
69.7 KiB src/products.tsx
61.7 KiB src/lib/lemon-ui/icons/icons.tsx
57.2 KiB src/lib/utils/eventUsageLogic.ts
39.6 KiB src/lib/KeaDevTools.tsx
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
Size File
458.3 KiB ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/driving-hogzilla.mjs
302.9 KiB ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/coffee-run.mjs
275.2 KiB ../node_modules/.pnpm/posthog-js@1.396.5/node_modules/posthog-js/dist/rrweb.js
266.9 KiB ../node_modules/.pnpm/@posthog+icons@0.37.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js
253.2 KiB ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/chart-hog.mjs
239.2 KiB ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/x-ray.mjs
224.5 KiB src/taxonomy/core-filter-definitions-by-group.json
211.6 KiB ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/money.mjs
211.3 KiB ../node_modules/.pnpm/posthog-js@1.396.5/node_modules/posthog-js/dist/module.js
185.9 KiB ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/hogpatch.mjs

Posted automatically by check-eager-graph · sizes are eager output bytes (shipped, post-tree-shake) from the esbuild metafile · part of #32479

Dist folder size — 🟢 -285.36 MiB (-16.3%)

Total size of the built frontend/dist folder (all assets), compared against the base branch.

Total: 1464.68 MiB · 🟢 -285.36 MiB (-16.3%)

@sampennington
sampennington enabled auto-merge (squash) July 3, 2026 06:12
@sampennington
sampennington removed the request for review from a team July 3, 2026 06:13
The frameless-grid skip of axis-hugging value gridlines only covered
the vertical orientation; horizontal charts with showAxisLines could
double-draw the zero gridline against the chart-drawn value axis.
Mirror the guard in the horizontal branch.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sampennington sampennington added the stamphog Request AI approval (no full review) label Jul 3, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Opt-in canvas chart feature (tick marks + axis-line/grid coexistence) with no default-behavior change; the diff confirms greptile's blocking findings were actually fixed (accidental IMPROVEMENTS.md removed, resolveAxisLineColor now unit-tested, and the horizontal frameless-baseline guard is present in canvas-renderer.ts despite the thread saying it was deferred), and remaining items are cosmetic doc follow-ups. Greptile and a security bot both 👍'd the PR, satisfying independent review for this complexity tier.

@sampennington
sampennington merged commit 1af2858 into master Jul 3, 2026
217 of 225 checks passed
@sampennington
sampennington deleted the sam/quill-charts-axis-ticks branch July 3, 2026 06:39
@deployment-status-posthog

deployment-status-posthog Bot commented Jul 3, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-07-03 07:13 UTC Run
prod-us ✅ Deployed 2026-07-03 07:23 UTC Run
prod-eu ✅ Deployed 2026-07-03 07:24 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stamphog Request AI approval (no full review)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant