Mastercam stuff - #15
Merged
Merged
Conversation
A `.TOOLDB` is a SQLite database carrying Mastercam's own 79-table schema, and writing one is `@toolpath/tool-support/export/mastercam`, not this application. `app/shared/mastercam-input.ts` is the seam. It reads differently from the Fusion one on purpose. Fusion embeds a holder inside the tool record, so one tool in two holders is two records; Mastercam joins them relationally, so the order list goes in grouped — one entry per distinct tool carrying one set-up per stack, one entry per distinct holder, under the catalog's own guids. Six stacks sharing an ER32 chuck put one holder in the file rather than six. The one identifier this mints is the assembly's, per stack. An assembly's id is derived upstream from its tool and holder, which cannot tell apart the same tool in the same holder at two stickouts — those would collapse and the second stickout would be lost. A minted guid costs a re-export a fresh set of assemblies; the tools and holders under them keep their catalog guids. `app/shared/export-input.ts` is what both formats read, extracted from `fusion-input.ts` now that there is a second consumer. One dialog serves both, `library-export-dialog.tsx` — only four strings differ between the two — and `ExportReport.holderWarnings` is `warnings`, meaning the same quantity for each: rows of the order list that reached the file. The exporter is imported on the press rather than at the top of the route: it carries 82 KB of pinned schema, and `vite.config.ts` pre-bundles the subpath so that import is a fetch rather than a discovery. `tool-support` moves to 0.6.0, which is what carries the Mastercam exporter. That release also changed what a holder stating no gauge length means: the Fusion exporter `filled`s it with the height of the shape it wrote rather than `dropped`ing it, so it is no longer a warning. `fusion-input.test.ts` now pins a stated gauge length its own dimensions contradict, which still is one, and pins the silence on the case that stopped being.
`tool-support` 0.6.0 carries the Mastercam exporter, and `app-support` 0.1.6, `tool-drawing` 1.0.3 and `tool-scraper` 3.0.3 each depend on `^0.6.0`. A 0.x caret does not span a minor, so bumping `tool-support` alone left the older three asking for 0.4.0 and the install carried two copies — the same split `build: resolve the Toolpath packages onto one tool-support` closed before. `pnpm-lock.yaml` resolves one copy again, and the suite now runs against the published package rather than a local link.
The dialog says `aria-modal="true"`, which tells a screen reader the page behind it is inert, and nothing kept that promise: Tab walked straight onto the order list underneath while the reader still announced the dialog, and opening it left the focus on the button behind the overlay. The kit's `Dialog` is the component to reach for and does not fit — it is an alert whose `confirm()` resolves to a boolean and closes on the press, where this dialog reads a name back off an input and goes on showing a report afterwards; its `@base-ui/react` primitive is not a dependency here. So the focus is handled beside the markup it governs, and the component now says which kit component it turned down and why. The name takes the focus on open, Tab cycles within the dialog, and the opener gets the focus back when it closes. Three tests pin those, because the markup makes the claim whether or not the behaviour is there.
Write the order list as a Mastercam tool library
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.
Puts the changes from #13 onto main branch.