Skip to content

#232 — pass-2 conformance: tooltip edge-flip, expected badges left, tooltip text size - #234

Merged
cmbays merged 3 commits into
mainfrom
polish-232-pass2-conformance
Jun 11, 2026
Merged

cmbays merged 3 commits into
mainfrom
polish-232-pass2-conformance

Conversation

@cmbays

@cmbays cmbays commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Executes the three fix recipes from the 2026-06-11 design-conformance audit (pass-2 spec, epic #197) — the audit's three confirmed deviations, with before/after measurements.

D2 — Expected badges right-aligned + order-reversed (MED) → R2

D1 — CSS-bubble tips clip at the viewport edge (HIGH) → R1

  • Before (RED evidence, harness floor 500px innerWidth, stacked phone layout): bubble.right = 523.0 vs innerWidth = 500 — 23.0px clipped (the audit's real-375px measurement was 422.7 vs 375 = 47.7px clipped).
  • After: bubble left=59.2 right=272.2 at the same width — fully contained.
  • Mechanism: (a) belt-and-braces right-anchor for header-placed badges (the spec's own base.css precedent); (b) a geometry-only data-tip-edge="right"|"left" tagger on the delegated mouseenter/focusin path measuring the trigger against document.documentElement.clientWidth + two CSS anchor rules; (c) shared bubble max-width: min(70vw, calc(100vw - 16px)); (d) opportunistic D18: positionTipNear resets el.style.left = "0px" before measuring offsetWidth (stale-width clamp overshoot, the spec-shared quirk). Covers all three CSS-bubble consumers: incremental mode-badge tip, prior-model-state this-badge tip, DAG-hint ⓘ.

D3 — Bubble text 7.8px vs spec 13.44px (HIGH) → R3

  • Before (RED evidence): badge-tip bubble computed font-size 7.8px (0.78rem at Sakura's html{font-size:62.5%} root) vs #col-tooltip .ct-desc 13.44px.
  • After: font-size: 13.44px (the spec's 12px shell base × 1.12em description size, absolute px deliberately because of the Sakura root) — computed-equality pin green. The shared rule covers all three bubble consumers; line-height: 1.45 already in place; the 375px stacked view stays contained (the R1 cap/anchors handle the taller bubble).

#146/#161 contract preserved

The tooltip mechanism is unchanged: focusable trigger (tabindex), aria-label on the trigger, bubble aria-hidden, reveal via pure CSS :hover AND :focus/:focus-visible. No JS-controlled visibility — the new tagger annotates geometry only (data-tip-edge), no native title, no new dependencies, zero-egress untouched (zero-egress gate re-run green). The existing #146 focus-reveals-bubble guard stays green.

Tests (RED-first)

Three new pins appended to tests/headless_toggle.rs (sibling PR #230 also appends there — the #232 block sits at the end; a textual conflict resolves by keeping both blocks):

  1. badge_tip_bubble_stays_inside_a_narrow_viewport — phone-class stacked layout, badge tip focused, asserts bubble.right <= innerWidth && left >= 0. Failed on unmodified main (523.0 > 500).
  2. badge_tip_text_matches_column_tooltip_description_size — computed font-size equality vs a real #col-tooltip .ct-desc (plus the absolute 13.44px sanity pin). Failed on unmodified main (7.8px vs 13.44px).
  3. expected_meta_row_reads_left_without_an_expect_diff — no-diff test: meta row exists, order model|mode|rows, pill paints left of the rowcount, header carries only the <h2>. Failed on unmodified main (no bar without a diff).

Existing placement pins (MODE_BADGE/MODE_TIP_TRIGGER, the rich-test expected pill, the leak-clear pill check) updated truthfully to the spec-true bar location — none weakened. Note: the new pins use the file's synthetic-manifest harness builders (an incremental model + is_incremental_mode test — the identical code path the audit measured on the playground fixture) rather than loading the playground JSON, matching the suite's idiom.

Goldens

examples/{jaffle-shop,playground,diff-showcase}-report.html regenerated with the exact example-report-check CI commands; explore pages unchanged (they don't inline the report engine). git diff --text -U0 -- examples/ audited: every delta is the R1/R2/R3/D18 CSS/JS blocks, identical ×3 — no fixture/data/root_path deltas. The render_integration__rendered_chrome_jaffle_shop insta snapshot rebaselined for the same blocks. The test-card.html doc comment uses {#- -#} trimming so the template stays byte-neutral.

Gates (run directly — lefthook skips in fresh worktrees)

  • cargo fmt --check ✅
  • cargo clippy --all-targets --locked -- -D warnings ✅ (by exit code)
  • cargo nextest run ✅ 1193 passed
  • cargo test --test bdd ✅ 157 scenarios / 1016 steps (no feature-count change)
  • cargo test --test headless_zero_egress -- --ignored ✅ 10 passed
  • cargo test --test headless_toggle -- --ignored ✅ 49 passed
  • RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --locked ✅
  • cargo deny check ✅

Closes #232

🤖 Generated with Claude Code


Open in Stage

Summary by CodeRabbit

  • Bug Fixes

    • Fixed tooltip positioning near viewport edges to prevent content clipping
    • Resolved stale positioning calculations affecting tooltip placement accuracy
  • UI Improvements

    • Reorganized expected fixture metadata (badges and row counts) for more consistent layout
    • Enhanced tooltip styling with improved viewport-aware sizing and typography

…ted badges left, 13.44px tip text (#232)

Executes the three fix recipes from the 2026-06-11 design-conformance
audit (epic #197 pass-2 spec):

- R2 (audit D2): renderExpectedPanel always emits the .fixture-view-bar
  meta row for table renders — [model pill][mode badge][N rows] reading
  left under the Expected title, mirroring Given; the right-aligned,
  order-reversed .panel-header fallback is retired (sql-format /
  external-fixture early-return paths keep the header placement,
  spec-consistent). The #178 persistent-rowcount rescue is untouched.
- R1 (audit D1): edge-aware CSS bubbles — belt-and-braces right-anchor
  for header-placed badges (the spec's base.css precedent), a geometry-
  only data-tip-edge tagger on the delegated mouseenter/focusin path
  (visibility stays pure CSS — the #146/#161 contract intact), and the
  shared bubble max-width capped at min(70vw, calc(100vw - 16px)).
  Opportunistic D18: positionTipNear resets left before measuring
  offsetWidth (stale-width clamp overshoot).
- R3 (audit D3): bubble text 0.78rem (7.8px at Sakura's 62.5% root) →
  13.44px, matching the column-tooltip description (12px shell base ×
  1.12em).

Headless: three new RED-first pins (375px-class viewport containment,
computed-size equality vs #col-tooltip .ct-desc, no-diff meta-row
structure) + existing placement pins updated to the spec-true bar
location; the #146 focus-reveals-bubble guard stays green. Goldens
regenerated with the CI commands; every byte delta traces to the
R1/R2/R3/D18 blocks.

Closes #232

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 11, 2026 •

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@cmbays, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 13 minutes and 11 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8fcb2253-8744-4cf2-87ac-24809d4da75d

📥 Commits

Reviewing files that changed from the base of the PR and between 832d131 and 679e82c.

⛔ Files ignored due to path filters (1)
  • tests/snapshots/render_integration__rendered_chrome_jaffle_shop.snap is excluded by !**/*.snap
📒 Files selected for processing (5)
  • examples/diff-showcase-report.html
  • examples/jaffle-shop-report.html
  • examples/playground-report.html
  • templates/report.css
  • tests/headless_toggle.rs
📝 Walkthrough

Walkthrough

Tooltip bubbles now support viewport-edge-aware CSS positioning via a JS geometry tagger that measures triggers and bubbles, then annotates them with data-tip-edge. Expected-panel metadata unconditionally relocates to .fixture-view-bar. Tooltip positioning stale-left offset is corrected. Tests verify selector paths and add conformance checks for edge clamping, font-size equivalence, and reading order.

Changes

Tooltip viewport edge-awareness and expected-panel meta relocation

Layer / File(s) Summary
Tooltip CSS edge-aware styling and max-width constraints
templates/report.css, examples/diff-showcase-report.html, examples/jaffle-shop-report.html, examples/playground-report.html
Tooltip bubble max-width is constrained with viewport-aware min(70vw, calc(100vw - 16px)) and font-size pinned to 13.44px; new CSS rules for data-tip-edge="left"|"right" override bubble positioning and transform to anchor away from viewport edges, including higher-specificity selectors for expected-panel mode badges.
Viewport-edge geometry tagging functions
templates/interaction.js, examples/diff-showcase-report.html, examples/jaffle-shop-report.html, examples/playground-report.html
tagTipEdge(trigger) measures trigger bounding rect and tooltip bubble offsetWidth (while hidden) to conditionally set/remove data-tip-edge="right"|"left" based on viewport overflow; bindTipEdgeTagger() attaches delegated mouseenter/focusin handlers for .has-mode-tip and .expect-tooltip triggers.
Viewport-edge tagger integration into startup
templates/interaction.js, examples/diff-showcase-report.html, examples/jaffle-shop-report.html, examples/playground-report.html
bindTipEdgeTagger() is invoked during initialization alongside existing tooltip bindings.
Expected-panel meta relocation to fixture-view-bar
templates/interaction.js, templates/partials/test-card.html, examples/diff-showcase-report.html, examples/jaffle-shop-report.html, examples/playground-report.html
renderExpectedPanel unconditionally creates/uses .fixture-view-bar beneath the "Expected" title and prepends rowcount, mode badge, and expected model badge in reading order, removing the prior conditional header-fallback behavior. Template comment documents persistent rowcount relocation rules.
Tooltip positioning stale left-offset correction
templates/interaction.js, examples/diff-showcase-report.html, examples/jaffle-shop-report.html, examples/playground-report.html
positionTipNear() resets el.style.left to "0px" before measuring and deriving clamped/flipped coordinates to prevent stale left values from a previous show from skewing calculations.
Test updates and conformance assertions
tests/headless_toggle.rs
DOM selectors for mode badge and model pill updated to reference .fixture-view-bar instead of .panel-header; new tests assert viewport-edge bubble positioning, bubble font-size equivalence to column-tooltip description, and expected meta row left-to-right reading order with header containing only title when no diff exists.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

  • breezy-bays-labs/cute-dbt#232: This PR implements the complete feature scope of issue #232, including viewport-edge tooltip anchoring, expected-panel meta relocation to .fixture-view-bar, tooltip positioning stale-left fix, and conformance test coverage for edge clamping and reading order.

Possibly related PRs

  • breezy-bays-labs/cute-dbt#188: Also updates expected-panel meta relocation and tooltip positioning for the .fixture-view-bar layout pattern, making it a related refactoring of the same DOM structure and rendering flow.

Poem

A rabbit hops through viewport bounds,
Tooltips anchor left and right with sounds,
Meta badges dance in fixture bars,
Fixed and measured, clear as stars! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: tooltip edge-flip behavior, expected badges repositioning to the left (in fixture-view-bar), and tooltip text size adjustment, all of which are the primary objectives.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch polish-232-pass2-conformance

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ghost

ghost commented Jun 11, 2026 •

Copy link
Copy Markdown

Ready to review this PR? Stage has broken it down into 4 individual chapters for you:

Title
1 Fix tooltip text size and viewport clipping
2 Relocate Expected meta row to fixture bar
3 Update and add conformance tests
4 Other changes
Open in Stage

Chapters generated by Stage for commit 679e82c on Jun 11, 2026 4:48pm UTC.

@github-actions

github-actions Bot commented Jun 11, 2026 •

Copy link
Copy Markdown
Contributor

📄 Rendered report preview

All golden examples regenerated cleanly.

🟡 Golden examples

Committed to examples/ and byte-identity gated — the canonical reports contributors and consumers browse. Stable across PRs.

Report View Download
jaffle-shop-report.html ▶ Open ↗ ⬇ Download
playground-report.html ▶ Open ↗ ⬇ Download
diff-showcase-report.html ▶ Open ↗ ⬇ Download

🐶 Live dogfood preview

This PR doesn't touch dbt-project/, so there's no live dogfood preview.

▶ Open ↗ opens the report in your browser in one click —
published to this repo's GitHub Pages under /pr-234/.
⬇ Download fetches the same self-contained HTML as a workflow
artifact (auth-gated; works fully offline). Either way the report
makes zero external resource requests.

The Pages preview may take ~1 min to update after this comment
posts. On PRs from forks the Open link is unavailable (read-only
token) — use Download.

Alternative: GitHub CLI
# gh CLI >= 2.63 extracts into ./report-preview-playground/.
gh run download 27362957024 -R breezy-bays-labs/cute-dbt -n report-preview-playground
open report-preview-playground/playground-report.html

Posted by report-preview.yml for 679e82c1e37cf532666f462dede968fcc4c1f3ba. Affordance only — never blocks merge.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request addresses design-conformance issues (cute-dbt#232) by implementing edge-aware tooltip bubble anchoring, ensuring the Expected panel's metadata row is consistently positioned below the title, and adjusting the tooltip bubble text size to match column descriptions. Additionally, headless integration tests have been added to verify these layout and sizing fixes. I have no feedback to provide as there are no review comments to evaluate.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/headless_toggle.rs`:
- Around line 7561-7569: The viewport-edge assertions are too strict for
fractional-pixel rounding; update the assertions around variables right, left
and vw in tests/headless_toggle.rs to allow a 1.0px tolerance (e.g.
assert!(right <= vw + 1.0, ...) and assert!(left >= -1.0, ...)) or introduce a
small_tolerance = 1.0 and use right <= vw + small_tolerance and left >=
-small_tolerance so the test remains deterministic while preserving intent.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6c2bf09f-f3e7-4822-a5c2-e79b3091656c

📥 Commits

Reviewing files that changed from the base of the PR and between 65d35bf and 832d131.

⛔ Files ignored due to path filters (1)
  • tests/snapshots/render_integration__rendered_chrome_jaffle_shop.snap is excluded by !**/*.snap
📒 Files selected for processing (7)
  • examples/diff-showcase-report.html
  • examples/jaffle-shop-report.html
  • examples/playground-report.html
  • templates/interaction.js
  • templates/partials/test-card.html
  • templates/report.css
  • tests/headless_toggle.rs

Comment thread tests/headless_toggle.rs
getBoundingClientRect returns fractional px in headless Chrome; the
exact bounds (right <= vw, left >= 0.0) were a flake vector. 1px
tolerance mirrors the #157 sub-pixel precedent — the guarded
regression is 23-47px of clipping, so the teeth are intact.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ormance

# Conflicts:
#	tests/headless_toggle.rs
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.

polish: pass-2 conformance — tooltip edge-flip, expected badges left (Given pattern), tooltip text size

1 participant