Skip to content

Pack Design: a saved design and the designs it uses go into one zip (#3890) - #9857

Draft
CamWight wants to merge 11 commits into
tangency-labs:mainfrom
CamWight:drawing-pack-k12-3890
Draft

CamWight wants to merge 11 commits into
tangency-labs:mainfrom
CamWight:drawing-pack-k12-3890

Conversation

@CamWight

@CamWight CamWight commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Sending a design that uses other designs meant finding and copying each of those files by hand. Now Pack Design writes a saved design and the designs it uses into one zip.

Part of #3890 (drawing storage), into drawings: Pack Design: a saved design and the designs it links, in one zip (K12).

Changes a default: no

What it does

  • file.pack writes the saved design and the designs its links name into one .zip to hand on. The design goes at the top level, each of its links pointing at designs/<name>, and each linked design under designs/, byte for byte. Unpacked anywhere, it opens with every link found.
  • Packs go one level deep: a linked design's own links are listed in the reply (deeper), not followed. Only design files are copied; a design saved as JSON goes in as JSON.
  • A pack holds the files as saved: a design with unsaved changes or no file is refused, and the design, its file and its links are left as they were.
  • Every linked file is found and sized before any is read: at most 256 linked designs and 1 GiB in all.
  • Entry names are made from file names. Characters a file name can't hold become _, no name ends in a dot or a space, a name Windows keeps for a device gets _ after its stem, and a name another entry has, case aside, is numbered (plate.sc, plate-2.sc).

Pictures

None: a command with no window of its own yet. Its reply and the zip are checked by the tests below.

Tests

  • A pack of a design linking one file twice: one file in the pack, byte for byte, and unpacked elsewhere it opens with every link found and the same volume. The design, its file and its links are left as they were.
  • Linked files of one name numbered apart, and a linked design's own links listed, not followed.
  • A design saved as JSON packed as JSON, its link pointing into the pack.
  • Refused, with nothing written: no file, unsaved changes, a path that isn't a .zip, a linked file that isn't a design (named by its link, never by what it holds), a missing file, a link judged from its text alone, the design as its own link, and more than 1 GiB in all (from the files' sizes, before any is read).
  • 256 linked designs taken, 257 refused.
  • Entry names made safe, clashing names numbered, files stored as given, and the caps.

Validation

Local, Windows, on drawings b21c377:

  • cargo fmt --check, cargo xtask lists, and wasm of io and engine;
  • clippy -D warnings over io and engine with their tests;
  • the pack, schema, label and hostile-parameter tests of io and engine: 99 passed, and the two pack tests added after that run pass with the rest of the pack tests;
  • 15 planted faults: 14 caught by a test. The other drops the writer's own size check while adding files; the command refuses the total before that is reached (tested), and reaching it would need over 1 GiB in memory.

Integration status

Over drawings b21c377. #9289 (K9′) and #9402 are this issue's other open slices.

Refs #3890

@github-actions github-actions Bot added the area:io import/export and file formats (STEP, IGES, 3MF, glTF, designs) label Oct 31, 2026
@CamWight
CamWight force-pushed the drawing-pack-k12-3890 branch from b79c96a to 6b128ef Compare November 1, 2026 05:53
@CamWight CamWight changed the title Pack Design: a saved design and the designs it links, in one zip (#3890 K12) Pack Design K12: a saved design and the designs it uses go into one zip (#3890) Nov 2, 2026
@CamWight CamWight changed the title Pack Design K12: a saved design and the designs it uses go into one zip (#3890) Pack Design: a saved design and the designs it uses go into one zip (#3890) Nov 3, 2026
@CamWight
CamWight force-pushed the drawing-pack-k12-3890 branch from 6b128ef to f4209b6 Compare November 4, 2026 09:01
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@CamWight
CamWight force-pushed the drawing-pack-k12-3890 branch 4 times, most recently from afa15b7 to eb87f44 Compare November 8, 2026 01:59
…ngency-labs#3890 K12)

file.pack writes the saved design and the designs its links name into
one .zip to hand on. The design goes at the top level, each of its
links pointing at designs/<name>, and each linked design under
designs/, byte for byte. Packs go one level deep: a linked design's own
links are listed in the reply, not followed. Only design files are
copied.

- A pack holds the files as saved: a design with unsaved changes or no
  file is refused, and the design, its file and its links are left as
  they were.
- Every linked file is found and sized before any is read, the total
  within MAX_PACK_BYTES, with at most MAX_PACK_ENTRIES entries.
- Entry names are made from file names: characters a file name can't
  hold become `_`, no name ends in a dot or a space, a name Windows keeps
  for a device gets `_` after its stem, and a name another entry has,
  case aside, is numbered (plate.sc, plate-2.sc).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CamWight
CamWight force-pushed the drawing-pack-k12-3890 branch from eb87f44 to 9f3031b Compare November 9, 2026 01:56
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bherbruck

Copy link
Copy Markdown
Collaborator

drawings now includes main as of today; please merge drawings into your branch. Thanks!

CamWight and others added 3 commits November 14, 2026 07:06
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bherbruck
bherbruck changed the base branch from drawings to main November 18, 2026 05:08
@bherbruck

Copy link
Copy Markdown
Collaborator

Drawings landed on main (#18615), so I've retargeted this PR to main. It may need a rebase onto main; once it's green and out of draft it goes through review and the merge queue as usual.

CamWight and others added 3 commits November 21, 2026 06:29
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CamWight and others added 2 commits December 1, 2026 07:52
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

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

area:io import/export and file formats (STEP, IGES, 3MF, glTF, designs)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants