Skip to content

Add full-resolution icon previews and zoom - #33

Merged
AlexBoliachiy merged 3 commits into
masterfrom
codex/icon-preview-zoom
Nov 16, 2026
Merged

AlexBoliachiy merged 3 commits into
masterfrom
codex/icon-preview-zoom

Conversation

@AlexBoliachiy

Copy link
Copy Markdown
Contributor

Adds a dedicated, resizable preview for inspecting full-resolution icons before refinement or export. Opening and closing it preserves the selected variant, prompt, and editing state.

Closes #31.

  • Each variant has its own Preview action; clicking the artwork continues to select it.
  • In refinement, clicking the selected icon opens the viewer without a separate Preview label. History details use the same viewer.
  • Fit, 100%, 25–400% zoom, pointer-anchored pinch, scroll/drag/keyboard panning, transparency, Escape, and focus restoration are supported.
  • MōBrowser's browser zoom API scales the artwork in its own BrowserView and origin, keeping the toolbar and editor at their normal size.
  • Pinch anchoring follows native layout changes, preserves the image point throughout a gesture, and allows enough space around the image to remain anchored when zooming out near an edge.

The interaction and browser API tradeoffs are documented in the README. Preview uses the prepared 1024 × 1024 PNG, including alpha, margins, and shadow.

Verification

  • Clean branch on current master: npm ci, npx --no-install tsc --noEmit, npm run dev:build, and npm run build pass using Node 22.23.4 and the committed MōBrowser 2.19.0 dependencies.
  • The complete preview workflow was verified in the local macOS development app: variants, selected icon, History, window resizing, keyboard navigation, focus restoration, and unchanged editing state.
  • node tests/icon-preview-zoom.mjs passes all four pointer-anchoring scenarios, including rapid pinch after panning and zooming out below Fit; measured drift stays below one screen pixel.
  • Interactive checks and screenshots use the local MōBrowser 2.20.0 development runtime. The user also confirmed the trackpad behavior manually. Windows and Linux interaction checks remain outstanding.

Screenshots

Captured from the running app and visually verified. Full-resolution PNGs are included under docs/screenshots/icon-preview/.

Variant selection with separate Preview actions

Three generated variants, with the second selected and a separate Preview action below each icon

Full-resolution preview at Fit

Resizable icon viewer at 59 percent Fit with zoom and transparency controls

Zoomed detail at 125%

Icon artwork enlarged to 125 percent while the preview toolbar stays at its normal size

Selected icon during refinement

Selected icon can be clicked to preview, without an additional Preview button beneath it

@AlexBoliachiy AlexBoliachiy self-assigned this Nov 16, 2026
@AlexBoliachiy
AlexBoliachiy marked this pull request as ready for review November 16, 2026 14:00
@AlexBoliachiy
AlexBoliachiy merged commit 6412c07 into master Nov 16, 2026
@AlexBoliachiy
AlexBoliachiy deleted the codex/icon-preview-zoom branch November 23, 2026 10:20
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.

Investigate and implement zoom for generated icons

2 participants