Skip to content

Fix caption wrapping and configurable vertical offset - #2561

Merged
chubes4 merged 1 commit into
mainfrom
fix/issue-2560-wp-codebox
Oct 3, 2026
Merged

chubes4 merged 1 commit into
mainfrom
fix/issue-2560-wp-codebox

Conversation

@chubes4

@chubes4 chubes4 commented Oct 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #2560. Captions now wrap within their pill, and recipes can configure a validated pixel offset to move them away from sticky headers or other content.

What changed

  • Runtime change in `packages/runtime-playground/src/browser-annotations.ts`: captions use normal whitespace and `overflow-wrap: anywhere`; labels retain `nowrap`. Caption `offset` adds pixels to the existing vertical inset for top, center, and bottom placements.
  • Runtime contract change in `packages/runtime-core/src/browser-interaction.ts`: caption offsets must be finite, non-negative numbers; offsets on other annotation shapes are rejected.
  • Regression coverage in `tests/browser-annotations.browser.test.ts` verifies validation and measures wrapped text lines against the pill and viewport at a narrow viewport, including the applied offset.
  • Committed as `c4762426` (`fix(annotate): wrap captions and support vertical offset`). No changelog or version strings were changed.

How to test

  1. Run npm ci && npm run build && npm run test:browser-annotations; expect passes as recorded by Cook's deterministic gate.

Compatibility

Additive for captions: omitting `offset` preserves the existing placement, while caption text now wraps instead of overflowing. Labels are unaffected. Invalid or non-caption offsets are rejected during step validation.

Evidence

  • Verified command npm ci && npm run build && npm run test:browser-annotations: status=succeeded; candidate commit 16e9e9c3b8b71d159ecd3adf51688456daa43cdc, tree 27da5c1a76ae95757e5bbefea8118e5ddad5d115, fingerprint 8f48f250f36cf8e746ee8dc7178d03356aa13cfdc5619781419d4f833c5025db; durable gate gate-1
  • Base unchanged since verification: main remains at 0faffbf.
  • CI expected: Homeboy CI after push
  • Candidate adoption provenance: the candidate was promoted from the recorded Cook task execution.
  • Cook deterministic verification: 1 gate(s) completed green.
  • Durable run execution: Succeeded
  • Reviewer-resolvable evidence from source_refs[0]: annotate caption: long text overflows the pill (white-space: nowrap) and the vertical offset is fixed #2560
  • Task objective: Goal: annotate captions wrap inside their pill and accept a configurable vertical offset. Start in packages/runtime-playground/src/browser-annotations.ts (~L116-119 caption styles) and the step validation in packages/runtime-core/src/browser-interaction.ts (~L385-391); tests in tests/browser-annotations.browser.test.ts.
  • Verified candidate scope: 3 changed file(s): packages/runtime-core/src/browser-interaction.ts, packages/runtime-playground/src/browser-annotations.ts, tests/browser-annotations.browser.test.ts.
  • Verified finalization base: main at 0faffbf
  • deterministic gate passed: sh -lc npm ci && npm run build && npm run test:browser-annotations (Passed)

AI assistance

  • AI assistance: Yes
  • Tool(s): Homeboy (opencode)
  • Model: openai/gpt-6-luna
  • Used for: Read issue annotate caption: long text overflows the pill (white-space: nowrap) and the vertical offset is fixed #2560 first, checked the existing annotation executor and shared validation contract, then added a browser regression and validated offset behavior. The focused suite passed via `node --import tsx --test tests/browser-annotations.browser.test.ts` (4 tests). The package-script launcher could not start because `tsx` IPC listener setup returned EINVAL in this environment; the direct Node test invocation worked. These are bounded observations, not controller-owned final gate results. No PR was opened or pushed because publication is controller-owned for this attempt. Runtime evidence boundary: changes are limited to the caption annotation contract, rendering, and browser tests; existing label, arrow, and other annotation behavior was not intentionally changed. AI-assisted: authored by a Homeboy cook for Extra Chill Bot.

@chubes4
chubes4 merged commit 428f2d0 into main Oct 3, 2026
5 of 6 checks passed
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.

annotate caption: long text overflows the pill (white-space: nowrap) and the vertical offset is fixed

1 participant