Repository navigation
feat(tool-chest): save and reuse measurement presets in tool sets (#311) - #779
Open
oscar981-op wants to merge 1 commit into
Open
oscar981-op wants to merge 1 commit into
oscar981-op wants to merge 1 commit into
Conversation
…enAEC-Foundation#311) Right-click a measurement (or line, arrow, polyline, polygon, rectangle, ellipse, cloud, filled area, wall) and choose "Save to Tool Chest": every property except the drawn geometry, the measured result and the per- annotation identity is stored as an item - layer (by name), colours, line width, label/name, unit, precision, depth, hatch, line ends, dimension type. - New "Tool Chest" tab in the left sidebar: tool sets with items; create, rename (F2/double-click), delete, move items (drag or "Move to..."), export a tool set to a .opdstools file and import one. Importing a name that already exists asks: rename, overwrite or keep both. - Clicking an item deselects (never changes) the current selection, starts the item's tool and overlays the item's style on the tool preferences for preview and drawing; the next annotation gets the remaining properties via a recordAdd hook (unit converted with the same real length, missing layer created). The overlay is never persisted and ends on any tool change. - Deleting an item leaves placed annotations untouched (values are copied). - Chest persisted in the app data (own file on desktop, browser storage on the web), so it survives restarts and a preferences reset. - Exchange file is validated: format/version, item shape, size limits; geometry, ids and prototype keys are stripped, unknown types skipped. - Measurements get a depth field (surface/volume shown in the properties panel), saved in the PDF as OPS_Depth. - setAsDefaultStyle's preference writer moved to core/style-prefs.js and shared with the Tool Chest overlay. - Translations for all 40 locales; unit tests for capture, apply, session overlay, tool set CRUD, export/import round trip, malformed files and persistence. 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.
Fixes #311.
Approach
Builds on the existing tool-default preferences instead of adding a second style system. The body of
setAsDefaultStylemoved tojs/core/style-prefs.jsand is shared by both..opdstoolsand import one.recordAddhook, so undo stays complete.opds-tool-chest), browser storage on web. It survives a preferences reset.measureDepthfor distance, perimeter and area, with a computed surface or volume. Saved asOPS_Depthand loaded back.Tests
tool-chest.test.mjs,tool-chest-wiring.test.mjs,measure-depth.test.mjs,toolChestStore.test.mjs. They cover capture without geometry, applying a preset, tool set CRUD and rename, export/import round-trip and rejecting malformed files, and persistence.plattegrond-meta.test.mjs.vite buildandtscare clean.Not yet checked in the running app
.opdstoolsread/write.🤖 Generated with Claude Code