Repository navigation
feat(studio): drag items in the preview, snapping to the canvas, items, spacing, and a grid - #15
Conversation
Quest-Claim: 02b6deb84ba67f9c
…s, spacing, and a grid Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # rs/moq-studio/src/ui.rs
…ont, and the release frame lands Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. CodeRabbit Verify
|
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: a3be27d
Skip hidden items in the selected resize hit test (rs/moq-studio/src/ui.rs:529–532). Select an item, hide it with Shown, then drag a visible item where it crosses the hidden item's former edge. Grab::at wins before the visibility-filtered search, so the hidden item is resized instead; its selection outline is also still painted. Make preview selection and handles respect visibility, or clear selection on hide, and cover the overlapping hidden/visible case.
The direct manipulation and snapping approach is otherwise a useful direction. Static GitHub review only; I did not run tests or an interactive session.
… item Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Re the OpenAI review on a3be27d: agreed, and fixed in 59b3b6b. The preview's hit test moved into the UI-free (Written by Claude Opus 5.5) |
# Conflicts: # rs/moq-studio/src/main.rs
kixelated
left a comment
There was a problem hiding this comment.
Automated review by review (OpenAI)
Reviewed commit: 59b3b6b
The previous hidden-item resize finding is fixed: hit testing now excludes hidden selections, the outline is suppressed, and the new overlapping-item test covers the reported case. No new actionable bugs found in this update.
Extracting the hit test into the existing geometry module is a straightforward approach. Static GitHub review only; I did not independently run tests or an interactive preview session.
Brings in effects (#17), preview dragging (#15), failover (#19), guests (#10), the docs move (#26), and outside edits (#24). - Compositor: main's effect pipeline replaces this branch's shader. A picture now carries whether its alpha is premultiplied, so a page drawn as an item, or read by a luminance mask, is unpremultiplied before its filters run. - Preview: with Interact on, the pointer goes to the pages and the preview does not arrange items; off, dragging arranges as on main. - Sources: the add form lists both Browser and LUT. - README: both sides' panels, kinds, and sections. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem
The preview was a picture only: items could be placed only by typing numbers in the Items panel, with nothing to line them up. The snapping quest asks for preview moves and resizes that snap to the canvas, other items, and a grid, with smart guides, equal-spacing hints, and a modifier that turns snapping off.
Approach
ui.rs,Panels::arrange), the gap the quest exposed: click an item of the layer the Items panel shows to select it, drag it to move, drag an edge or corner to resize. The selected item's edges are hit first, then the frontmost visible item; hidden items are never grabbed or outlined. Each frame drags from the rect and pointer at drag start, so snaps never accumulate.rs/moq-studio/src/snap.rs, no egui types, unit-tested):Grab::at(what a press holds),Grab::drag, andSnap::apply, which along each axis picks the nearest line within reach of a moving edge or center: canvas edges and center, other visible items' edges and centers (scene in preview plus top layer), grid lines, and, for moves, the spacing of neighboring pairs (centered between two, or repeating a pair's spacing). It returns guides for every line the item sits on and the equal gaps to mark. It lives in the studio, not moq-scene, per the quest Plan: snapping is a preview interaction.set_itemthroughState::commitwith the drag's gesture id, so a drag is one history entry and autosaves like any edit. Undo, redo, or reload mid-drag lets go of it.command) drags freely. Reach is 8 points on screen, converted to canvas pixels.Impact
README.mddocuments preview editing and snapping. No scene-file change.Alternatives
Choices made without asking
commandmaps it to Cmd on macOS).Follow-ups
Checks
just cipasses locally on an Apple Silicon Mac at 8e74d38, every feature set included (main's macOS capture fix landed in #14). The direnv hook test inside it ran too. The preview interaction was not exercised by hand in a running window; the geometry it relies on is unit-tested.Review
Codex (
quest review), gpt-6.1-sol, medium effort.drag_stoppedwithoutdragged) dropped the final pointer position: the drag now applies it, keeping the gesture id from drag start so it stays one undo step.snap::hit, which skips a hidden selected item, and only a visible selection is outlined.hits_the_selected_edges_then_the_frontcovers the overlapping hidden and visible case and fails without the fix.modline conflict inmain.rsby hand; the PR's added and removed lines are identical to 59b3b6b's, so the review exemption for merges that leave the diff unchanged covers it.🤖 Generated with Claude Code
(Written by Claude Opus 5.5)