Repository navigation
pallets: steadier docking and floating, and a much faster Blocks palette - #2074
Merged
Merged
Conversation
…keep the drawing still - A floating pallet's vertical title bar now keeps its side (saved in the layout). It starts on the side the pallet was docked on and only moves when a drag brings the frame against the docked pallets of an edge, when the drop preview shows on an edge without docked pallets, or, with docking off, against the screen edge. - The corner resize grip is gone: every side and corner of a floating pallet resizes it (top and bottom only while it is hidden to its bar). - The drawing stays put on screen when pallets dock or undock, an edge switches to auto-hide, or a docked group is resized: the view pans by however far the viewport's centre moved. A revealed auto-hide group now draws over the drawing instead of squeezing it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Li8vASn3zodEpXndUDTgyM
…n edge While dragging a floating pallet, its title bar now also moves to a side as soon as the frame reaches that edge of the screen, not only once the pointer shows the drop preview there. The floating drop ghost now shows the title bar on the side it will land on, so the flip is visible mid-drag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Li8vASn3zodEpXndUDTgyM
Dragging a pallet that already floats now moves the pallet itself instead of a ghost: it draws where it would land, with its title bar on the side it would land on, and hides while a dock zone shows its preview. A layer over everything takes the pointer during the drag, so the moving window doesn't react to it and the cursor stays a closed hand. A pallet dragged out of a dock still shows the ghost. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Li8vASn3zodEpXndUDTgyM
…sizes - A pallet dragged out of a dock to float shows the plain drop ghost again: its title along the top, no vertical title bar. - The viewport's new size is set as soon as the docked edges or the window change, instead of only once layout measures it after the overlays were built. The ViewCube's controls, the UCS picker and icon, the grid and the crosshair no longer trail the drawing by a frame while a docked pallet or the window is resized. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Li8vASn3zodEpXndUDTgyM
Dragging any pallet redraws the window on every pointer move. With a large Block palette open each frame redrew every visible thumbnail from scratch and looked each block up by name with a linear scan, several times per card. - Thumbnails draw through a canvas cache kept with the block's preview, so they are only tessellated again when their size changes or the palette refreshes. - Block names are looked up through an index built when the list is set. - The previews kept for Recent / Favorites share the Current Drawing ones instead of copying every block's wires on each refresh. With 500 blocks this takes about 30 ms off each frame. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Li8vASn3zodEpXndUDTgyM
- Clicking a block rebuilt every block's preview first, even for a block already in the drawing: that took about a second before the card turned blue with many blocks. The palette now only rebuilds when the click had to import or redefine the block. Switching tabs and opening the ribbon's block gallery rebuild only when the drawing's blocks changed, and adding a favorite only reads the drawing thumbnail it may need. - The icon views build only the rows in view (plus two spare at each end), with spaces of the same height for the rest, so the list keeps its height and scroll position. With 500 blocks this takes building the palette from about 9 ms to under 1 ms per frame. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Li8vASn3zodEpXndUDTgyM
Saving or defining a block changes the drawing's block marker, and the palette then rebuilt the preview of every block. A message that saves a block now tells the palette which blocks it changed: the refresh after it redraws those and the blocks holding them (directly or nested) and keeps the other previews with their drawn thumbnails. - Block Editor save: the edited block plus whatever the save itself rewrote (a dynamic block's references), found by comparing definitions. - Block Editor Save As: the definitions that differ from before. - BLOCK and the Block Editor's block properties: that block. The hint only counts when the palette was up to date before the change and lives for the message that made it; every other change still rebuilds all. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Li8vASn3zodEpXndUDTgyM
…ackground - A refresh no longer works out every block's preview. Previews are made once the palette is about to show them: the rows in view of the icon views (the first screenful before the list reports its viewport), every row of Small Icons and Details, none for List. The ribbon gallery, which shows every block, makes all of them when it opens; placing a block and the drawing's blocks in Recent / Favorites make theirs right away. - Drawing thumbnails for library folders and for Recent / Favorites are read on a background thread, a few at a time, instead of on the UI thread: a library folder lists at once and its thumbnails appear as they are read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Li8vASn3zodEpXndUDTgyM
…d List too Their rows weren't all equally tall: Details and List names wrapped when long or in a narrow pallet. Names in these views now stay on one line and are cut with "…" where they run out of room, every row (and the Details header) is a fixed 16 px, and all six views share one layout, so these views also build only the rows in view and work out only the previews shown. List rows are about 1.7 px taller, as tall as Details rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Li8vASn3zodEpXndUDTgyM
- Finding the blocks a save changed, and the blocks holding them, skips model space, paper space and layouts: their contents are the drawing itself, which was compared or scanned on every block save. - The palette only works out which previews are shown when the scroll position, view, tab, filter, Recent / Favorites or the blocks changed, instead of after every message. - The room the docked edges take looks the shown group up once per edge. - BlockPreview::new was only used by a test, which now uses pending(). - Two comments now mention that dock and window changes also set the viewport's size. - blockpalette_refresh_shares_previews_and_makes_new_ones is folded into blockpalette_refresh_keeps_previews_of_blocks_a_change_did_not_touch: its other checks were already covered elsewhere. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Li8vASn3zodEpXndUDTgyM
Brings pallet-fixes up to date with HakanSeven12/OpenCADStudio main. The only conflict was in src/app/block_editor_tests.rs, where both sides added tests at the same place; both are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Li8vASn3zodEpXndUDTgyM
Clippy's field_reassign_with_default flagged the view test setting `view` right after `Default::default()`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Li8vASn3zodEpXndUDTgyM
HakanSeven12
added a commit
that referenced
this pull request
Oct 23, 2026
#2074 builds previews only for rows on screen, so a block noted in Recent or Favorites from an off-screen row showed an empty box in other drawings, and an unbuilt kept preview hid the fallback to this drawing's block. Build the preview when the entry is noted, fall back when it is unbuilt, and clear the block change hint also when a message returns early. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HakanSeven12
added a commit
that referenced
this pull request
Oct 23, 2026
The dock tests serialized their headless renderers among themselves, but #2074's block palette test builds one too, and two made in parallel crash the test process. Share one crate-wide lock. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes docked and floating pallets steadier (the title bar keeps its side, every edge resizes, and the drawing no longer jumps), and makes the Blocks palette fast with many blocks.
Floating pallets (
src/ui/dock.rs,src/app/dock)resize_left.svgicon are gone.Drawing stays in place (
dock_keep_view)Blocks palette (
src/ui/window/block_palette.rs,src/app/update/blocks_palette.rs)Testing
cargo test --lib: 3,013 passed, 0 failed, 31 ignored, with upstreammainmerged in.cargo clippy --lib --testsshows no warnings in the new code.