Skip to content

fix: prevent hotspot move on double-click and open edit modal#9

Merged
trmquang93 merged 1 commit into
mainfrom
fix/hotspot-double-click-behavior
Mar 17, 2026
Merged

fix: prevent hotspot move on double-click and open edit modal#9
trmquang93 merged 1 commit into
mainfrom
fix/hotspot-double-click-behavior

Conversation

@trmquang93

Copy link
Copy Markdown
Collaborator

Summary

  • Add a 5px drag threshold ("reposition-pending" state) to prevent accidental hotspot repositioning during double-click/double-tap
  • Double-clicking a hotspot now opens the HotspotModal edit dialog
  • Add ESC key support to close HotspotModal

Test plan

  • Single-click an unselected hotspot — should show purple highlight (selected)
  • Double-click a hotspot — should open the edit modal, hotspot should NOT move
  • Click a selected hotspot and drag beyond 5px — should reposition normally
  • Click a selected hotspot and release without dragging — should stay selected, no movement
  • Press ESC while HotspotModal is open — should close the modal
  • All existing tests pass (npm test — 233 tests)

Add drag threshold to hotspot reposition to prevent accidental moves
during double-click. Introduce "reposition-pending" intermediate state
that requires 5px mouse movement before committing to a drag.

Double-clicking a hotspot now opens the HotspotModal for editing.
Add ESC key support to close HotspotModal.
@vercel

vercel Bot commented Mar 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flow-forge Ready Ready Preview, Comment Mar 17, 2026 4:11pm

@trmquang93 trmquang93 merged commit 9393ec1 into main Mar 17, 2026
3 checks passed
@github-actions github-actions Bot deleted the fix/hotspot-double-click-behavior branch March 17, 2026 16:12
trmquang93 added a commit that referenced this pull request May 16, 2026
#52)

When find_stock_image falls back to Picsum (no UNSPLASH_ACCESS_KEY),
the response now includes structured fields that agents can't miss:

  { source: "picsum",
    warning: "RANDOM photos — Picsum ignores your query (\"...\"). ..." }

Picsum also now returns a single deterministic placeholder instead of
multiple pseudo-results that mislead agents into thinking they are
distinct query matches.

Co-authored-by: Quang Tran <16215255+trmquang93@users.noreply.github.com>
trmquang93 added a commit that referenced this pull request May 16, 2026
Add a new MCP tool that parses stored screen HTML across the flow
and returns dominant design tokens (colors, typography, radii, spacing)
ranked by per-screen frequency. Supports scopeRoot / screenIds filtering.

Co-authored-by: Quang Tran <16215255+trmquang93@users.noreply.github.com>
trmquang93 added a commit that referenced this pull request May 16, 2026
#54)

Multi-word queries (e.g. "crown premium") are now automatically split
into terms, searched independently, and merged by overlap count then
best individual rank. When no results match any term, the response
includes suggestions[] with the individual keywords. Tool description
updated to clarify single-keyword semantics as a safety net.

Co-authored-by: Quang Tran <16215255+trmquang93@users.noreply.github.com>
trmquang93 added a commit that referenced this pull request May 17, 2026
Co-authored-by: Quang Tran <16215255+trmquang93@users.noreply.github.com>
trmquang93 added a commit that referenced this pull request May 17, 2026
Add 5 compose_* MCP tools that return Satori-compatible HTML fragments:
- compose_page — safe-area-aware page wrapper
- compose_button — primary/secondary/destructive variants with icon support
- compose_list_row — standard list row with chevron
- compose_section_header — uppercase title + optional action
- compose_card — rounded card with title/body/footer

Fragments are composable (nest button in card in page) and every output
is Satori-clean by construction (display:flex everywhere, no
position:absolute, white-space:nowrap on text leaves).

Optional inline:false mode stores fragments server-side and returns
lightweight <x-block id="..."/> references that the renderer expands
at draw time, cutting per-screen token cost.

Design tokens (colors, radius, font) customizable via tokens parameter.

Co-authored-by: Quang Tran <16215255+trmquang93@users.noreply.github.com>
trmquang93 added a commit that referenced this pull request May 17, 2026
Add a new stateless `validate_html` MCP tool that checks HTML/CSS against
Satori's rendering constraints without rasterizing. Returns structured
warnings (path + rule + message) in milliseconds, letting agents catch
layout bugs before the slow render step.

Rules: unsupported-position, no-style-block, multi-child-needs-flex,
no-br-tag, text-needs-nowrap, unsupported-css-property.

Co-authored-by: Quang Tran <16215255+trmquang93@users.noreply.github.com>
trmquang93 added a commit that referenced this pull request May 17, 2026
* feat: render response — accurate dimensions, warnings, optional thumbnail (#8.5 #9.2 #9.3)

Three related improvements to the MCP render-response shape, shipped
together because they all touch the same response builder:

- 8.5: imageWidth/imageHeight now report actual decoded PNG dimensions
  (read from IHDR) instead of display-scaled values. The editor state
  still stores display-scaled heights for canvas card sizing.

- 9.2: warnings[] array surfaces silent degradations — allowlist
  rejects, fetch timeouts, empty responses, and chrome composition
  failures. Absent when all resources resolved cleanly.

- 9.3: Optional includeThumbnail (200px-wide PNG) and includeFullImage
  (full-res PNG base64) parameters on all render-producing tools.
  Both default to false to keep token cost predictable.

Affected tools: create_screen, update_screen_image, batch_create_screens,
compose_chrome.

* feat: create_screen_with_hotspots transactional group op (#9.9)

---------

Co-authored-by: Quang Tran <16215255+trmquang93@users.noreply.github.com>
trmquang93 added a commit that referenced this pull request May 17, 2026
…nail (#8.5 #9.2 #9.3) (#58)

Three related improvements to the MCP render-response shape, shipped
together because they all touch the same response builder:

- 8.5: imageWidth/imageHeight now report actual decoded PNG dimensions
  (read from IHDR) instead of display-scaled values. The editor state
  still stores display-scaled heights for canvas card sizing.

- 9.2: warnings[] array surfaces silent degradations — allowlist
  rejects, fetch timeouts, empty responses, and chrome composition
  failures. Absent when all resources resolved cleanly.

- 9.3: Optional includeThumbnail (200px-wide PNG) and includeFullImage
  (full-res PNG base64) parameters on all render-producing tools.
  Both default to false to keep token cost predictable.

Affected tools: create_screen, update_screen_image, batch_create_screens,
compose_chrome.

Co-authored-by: Quang Tran <16215255+trmquang93@users.noreply.github.com>
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