Skip to content

editor & core: comment HUD/popover/follow-up capture & duplicate floor slab findings - #1354

Open
AxiomeCG wants to merge 17 commits into
pascalorg:mainfrom
AxiomeCG:fix/pro-feedback-and-zone-comments
Open

AxiomeCG wants to merge 17 commits into
pascalorg:mainfrom
AxiomeCG:fix/pro-feedback-and-zone-comments

Conversation

@AxiomeCG

@AxiomeCG AxiomeCG commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Combines Comment HUD shortcut alignment, Comment (point-ask) pin hover & follow-up target capture improvements, duplicate room-floor slab reporting, and exterior wall underpinning z-fighting ownership:

  • Comment Helper HUD shortcut inversion (packages/editor/src/components/ui/helpers/helper-manager.tsx, helper-manager.test.tsx):
    • When composing a spatial comment (noteComposer: true), binds Enter to Ask Architect (Start an AI thread here) as the primary row and Cmd/Ctrl + Enter to Save comment (Pin without asking Architect) as the secondary row.
  • Styled pin hover popover, fresh follow-up capture & hidden-tab guard (packages/editor/src/components/point-ask/*, lib/point-ask/*, index.tsx):
    • Replaces native browser title tooltips on scene pins with a styled hover/focus popover showing location/status summary and clamped comment preview (aria-label retained; open comment cards suppress the preview).
    • Exports captureCommentTarget and adds hidden-tab / timeout cleanup guards in session.ts and capture-crop.ts so follow-up replies can refresh their target view without stalling in background tabs.
  • Duplicate room floor slab findings (packages/core/src/agent-operations/author-scene.ts, create-room.ts, room-findings.ts):
    • Reports duplicate room floor slabs during room/scene authoring and verification (author_scene, create_room, room-findings).
  • Exterior wall underpinning coplanar z-fighting fix (packages/core/src/lib/plate-surface.ts, packages/nodes/src/slab/{dependency-tracker,geometry,surface-split}.ts, slab/__tests__/plate-render.test.ts):
    • Gives exterior wall underpinning (rim + stem) ownership over the coplanar floorplate edge and solid foundation skirt at shared perimeter faces, and invalidates dependent slab geometry when wall signatures change.

How to test

  1. Run the verification suite in editor:
    git diff --name-only upstream/main...HEAD | xargs bun x biome check
    bun run i18n:check
    bunx turbo run check-types --filter=@pascal-app/core --filter=@pascal-app/nodes --filter=@pascal-app/editor
    bunx turbo run build --filter=@pascal-app/nodes
    bun test \
      packages/nodes/src/slab \
      packages/core/src/lib/plate-surface.test.ts \
      packages/core/src/lib/point-ask.test.ts \
      packages/core/src/lib/plate-recovery.test.ts \
      packages/core/src/lib/plate-riser-ownership.test.ts \
      packages/core/src/lib/plate-step.test.ts \
      packages/core/src/lib/plate-reference.test.ts \
      packages/core/src/lib/floor-plate-support.test.ts \
      packages/editor/src/components/ui/helpers/helper-manager.test.tsx \
      packages/editor/src/lib/point-ask/ask-flow.test.ts \
      packages/core/src/agent-operations/author-scene.test.ts \
      packages/core/src/agent-operations/room-findings.test.ts
  2. Expected results (observed on 9d0e20a84):
    • biome check passes on changed files (Checked 16 files in 70ms. No fixes applied.).
    • i18n:check reports PASS sync: Catalogs are in sync with extract output..
    • turbo run check-types passes (9/9 tasks, exit 0).
    • Targeted bun test suite passes (322 pass, 0 fail, 3175 expect() calls across 32 files).
  3. In the hosted editor with pointAsk.noteComposer enabled, open the Comment tool (C), place a pin, and confirm the bottom-right HUD displays Enter → Ask Architect and Cmd/Ctrl + Enter → Save comment, while hovering saved pins renders the styled popover.

Screenshots / screen recording

Verified live in Chromium against the companion pascalorg/private-editor#1815 build (pointAsk={{ noteComposer: true }}, viewport 1280×720):

  • Before (origin/main): Comment Helper HUD showed Enter → Save comment / ⌘ + Enter → Ask Architect, and hovering an unsent saved pin displayed "Pascal is on it".
  • After (#1354 + #1815): Comment Helper HUD displays Enter → Ask Architect (Start an AI thread here) above ⌘ + Enter → Save comment (Pin without asking Architect); hovering the pin displays .pa-pin-preview with accurate location/status summary (Corner window · Open) in .pa-pin-summary and the comment preview.
  • Porch/Wall Underpinning Z-Fighting (foundation-render.mjs --verify real WebGL probe):
    • Before (main d6196b5bb): 3 coplanar faces at z = -0.10 m (5 471 / 9 443 px flicker, 2 coplanar owners).
    • Intermediate (b3d9b7c49): duplicate whole-house slab removed, underpinning vs floorplate edge/skirt still flickered (24 343 / 27 550 px).
    • After (9d0e20a84): single wall owner on edge (["wall"]) and skirt (["wall"]), 17 / 16 px out of 90 558 samples (0.019% at 0.08 mm seam).
  • Comparative PNGs generated locally (pr1354-editor-before-after.png, pr1354-zfight-before-after.png); pending drag-and-drop upload in GitHub web UI (gh CLI has no user-attachments upload API).

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

Note

Medium Risk
Touches scene verification, plate mesh classification, and comment capture paths that affect authoring feedback and visible geometry at wall–slab junctions.

Overview
Adds duplicate floor-slab detection (slab_floor_overlap, room_floor_replaced) in room-findings and surfaces it through verify_scene, author_scene, and create_room, with repair hints pointing at set_room_floor_construction.

Comment / point-ask UX: in the note composer, Enter → Ask Architect and Cmd/Ctrl+Enter → Save comment; persistent pins get a styled hover preview instead of native title tooltips. captureCommentTarget re-crops pinned regions when the anchor or footprint is partially off-screen, with a background-tab refusal in 3D capture.

Rendering: exterior walls with underpinning own the coplanar plate edge and foundation skirt; slab geometry clips those spans, plate side classification tracks underpinning, and dependency signatures invalidate when wall rim/stem changes. exposedIntervals tolerates near-parallel cut edges from quantized booleans.

Also exports roomFloorPlate, captureCommentTarget, and registry helper nodeReferencesTarget for slab reference checks.

Reviewed by Cursor Bugbot for commit 313a960. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor 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.

Stale Bugbot comment from a previous run.

… and populate standalone pin preview summary

@cursor cursor 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.

Stale Bugbot comment from a previous run.

@cursor cursor 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.

Stale Bugbot comment from a previous run.

@cursor cursor 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.

Stale Bugbot comment from a previous run.

Comment thread packages/core/src/lib/plate-surface.ts Resolved

@cursor cursor 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.

Stale Bugbot comment from a previous run.

@cursor cursor 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.

Stale Bugbot comment from a previous run.

@cursor cursor 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.

Stale Bugbot comment from a previous run.

@Aymericr Aymericr added the bot:bugs label Dec 4, 2026 — with Cursor

@Aymericr Aymericr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[Maintainer] Thanks, and the z-fighting probe numbers in the description are really helpful. I reviewed 533a4392ffc9806648f6cfe0634b1fe0d230214c with Codex (gpt-6.2-astra) in two rounds (full review, then each finding re-traced through the code). GitHub CI is green at this head, and I'm running a local replica of the CI on a merge with current main as a cross-check. I found no P0/P1. These four P2s survived verification and are real behavior regressions, so I'd like them fixed before merge. I've labelled it bot:bugs (next owner).

  1. packages/core/src/lib/plate-surface.ts:852 — See-through strip in Cutaway / Walls Down. The plate now drops the slab edge wherever the wall underpinning (rim + stem) owns the face. The viewer merges rim and stem into the wall mesh and makes the whole mesh transparent when walls are hidden (viewer/src/systems/wall/wall-materials.ts:408, :533), with no opaque exception below the base. The floor loses its solid edge there. Fix: keep the below-base rim and stem opaque when hiding the wall body, or draw the slab edge when the stem is hidden. Test both modes, and don't reintroduce overlapping faces in Walls Up.
  2. packages/core/src/agent-operations/room-findings.ts:127 (and :287) — False slab_floor_overlap / room_floor_replaced findings. The checks use stored polygons and holes, not rendered footprints. Slab geometry adds hosted cutter holes first (nodes/src/slab/geometry.ts:337). A coplanar slab fully inside another slab's hosted opening is reported as overlapping, and verify_scene advises trimming valid geometry. Fix: use resolveGroundSlab for both checks, with a regression test for each.
  3. packages/editor/src/lib/point-ask/session.ts:955 — Off-screen footprint can produce a crop of unrelated pixels. The code intersects the pane with the footprint's bounding box, not the footprint. A diamond projected wholly off the pane corner can still yield a positive crop. Fix: clip the footprint polygon to the frustum and pane before taking bounds. If it is empty, use an in-pane anchor or reject. Test the diagonal miss.
  4. packages/editor/src/lib/point-ask/session.ts:985 — Busy retry can capture a different object. captureViewCrop retries after 1.5 s with the original screenRect (capture-crop.ts:102) while the snapshot uses the camera from the successful attempt. Panning on the same level during the wait returns new pixels with the original targets. Fix: reproject per attempt and take the rectangle and camera from the successful attempt, or reject if camera or pane changed. Test a busy response followed by a pan.

Also needed

  • The description says the before/after PNGs are "pending drag-and-drop upload". Please attach them (and a short clip of the Enter / Cmd+Enter HUD swap and the pin hover popover) to the PR. They are what lets us judge the visible changes.
  • This PR bundles four independent changes (comment HUD, pin popover/capture, duplicate-slab findings, wall-underpinning z-fighting). Splitting the z-fighting fix out would make it easy to land on its own once P2 #1 is fixed, and it keeps the other three reviewable. Not a blocker, but it would speed things up.
  • The companion private PR (#1815) is referenced in the description, but I can't see it from here; the maintainers will handle the bump after merge.

Once the four items are in and CI is green at the new head, I'll re-review and approve. I'm not pushing to your fork.

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 313a960. Configure here.

Comment thread packages/core/src/lib/plate-surface.ts Resolved

@Aymericr Aymericr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

[Maintainer] Re-reviewed at 313a9602ddc5281b15c86c86c34a7d20f93af4a4 with Codex (gpt-6.2-astra) in two rounds. The second round re-traced every finding and reproduced it with in-memory probes on the merged tree. GitHub CI is green and the branch has no conflicts. My local CI replica on a merge with current main passes everything, and 154 tests pass across the six changed test files.

What changed since my review at 533a4392. The only non-merge commit is the CI retrigger. The rest is a merge of main, including the slab move into plain-geometry.ts. The four P2s from my last review are therefore all still present; the merge didn't touch the behavior behind any of them. I reproduced each one again.

P1 — Bugbot's High is real in this repo. Pascal's rule was that a hint showing a key this repo doesn't bind is real. With noteComposer: true the HUD says Cmd/Ctrl+Enter is "Save comment — Pin without asking Architect" (helper-manager.tsx:386). Nothing in this repo binds that:

  • bubble.tsx:500 submits on any Enter without Shift. I ran the real handler: Enter, Cmd+Enter and Ctrl+Enter each call send() once. That plants a pin and calls submitPointAsk (session.ts:1677), so the "save" shortcut asks Architect.
  • noteComposer only selects the HUD rows (helper-manager.tsx:608). The editor's two PointAskLayer mounts pass only enrichedRegions and freeClick, and PointAskBubble still renders (point-ask-layer.tsx:86). No composer-replacement slot or takeover signal exists. A host that supplies its own composer is outside this repo, so the "cross-repo false positive" claim doesn't hold: the repo ships a hint for a key it doesn't bind.
  • For fairness: on main before this PR the same flag showed Enter = Save and Cmd/Ctrl+Enter = Ask, which wasn't bound here either. The PR moves the false promise from Enter to Cmd/Ctrl+Enter; it didn't create it.

Fix: drop the save-only row unless a distinct save action is registered. If you register one, route Cmd/Ctrl+Enter to it and add a test that the ask handler gets zero calls. Alternatively, have the HUD hints come from the host-registered composer's actual bindings.

P2 — the four from my last review, still present

  1. plate-surface.ts:852, slab/surface-split.ts:467: see-through strip in Cutaway / Walls Down. Rim and stem belong to the wall mesh, which turns transparent in those modes (wall-materials.ts:564, wall-cutout-cache.ts:487), and the slab edge is removed beneath it. A raycast probe confirmed that nothing is drawn across the underpinned span, and the hidden palette is at most 0.24 opaque. Fix: keep the wall-owned rim/stem opaque in hidden-wall modes, or restore the slab strip there.
  2. room-findings.ts:127, :287: false floor findings. The checks use stored polygons and holes, not hosted-cutter-resolved footprints (lib/ground-read.ts:50, resolveGroundSlab). A 1 m² slab wholly inside a 2×2 m hosted opening reports 1 m² of overlap, and a floor-disabled room inside the opening is reported as floored by the host. Fix: use resolveGroundSlab for both, with a regression test each.
  3. point-ask/session.ts:949-955: off-screen footprint captures unrelated pixels. The corners' X and Y extrema are clamped independently, so a rotated footprint wholly beyond a pane corner still yields a positive crop (I got a top-left crop for corners all with x+y < 0). Fix: clip the projected polygon to the pane, then take bounds. Test the diagonal miss.
  4. capture-crop.ts:102, session.ts:980: busy retry can capture the wrong object. The retry reuses the original screen rectangle, and only the level is rechecked, not the camera. After a same-level pan my probe kept the pre-pan crop and the old targets. Fix: reproject for the retry, or reject the capture if the view changed.

P2 — conditional (Bugbot's "underpinning clip height"): plate-surface.ts:746 clips to a fixed bottom (elevation − rim − stem), but the wall can extend its stem lower to terrain (wall-geometry.ts:761). With the slab edge 0.1 mm inside the face tolerance I got both the extended wall and the retained slab skirt at y = 0.015 m. It doesn't happen on every fillToTerrain wall. Please clip against the same terrain-aware stem-bottom profile.

P3: pins.tsx:647 — when label and comment differ, the preview is aria-hidden and the button is named only by pin.label. Expose the comment body as the accessible description.

Addressed since my review (verified): the pin popover now shows the label and comment (pins.tsx:648, with tests); a usable footprint rectangle now wins over an off-screen anchor (session.ts:965); the hidden-tab test restores document.hidden; and the level is checked before and after capture.

Still needed: attach the before/after PNGs and a short clip of the HUD (they were "pending upload" in the description). Splitting the z-fighting fix into its own PR would let it land separately once P2 #1 is done.

The P1 and the two geometry P2s (cutaway strip, false floor findings) are what I'd want before approving. I'm not pushing to your fork.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants