feat(FR-2907): add matte + natural-size cap for doc images, tighten capture guidance#7453
Open
yomybaby wants to merge 2 commits into
Open
feat(FR-2907): add matte + natural-size cap for doc images, tighten capture guidance#7453yomybaby wants to merge 2 commits into
yomybaby wants to merge 2 commits into
Conversation
…apture guidance - markdown-processor-web.ts: emit max-width=(pixel_width × 0.5) from PNG header so 2× zoom captures display at intended CSS size. Mirrors the PDF auto-scale logic. Explicit  size hints still win. - styles-web.ts / styles.ts: move border/radius/shadow from .doc-image (img) to figure.doc-figure (wrapper); add padding + neutral background so the wrapper acts as a matte. Element-level captures with content flush to the PNG edges now have visible breathing room without any recapture. Cards/modals with their own rounded corners no longer compete with a second outer radius. - markdown-processor.ts: export getImageDimensions + IMAGE_SCALE_FACTOR so the web renderer can reuse the PDF dimension/scale helpers. - SCREENSHOT-GUIDELINES.md: document the matte, the renderer-side auto size cap, the parent-container-preferred rule, and the small-element rule (≤ 600 CSS px). - docs-screenshot-capturer.md: prompt update — capture raw elements and let the matte frame them, prefer parent containers, handle small widgets via auto-cap or browser_evaluate repositioning.
Member
Author
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has required the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Backend.AI documentation toolkit and screenshot authoring guidance to support matte-framed documentation images and automatic natural-size display caps for captured screenshots.
Changes:
- Adds matte-style image framing for web and PDF documentation output.
- Exports shared image dimension/scale helpers and applies automatic web image max-width caps.
- Updates screenshot capture guidance for modal framing, small widgets, and renderer-side sizing behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
packages/backend.ai-webui-docs/SCREENSHOT-GUIDELINES.md |
Adds authoring guidance for matte framing, parent-container captures, and small-element sizing. |
packages/backend.ai-docs-toolkit/src/styles.ts |
Updates PDF image figure styling to use a matte frame. |
packages/backend.ai-docs-toolkit/src/styles-web.ts |
Updates web image figure styling to use a matte frame and bare inner images. |
packages/backend.ai-docs-toolkit/src/markdown-processor.ts |
Exports shared image dimension and image scale helpers. |
packages/backend.ai-docs-toolkit/src/markdown-processor-web.ts |
Adds web-side image dimension lookup and automatic max-width sizing. |
.claude/agents/docs-screenshot-capturer.md |
Updates screenshot capture agent guidance to align with the matte and sizing behavior. |
…er against traversal Copilot review on #7453: - styles-web.ts / styles.ts: `figure.doc-figure` was a default block, so the matte spanned the full article column even when the inner <img> was capped (e.g. a 760-px notification was rendered at 380 px inside a column-wide matte). Add `width: fit-content; max-width: 100%` so the matte shrinks to the largest child (capped image or caption), with `margin: ... auto` keeping it centered. - markdown-processor-web.ts: `resolveWebImageDiskPath` only checked that the href started with '/' before joining it under <srcDir>/<lang>. A '/../other-lang/foo.png' would slip past and let the renderer read PNG headers outside the language root just to compute display dimensions. `rewriteImagePathsForWeb` already filters out-of-tree refs, but enforce the same boundary at the resolver too (defense in depth).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Resolves #7451(FR-2907)
Why
Three recurring visual issues with documentation screenshots, all visible on the Korean sessions_all page:
browser_take_screenshotwith arefproduces PNGs whose content is flush against every edge. Example:session_type_batch.png(2669×1770) — text and the wizard step indicator are touching the image borders..doc-imagewrapper's outer radius. Example:launch_session_confirm.png.session_notification.png. PDF already auto-scaled viaIMAGE_SCALE_FACTOR = 0.5; web did not.What changes
Renderer (`packages/backend.ai-docs-toolkit`)
Effects:
Capture guidance (`packages/backend.ai-webui-docs/SCREENSHOT-GUIDELINES.md`)
New "Padding & Framing" section that documents:
The existing "Match the Existing Screenshot's Framing" table is updated to reference the new rules.
Capture agent (`.claude/agents/docs-screenshot-capturer.md`)
Prompt updates to match the new guidance: capture raw elements and let the matte frame them, prefer parent containers, handle small widgets via the auto cap (default) or `browser_evaluate` repositioning (when more screen real estate is needed).
Verification
Follow-up
Checklist: