Skip to content

Fix plain-text placement preview to match selected text size and zoom#178

Open
lklyne wants to merge 1 commit into
mainfrom
claude/issue-146
Open

Fix plain-text placement preview to match selected text size and zoom#178
lklyne wants to merge 1 commit into
mainfrom
claude/issue-146

Conversation

@lklyne
Copy link
Copy Markdown
Owner

@lklyne lklyne commented May 29, 2026

Closes #146

What changed

The ghost-text preview shown when hovering with the add-text tool was hardcoded to 12px and ignored canvas zoom. This fix makes the preview reflect both the configured text size and the current zoom level.

Changes

  • src/shared/types.ts — added optional textSize?: number field to PendingPlacement
  • src/main/runtime/canvas-layout-data.tsbuildPlacementPreview now reads getToolDefaults()['add-text'].textSize and includes it in the placement for add-text tools
  • src/renderer/canvas-bg/canvasBgSelectors.tsbuildPendingPlacementPreview passes textSize and zoom through to the preview object
  • src/renderer/canvas-bg/CanvasGridSurface.tsxPlacementPreviewLayer now computes scaledFontSize = textSize * zoom for the plain-text case instead of using the hardcoded text-[12px] Tailwind class

Acceptance criteria check

  • Preview renders at the currently selected text size (default 14px or user-configured)
  • Changing the text size updates the preview
  • Preview font scales with canvas zoom
  • Preview size and created text size agree across zoom levels and configured sizes
  • No regression to sticky-note, shape, or file placement previews (those code paths are unchanged)

Generated by Claude Code

The ghost-text preview shown when hovering with the add-text tool was
hardcoded to 12px and ignored canvas zoom. Now it reads the configured
text size from tool defaults and scales it by the canvas zoom level,
so the preview matches the text that will actually be created.

Closes #146

https://claude.ai/code/session_013KdAUApa9UExU6LhjCt6Vr
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.

Plain-text placement preview should match the selected text size and zoom

2 participants