Skip to content

Branding: screenshot alignment, border, and side-by-side step layout - #290

Merged
Twest2 merged 3 commits into
mainfrom
feat/branding-image-layout
Nov 9, 2026
Merged

Twest2 merged 3 commits into
mainfrom
feat/branding-image-layout

Conversation

@Twest2

@Twest2 Twest2 commented Nov 9, 2026 •

Copy link
Copy Markdown
Owner

Issue

Part of #286 (points 3–5: image alignment, screenshot border, side-by-side layout).

Summary

A brand profile gets a Screenshots card with three options for PDF, Word and HTML exports (and GitHub Pages, which uses the HTML):

  • Alignment: Left, Center or Right. Applies to screenshots and flowcharts narrower than the page.
  • Border around screenshots: a thin line in a color you pick.
  • Step layout: Stacked, or Side by side with the screenshot on the left (55%) and the description on the right.

Every option defaults to what exports already do, so existing profiles and unbranded exports don't change.

Changes

  • core/branding.js: the profile gets screenshots: { align, border, borderColor, layout }, normalized with safe defaults.
  • Branding editor: a new Screenshots card with an Alignment dropdown, a Border switch that shows a Border color row while it's on, and a Step layout dropdown. The profile summary gets a Screenshots line.
  • PDF:
    • Alignment offsets the image inside its space.
    • The border is a 0.75 pt stroke.
    • Side by side draws the screenshot and description as two columns, top-aligned and kept on one page; a page break, if needed, comes before both.
  • Word:
    • Alignment uses paragraph justification.
    • The border is the picture's outline (a:ln), so it can still be edited in Word.
    • Side by side is a borderless two-column table that doesn't split across pages.
  • HTML:
    • Alignment uses .shot img margins.
    • The border option sets the color of the light border HTML already draws.
    • Side by side wraps the step in .step-split, a CSS grid that goes back to one column under 720 px.
    • All of this CSS is only added when the profile uses it.
  • Side-by-side rules (all three formats):
    • Callouts keep their place: one placed after the description sits under it in the right column, and one placed before the image sits above the screenshot in the left column.
    • Steps without a description or a screenshot stay stacked.
  • AI agents: brand profile tools can read and set screenshots (align, border, border_color, layout), with values validated.
  • Translations for every new string in fr, es, ru, zh-CN and ja; the Branding support table mentions the new options.
  • docs/BRANDING.md has a new Screenshots section.

Area

  • Exports
  • Branding
  • AI and AI agents (MCP)
  • Translations
  • Documentation
  • Tests

Testing

  • bash tests/run_test.sh passes

  • Tested manually (describe below)

  • npm test: 1511 pass, 0 fail. The new tests/unit/branding-screenshots.test.js covers:

    • normalizing the options, and that a profile using the defaults exports the same PDF as one that doesn't set them
    • PDF: image x for left, center and right; border stroke color and position; side-by-side column positions and top alignment
    • Word: jc, a:ln, and the borderless two-column table
    • HTML: the CSS and .step-split markup in simple and rich exports
    • the agent tools
  • npm run translations: 1880 of 1880 in every language.

  • Manual, WSL/Linux:

    • Exported a three-step guide (wide, narrow and wide screenshots) with no options, Center + border, and Side by side + border.
    • Rendered the PDFs with poppler.
    • Converted the Word files to PDF with LibreOffice and checked them.
    • Opened the HTML in Electron.
    • Opened the Branding editor in the running app.
  • Not checked: Word itself (only LibreOffice), and Windows.

Screenshots or recordings

Settings → Branding → Edit brand profile → Screenshots

Screenshots card

PDF, Center + border: before (left) and after (right). A tall screenshot is narrower than the page.

PDF alignment

PDF, Side by side

PDF side by side

Word, Center + border (rendered with LibreOffice)

Word centered

Word, Side by side

Word side by side

HTML, Center + border and Side by side

HTML centered HTML side by side

Rollout notes

None. No migration: existing profiles read the new options as their defaults.

Conflicts with #288 (export translations + annotation fonts): both change exporters/pdf.js, exporters/docx.js, exporters/html.js, app/renderer/branding.js and the locale files. When resolving:

Checklist

  • Linked to an issue above
  • Scope is limited to that issue
  • New behavior has tests that check real output
  • Docs updated for anything users will notice
  • New interface text is in t(), and npm run translations lists nothing missing
  • Anything that still needs manual verification is listed above
  • No new network calls, dependencies, or third-party branding

A brand profile's new Screenshots card sets, for PDF, Word and HTML
exports (and GitHub Pages):

- Alignment: left, center or right for screenshots and flowcharts
  narrower than the page.
- Border around screenshots, in a chosen color.
- Step layout: stacked, or side by side with the screenshot on the left
  and the description on the right. Steps without a description stay
  stacked; HTML goes back to one column on narrow screens.

Everything defaults to what exports did before. AI agents can read and
set the options through the brand profile tools.
@Twest2

Twest2 commented Nov 9, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-09T17:47:19.193144Z 6d40dba Manual request
ℹ️ 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 chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6d40dba788

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread exporters/html.js Outdated
Comment on lines +160 to +162
parts.push(blocks(groups.beforeDescription), blocks(groups.beforeImage));
parts.push(`<div class="step-split">${figure}${desc}</div>`);
parts.push(blocks(groups.afterDescription), blocks(groups.afterImage));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep after-description callouts above the split columns

When a step has a screenshot, a description, and a callout positioned after-description, enabling side-by-side layout moves that callout below the screenshot instead of above both columns. stepContentGroups() puts these callouts between the description and screenshot in stacked layout, so they fall under the documented rule that intervening callouts come first. The same ordering occurs in the PDF and Word side-by-side branches. Emit afterDescription before the split layout, alongside beforeImage, to preserve that rule and avoid placing instructions or warnings after the visual they precede.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in 4b7b81f. I didn't move them above both columns; callouts now keep their stacked-order neighbors in all three formats: one placed after the description sits under the description in the right column, and one placed before the image sits above the screenshot in the left column (callouts before the description stay above both columns, after the image below). New tests check the order in PDF, Word and HTML.

Comment thread exporters/html.js Outdated
Comment on lines +380 to +381
if (align === 'center') rules.push('.shot img { margin-left: auto; margin-right: auto; }');
if (align === 'right') rules.push('.shot img { margin-left: auto; margin-right: 0; }');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Align linked flowchart wrappers as well as images

For a flowchart containing a valid step link, chartLinks() wraps the image in .chart-links, whose existing CSS uses display: inline-block. That wrapper shrink-wraps the image and stays left-aligned in the figure; auto margins on the image inside it cannot move the wrapper. Consequently, Center and Right have no effect on linked flowcharts narrower than the page in either HTML export, despite the new alignment setting explicitly supporting flowcharts. Apply alignment to the wrapper while keeping the image and its link overlays together.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Fixed in 4b7b81f: Center and Right now also set text-align on .shot, which moves the inline-block .chart-links wrapper (image and link overlays together); plain images still use the auto margins. Checked in Electron with a linked flowchart: left 268–908, center 342–982, right 416–1056 inside a 268–1056 figure.

…charts

Side by side moved a callout placed after the description below the
screenshot. Callouts now stay where the stacked layout has them: one
placed before the image sits above the screenshot in the left column, one
placed after the description sits under it in the right column (PDF,
Word, HTML).

Center and Right didn't move a flowchart with step links in HTML: its
inline-block link wrapper ignored the image's margins. The figure's
text-align now moves the wrapper too.
@Twest2
Twest2 merged commit 21bd985 into main Nov 9, 2026
10 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.

1 participant