Commit Graph
266 Commits
Author SHA1 Message Date
Hakan Seven 21f33e933e Merge pull request #1777 from ramox81/codex/refedit-dialog
REFEDIT: Reference Edit dialog and unique names for xref objects

# Conflicts:
#	locales/ar-SA/opencadstudio.ftl
#	locales/bg-BG/opencadstudio.ftl
#	locales/cs-CZ/opencadstudio.ftl
#	locales/de-DE/opencadstudio.ftl
#	locales/el-GR/opencadstudio.ftl
#	locales/en-US/opencadstudio.ftl
#	locales/es-ES/opencadstudio.ftl
#	locales/fi-FI/opencadstudio.ftl
#	locales/fr-FR/opencadstudio.ftl
#	locales/hi-IN/opencadstudio.ftl
#	locales/hu-HU/opencadstudio.ftl
#	locales/it-IT/opencadstudio.ftl
#	locales/ja-JP/opencadstudio.ftl
#	locales/ko-KR/opencadstudio.ftl
#	locales/lo-LA/opencadstudio.ftl
#	locales/nl-NL/opencadstudio.ftl
#	locales/pl-PL/opencadstudio.ftl
#	locales/pt-BR/opencadstudio.ftl
#	locales/ru-RU/opencadstudio.ftl
#	locales/tr-TR/opencadstudio.ftl
#	locales/zh-CN/opencadstudio.ftl
#	locales/zh-TW/opencadstudio.ftl
#	src/app/control/actions.rs
#	src/app/mod.rs
#	src/app/view/modal.rs
2026-10-14 12:10:40 +03:00
Hakan SevenandClaude Opus 5.5 006d85c362 i18n: translate the REFEDIT working-set buttons
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 12:06:32 +03:00
Hakan Seven dec3ba2743 Merge pull request #1778 from ramox81/codex/refedit-toolbar
REFEDIT session toolbar: definition name, working set count and REFSET buttons
2026-10-14 12:05:19 +03:00
Hakan SevenandClaude Opus 5.5 06e3a6976c i18n, mcp: translate Image Adjust; pin the schema with image_adjust
#1776 left its dialog in English outside tr-TR and added the
image_adjust automation action without re-pinning the MCP tool schema
digest, which failed tool_schema_digest_is_pinned.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 12:05:00 +03:00
Hakan Seven ff5833c35e Merge pull request #1776 from ramox81/codex/imageadjust-dialog
IMAGEADJUST: Image Adjust dialog for raster images
2026-10-14 12:01:13 +03:00
JuCeIbMo 278163bb22 i18n(es): translate the Sheet Set Manager
Translate the 159 Sheet Set Manager strings still in English, using the
terms already in the file: Conjunto de planos, plano, Presentación,
espacio modelo / papel. Variables, NEWSHEETSET and file masks are untouched.
2026-10-14 04:17:46 -04:00
ramox81andClaude Opus 5.5 74d65c26be REFEDIT session toolbar: definition name, working set count, REFSET
The right-edge toolbar of a REFEDIT session now shows the definition
being edited (REFEDITNAME) as an accent pill with the number of objects
in the working set, Add to / Remove from Working Set buttons with their
own icons (REFSET Add / Remove, straight to object selection), and
Save / Discard in a separate group below a rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 10:51:22 +03:00
ramox81andClaude Opus 5.5 92a3a8ee4d REFEDIT: Edit Reference dialog and unique names for xref objects
REFEDIT opens a dialog after the pick: the nesting chain as chips with a
preview of the chosen definition, all objects or picking them in the
drawing, attribute definitions (offered only when the definition has
them), locking objects outside the working set and unique names for an
external reference's named objects. The settings are remembered.

With unique names an xref's dependent layers, linetypes, text styles and
blocks are checked out as $N$NAME records of their own; without, under
the plain name, sharing a host record of that name. Save writes them back
under the reference's names, and the records made for the session are
removed when it closes. -REFEDIT uses the remembered settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 10:39:28 +03:00
ramox81andClaude Opus 5.5 2f55c73457 IMAGEADJUST: Image Adjust dialog for raster images
IMAGEADJUST (alias IAD) takes the selected raster images or asks
"Select image(s):", then opens a dialog with a before/after preview of
the first image and brightness, contrast and fade rows (bar plus
stepper, whole numbers 0-100). Apply writes the values to every chosen
image as one undo step; restore defaults sets 50/50/0. Adds the
image_adjust automation action and the image-adjust locale group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 10:11:36 +03:00
Hakan SevenandClaude Opus 5.5 da8e976a60 feat(bedit): author visibility states of dynamic blocks
In the Block Editor, BVSTATE makes a new visibility state, makes one
current, renames or deletes one; BVHIDE and BVSHOW hide or show the
picked objects in the current state (BVSHOW shows every object of the
block while they are picked). The first use makes the block dynamic.

The states are stored as the format keeps them: a
BLOCKVISIBILITYPARAMETER in the block's ACAD_ENHANCEDBLOCK evaluation
graph with its visibility grip and the grip's two location expressions,
the round-trip purge preventer, AcDbDynamicBlockTrueName /
AcDbDynamicBlockGUID / AcDbBlockRepETag on the definition and element
tags on each of its objects. The definition shows its first state; a
reference given another state gets its own evaluated *U copy, tagged
AcDbBlockRepBTag and linked back through AcDbBlockRepresentation /
AcDbRepData, so it shows that state and the other references do not
change. Saving the block drops erased objects from the states.

Checked: a block authored this way reads back with its states and
reference link from DWG and DXF, and the ODA converter accepts the DWG.

Closes #1566

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 10:02:34 +03:00
Hakan SevenandClaude Opus 5.5 2ba368557c i18n(fr): product name, accents and the usual French command terms
Keep the product name Open CAD Studio, restore the accents of Colinéaire
and Égal, and use the established French terms for the array commands
(Réseau rectangulaire / polaire / trajectoire) and Lissage for loft.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 09:10:23 +03:00
Hakan Seven fad4643679 Merge pull request #1767 from NJdevPro/main
Improve French localization in opencadstudio.ftl
2026-10-14 09:09:02 +03:00
Hakan SevenandClaude Opus 5.5 1eda5cd22d fix(refedit): write the whole definition back to an xref, keep a .bak
REFCLOSE Save on an xref replaced the referenced file's model space with
the working set alone. With the Nested selection method the objects that
were not checked out stay in the definition, but they were deleted from
the file on disk. Write back every object of the saved definition, and
copy the file to .bak first when ISAVEBAK is on, as a drawing save does.

Also translate the new REFEDIT prompts into the other 20 locales; the
catalog test requires every locale.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 08:51:23 +03:00
Hakan Seven 7e763080cb Merge pull request #1752 from ramox81/codex/refedit-parity
REFEDIT: reference prompts, -REFEDIT, REFSET, nested references and xref write-back
2026-10-14 08:46:42 +03:00
Hakan Seven f6fc244430 Merge pull request #1751 from ramox81/codex/adjust-parity
ADJUST: images and underlays, -IMAGEADJUST and PDF/DWF/DGNADJUST
2026-10-14 08:42:35 +03:00
Hakan Seven f8908e151f Merge pull request #1754 from ramox81/codex/attach-command-line
ATTACH: FILEDIA, -ATTACH command line and reference file types

# Conflicts:
#	src/app/settings.rs
#	src/app/update/file.rs
2026-10-14 08:39:34 +03:00
Hakan SevenandClaude Opus 5.5 d0c292aedd i18n: translate the Underlay OSnap vary state in every locale
#1753 added the string to en-US and tr-TR only; the catalog test requires
all 22 locales.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-14 08:38:36 +03:00
Hakan Seven 7d306eec5e Merge pull request #1753 from ramox81/codex/insert-reference-ribbon
Insert ribbon: Reference panel order and Snap to Underlays state
2026-10-14 08:35:47 +03:00
Nicolas Janin 6adfc256cf Improve French localization in opencadstudio.ftl
Updated French translations for various UI elements and messages.
2026-10-13 22:02:06 +02:00
Hakan SevenandClaude Opus 5.5 881d237629 feat(array): ARRAYEDIT Source edits what an associative array repeats
ARRAYEDIT picks an associative array (or takes the preselected one) and
its Source option opens the objects every item repeats in the Block
Editor; saving there updates all items at once. Counts and spacings stay
in Properties.

Refs #1109

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 22:29:56 +03:00
Hakan SevenandClaude Opus 5.5 d4b4fc37e1 feat(model): SECTIONCULL erases what lies outside a section
SECTIONCULL keeps only what the selected section object (or the live
section of the space) shows: solids, surfaces and closed meshes are cut
to it with the same planes the live section uses, open meshes are
clipped face by face, and every other object wholly outside it is
erased. Objects across the boundary that cannot be cut stay whole. One
undo step.

The section's bounding planes are gathered once (section_planes) and
shared by the live section and the cull.

Refs #1407

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 21:59:25 +03:00
Hakan SevenandClaude Opus 5.5 adbcac8a02 feat(start): recent files as a list, icons or large previews
Three toggles beside the Recent Documents title switch the panel between
the existing list, a grid of thumbnail tiles and one large preview per
file. The choice is kept in the recent section of the app config.

Refs #1494

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 21:46:40 +03:00
Hakan SevenandClaude Opus 5.5 58b2f22c09 feat(compare): COMPARE overlays what differs from another drawing
COMPARE picks a drawing (or takes its path) and matches its objects with
this drawing's by what they draw: type, layer and tessellated geometry,
so an unchanged copy matches whatever its handle. Objects only here are
outlined in green, objects only in the other drawing in red, over the
current drawing, and Next / Previous zoom from one difference to the
next with a count in the prompt. A moved or edited object shows as one
of each. eXit (or Esc) clears the overlay.

Refs #970

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 21:31:46 +03:00
Hakan SevenandClaude Opus 5.5 f0ac89629b feat(array): ARRAYRECT and ARRAYPOLAR create associative arrays
With the new Associative option on (the default), ARRAYRECT and
ARRAYPOLAR build the array the way the drawing format stores one: the
selected objects move into an anonymous source block, an anonymous
array block holds one ByBlock reference to it per item, an INSERT of
the array block takes their place, and an AcDbAssocAction with an
AcDbAssocArrayActionBody, its three dependencies, the BaseNormal /
Origin / basePoint parameters and the value parameters tie them
together in the model-space network. The array is then edited from
Properties like an array read from a file.

The option flips with AS and is remembered for the session; on a
rotated working plane the commands keep making plain copies. Saving
drops the action of an array whose reference was erased or exploded.

Checked: created arrays reopen as associative with their parameters
and items, and the ODA converter reads the saved DWG without errors.

Refs #1109

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 21:23:48 +03:00
Hakan SevenandClaude Opus 5.5 2bf77e4bd6 feat(array): edit associative arrays through their standard records
An associative array is an AcDbAssocAction with an
AcDbAssocArrayActionBody, dependencies on the array INSERT, the block
holding the item references and the block holding the source objects,
and value parameters (Items, ItemSpacing, Rows, …). Selecting the array
INSERT now shows its counts and spacings in Properties; changing one
places the items again and rewrites the item references, the body's
item records and the parameter values together, in one undo step, so
the drawing stays associative when saved.

Rectangular arrays follow their RowProfile axis, AxesAngle and base
normal; polar arrays turn about the centre recovered from their first
item, Radius and StartAngle. Both match the stored items of the
associative arrays in the sample drawings (122 of 123 rectangular, all
polar items of the polar samples). Path arrays are shown read-only.

Refs #1109

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 20:32:51 +03:00
Hakan SevenandClaude Opus 5.5 f18386c100 feat(io): FBXEXPORT writes the drawing's 3D meshes as binary FBX
FBXEXPORT (also EXPORTFBX) saves every 3D mesh of the drawing (solids,
surfaces and meshes, at full display resolution) as a binary FBX 7.4
file for visualisation tools: one model per object with its geometry,
face normals and a material in its display colour. Axes stay Z-up and
the unit scale follows the drawing's insertion units.

Refs #1502

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 16:37:09 +03:00
Hakan SevenandClaude Opus 5.5 8a2bc443e0 feat(options): menu bar, ribbon and HPASSOC switches; see-through command line by default
Options > Display gains Window Elements with "Show the menu bar"
(MENUBAR) and "Show the ribbon" (RIBBON / RIBBONCLOSE); Options > User
Preferences gains a Hatch switch for HPASSOC. The command line now
starts at 80 % opacity so the drawing shows through it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 16:14:26 +03:00
Hakan SevenandClaude Opus 5.5 ee18f7ad3c feat(ui): classic pull-down menu bar and ribbon toggle
MENUBAR 1 shows File, Edit, View, Insert, Format, Tools, Draw,
Dimension, Modify, Parametric and Help menus above the ribbon; every
entry runs an existing command, and a test keeps each entry pointing at
a registered command. RIBBONCLOSE hides the ribbon and RIBBON brings it
back, so the menus can replace it. Both choices persist.

Also translates the "File" label, which every locale had left in
English.

Refs #1450

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 16:05:51 +03:00
Hakan SevenandClaude Opus 5.5 9724447dd0 feat(ribbon): contextual Block Editor tab while editing a block
Opening the block editor brings up a Block Editor ribbon tab with
Edit / Save / Discard, Attribute Definition, and the geometric,
dimensional and parameter tools that drive parametric blocks. The tab
is only listed while a block editor session is open, and leaving the
session returns to the tab that was active before.

Refs #509

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 15:53:55 +03:00
ramox81andClaude Opus 5.5 a0a83ad681 ADJUST: images and underlays, -IMAGEADJUST and PDF/DWF/DGNADJUST
ADJUST gathers raster images or PDF/DWF/DGN underlays (other objects are
dropped silently, pickfirst is used, a mixed set is refused), then asks the
image option (Brightness default) or the underlay option (last used), with
value prompts that offer the image's own value or the session's last
underlay fade/contrast, and Monochrome Yes/No. Invalid values re-prompt.
One undo step. -IMAGEADJUST, PDFADJUST, DWFADJUST and DGNADJUST take one
kind each. Raster image Brightness/Contrast/Fade move to an Image Adjust
section as whole numbers with 0-100 validation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 15:53:20 +03:00
ramox81andClaude Opus 5.5 042223a09c Insert ribbon: Reference panel after Block Definition; Snap to Underlays list follows UOSNAP
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 15:52:27 +03:00
ramox81andClaude Opus 5.5 6784f89993 REFEDIT: reference prompts, -REFEDIT, REFSET, nested references, xref write-back
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 15:52:26 +03:00
Hakan SevenandClaude Opus 5.5 5dd05bca18 feat(command-line): adjustable command line opacity
COMMANDLINEOPACITY (20-100 percent, default 100) and a slider under
Options > Display make the floating command line's panels see-through,
so the drawing stays visible behind it. The input field stays opaque
for legibility. The value is an application setting that persists.

Refs #1494

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 15:46:28 +03:00
Hakan SevenandClaude Opus 5.5 dd45ac4039 feat(modify): TXTEXP turns text into its character outlines
TXTEXP replaces each selected TEXT and MTEXT with one polyline per
glyph contour, on the text's layer and with its properties: a
lightweight polyline for flat text, a 3D polyline for tilted text.
The outlines come from the same glyph tessellation the text renders
with, so stroke fonts give their strokes and outline fonts their
closed contours.

Refs D#1665

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 15:27:28 +03:00
ramox81andClaude Opus 5.5 0678c579c0 ATTACH: FILEDIA, -ATTACH command line and reference file types
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 15:22:44 +03:00
Hakan SevenandClaude Opus 5.5 57eb7fe4db feat(layout): MVSETUP sets a drawing up for plotting
In model space MVSETUP draws the sheet border at the drawing scale
(scale factor, paper width and height) and zooms to it, or switches to
a layout. On a layout it creates viewports in a bounding area (a single
one, a 2x2 engineering set of top/front/right/isometric views, or an
array with spacing), deletes picked objects, and scales picked
viewports to a paper/model unit ratio.

A viewport's fit to the model now measures the model along the
viewport's own view direction, so side and isometric views frame it
too.

Refs #1501

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 15:21:26 +03:00
Hakan SevenandClaude Opus 5.5 b1d4c9bd9b feat(clipboard): PASTESPEC pastes in a chosen format
PASTESPEC offers the formats on the clipboard: Objects and Block for
objects copied in the application (the PASTECLIP and PASTEBLOCK paths),
and Text for the system clipboard's text, placed as multi-line text in
the current text style with its lines as paragraphs.

Refs #645

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 15:06:58 +03:00
Hakan SevenandClaude Opus 5.5 4ffae00199 feat(view): DVIEW twists the view about its line of sight
DVIEW (alias DV) offers TWist and Undo. TWist rolls the active view
or viewport camera to the typed angle; Undo steps back through the
twists made in the session. The new alias reaches existing profiles
through the alias migration table.

Refs #638

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 14:47:34 +03:00
Hakan SevenandClaude Opus 5.5 0eec9c450f feat(input): lock the next point to a typed <angle
Typing <angle at a point prompt (e.g. <30) now fixes the direction of
the next point from the last one until a point is placed: the cursor
moves along that direction, and a bare number entered next is the
distance along it. The angle is read in the drawing's angle base and
direction and turned into the current UCS. Works from the command line
and from scripts or the automation token input alike.

Fixes #1464

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 14:21:50 +03:00
Hakan SevenandClaude Opus 5.5 a5435a6df6 i18n: catalogue the two messages #1741 and #1743 added
"Requires a number." and "Requires 0 or 1 only, or option keyword."
had no catalogue entry, so every locale showed them in English.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 11:30:46 +03:00
ramox81andClaude Opus 5.5 0ee95fa4ba Background dialog: adjust an image's offset and scale; visual style names
- The Image tab gains an Adjust card: X/Y offset in pixels (-2000..2000)
  and X/Y scale (-10..10, tenth steps, a negative scale mirrors, zero keeps
  the image's scale) with spinners and Reset, inactive while the image is
  stretched; Keep aspect ratio is a switch and makes both scales follow.
- The preview shows the image at its offset and scale, tiled when tiled,
  and a stretched image kept to its aspect ratio covers the view.
- Automation: step=<field>,+1|-1 and reset; offset/scale take any numbers.
- Shaded with edges, Shades of Gray and Sketchy have catalog entries in
  every language.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-13 10:28:18 +03:00
Hakan Seven 03445a540d Merge pull request #1722 from ramox81/codex/view-background
# Conflicts:
#	locales/ar-SA/opencadstudio.ftl
#	locales/bg-BG/opencadstudio.ftl
#	locales/cs-CZ/opencadstudio.ftl
#	locales/de-DE/opencadstudio.ftl
#	locales/el-GR/opencadstudio.ftl
#	locales/en-US/opencadstudio.ftl
#	locales/es-ES/opencadstudio.ftl
#	locales/fi-FI/opencadstudio.ftl
#	locales/fr-FR/opencadstudio.ftl
#	locales/hi-IN/opencadstudio.ftl
#	locales/hu-HU/opencadstudio.ftl
#	locales/it-IT/opencadstudio.ftl
#	locales/ja-JP/opencadstudio.ftl
#	locales/ko-KR/opencadstudio.ftl
#	locales/lo-LA/opencadstudio.ftl
#	locales/nl-NL/opencadstudio.ftl
#	locales/pl-PL/opencadstudio.ftl
#	locales/pt-BR/opencadstudio.ftl
#	locales/ru-RU/opencadstudio.ftl
#	locales/tr-TR/opencadstudio.ftl
#	locales/zh-CN/opencadstudio.ftl
#	locales/zh-TW/opencadstudio.ftl
2026-10-13 07:44:01 +03:00
turbuczn 49f12e010f Complete Hungarian localization and improve block reference labels 2026-10-12 15:21:05 +02:00
Hakan SevenandClaude Opus 5.5 b94bb18a44 fix: catalog every ported web string in all locales; drop tests of unported STB parsing
- Translate the strings the #1717 port cataloged in English only
  (CSV picker, plot-preview task, extraction cap, shared-copy warning)
  for every locale, and the whole ported web set for lo-LA, which the
  contributor branch predates.
- hu-HU carried twelve keys twice after the port's merge; keep main's.
- The STB container/refusal tests exercised parsing this port did not
  bring over; the preview-clamp test now only pins the upper bound, since
  main's raster path already clamps preview pages further.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 12:02:06 +03:00
Afonsop 835e8d469f feat: in-place save (File System Access), image paste, print wiring, web capture
The last high-severity web gap plus a small integration bundle.

In-place save: with the File System Access API (Chromium/Edge), Save
now works like desktop. Plain Save on a tab with a retained handle
writes straight through — no picker, no download, no "(1)" copies.
First save or format change opens showSaveFilePicker AT the confirm
gesture (the worker serialization that follows can outlast the
transient-activation window; retained handles need no activation to
write). Picker cancel cancels the save like desktop; picker or write
failure falls back to the legacy download with a note; Firefox/Safari
keep the download flow untouched (feature-detected). Handles are
keyed by tab id in a thread-local registry (Message must be Send —
JsValue cannot ride in messages or App state); closing a tab drops
its handle; Save As re-picks. Dirty clears only on successful
persistence, same race guard as before.

Image paste: Ctrl+V of a screenshot inserts it as an image reference
— the clipboard reader falls back to image/* items when neither the
entity clipboard nor text has anything (precedence preserved), the
bytes enter the image source registry as pasted-<timestamp>.<ext>,
and attach reuses the IMAGE command's model-creation path verbatim.

Browser print: beforeprint snapshots the WebGL canvas into a print-
only <img> (the capture_canvas technique), so the browser's own print
menu produces the drawing instead of a blank page.

Automation capture on web: the capture op no longer calls the
synchronous GPU-map screenshot (dead on wasm); main's frame-parked
capture waits for a presented frame and reads via capture_canvas — the
same workaround the save-thumbnail path uses — delivering the PNG as a
download.

(cherry picked from commit 6e89b36d)

Ported onto main (#1717 review): the web capture rides main's existing
frame-parked capture (one ControlCaptureFrame path, ignoring the timer
tick on wasm) instead of a second parked-capture state; closing a tab
drops its file handle inside main's on_tab_close.
2026-10-12 12:02:05 +03:00
Afonsop 6af8d8ba8c feat: restore-all session recovery, ?file= deep links, offline PWA
Session recovery: more than one pending snapshot adds a 'Restore all'
button to the Recover Drawing modal — every snapshot goes through the
exact same guarded path as a single restore (deleted only after its
own open succeeds). The open-tab list and active tab persist to
localStorage on web (open/save/close) and the remembered tab is
re-selected once a restore batch settles; the modal notes how many
drawings the session had. Nothing is auto-opened.

Deep links: ?file=<url|name> opens a drawing at boot. http(s) URLs
must end in .dwg/.dxf and are fetched with the same streaming,
64 MB-capped, 8 s-deadline reader the remote images use, then go
through the guarded open queue; cross-origin opens announce the
origin first. Bare names resolve from the browser's recent storage,
with a hint when absent. Everything else (file:, javascript:, drive
letters, non-drawing tails) is refused with a console note.

Offline PWA: the app was installable (manifest) but downloaded its
55 MB bundle on every visit. A cache-first service worker now serves
the whole bundle from Cache Storage after one online visit —
navigations network-first so updates land, hashed assets
stale-while-revalidate, non-GET/cross-origin passthrough, old caches
cleaned on activate, and the waiting-worker update flow documented.
The Pages workflow stamps the cache version from the bundle hash and
fails if sw.js is missing or unstamped.

(cherry picked from commit 5f9b345e)

Ported onto main (#1717 review): the cache-version stamp moved from the
skipped build-web.sh wrapper into the Pages workflow; the tab-close hook
lands in main's on_tab_close, which also cancels pinned control requests.
2026-10-12 12:02:05 +03:00
Afonsop 2d2444fcfa fix: close the review findings on the issue wave
Ported from d719fb77 (#1717); the hatch draw-order, PDF and
recovery-settle hunks stay out (main owns those paths).

- La16 was still billed at 4 B/px: the no-conversion special case
  keyed on native_bpp == 4, which La16 also is — but only Rgba8 is a
  real move in into_rgba8, so La16's decode peak is 8. The case now
  keys on the color type, and a table test pins every layout's peak
  (plus GIF's screen+frame 8) so the accounting can't silently drift.
- json_values_match: an integer beyond f64 precision no longer matches
  a float it merely rounds onto; a mixed pair matches only when the
  float is whole and converts back to exactly that integer (also the
  fuzz finding of 9262d63f).
- ocs-control.js resolves `ready` with the API object instead of
  window.ocsControl, which is still undefined when the bridge already
  exists as the script runs (built before the first settle, avoiding
  the temporal-dead-zone throw of a later const); DATALINK on web says
  the typed path is superseded by the picker instead of silently
  discarding it.

(cherry picked from commit d719fb77)
2026-10-12 12:02:05 +03:00
Afonsop db8db14006 feat: web automation wrapper (#1349), DATALINK table on web, System theme; honest decode accounting
Ported from 2c38de53 (#1717). Main already carries the hatch PDF draw
order fix (#1345), the numeric set_properties compare (#1348) and the
web open from bytes, so those parts stay out; what remains:

#1349 — window.ocsControl.ready/request promise wrapper with an
ocs-ready event (web/ocs-control.js, loaded by the web page), and the
startup donation prompt is suppressed once a control request is seen
(opt-in pre-boot via localStorage["opencadstudio.automation"] = "1").
docs/automation/web.md documents both. The control protocol stays at 1.

DATALINK CSV-to-table works on web (picker + bytes through the session
registry — was std::fs, silently dead); COLORSCHEME accepts System
(prefers-color-scheme on web, AppsUseLightTheme on Windows).

Decode accounting, made honest per the fix-of-fix review: into_rgba8
allocates the RGBA destination while the native buffer is alive for
every non-Rgba8 layout (L8 5, La8 6, Rgb8 7, L16 6, La16 8 B/px
peaks — the formula now says so), GIF bills the screen+frame
coexistence at 8 B/px, and TIFF drops the 3x multipliers both ways —
tiff 0.11 splits the given budget between frame and scratch (a total
ceiling), so the old double-billing refused honest 16-bit GeoTIFFs
~2.25x early while admitting hostile chunk transients at 3x.

(cherry picked from commit 2c38de53)
2026-10-12 12:02:05 +03:00
Afonsop f015c3b5fa fix: native-bpp decode accounting, GIF frame bombs, streaming remote bodies
A second adversarial round (with empirical reproduction against the
vendored image 0.25) found the budget contract still had holes:

- The probe billed 4 bytes/px, but 16-bit formats allocate their
  native layout during decode (8/px for RGBA16 PNG; TIFF stacks ~3x
  codec scratch on top). In-budget 16-bit images were falsely refused
  with self-contradictory notes, and the decode transient could exceed
  the budget the tiers claimed to enforce. The probe now reads the
  color type alongside the dimensions and bills the real peak (native
  layout + RGBA where they coexist, plus the TIFF codec factor), so
  refusals are honest and per-platform-correct, and the TIFF allowance
  follows the same accounting.
- GIF: the probe reads the LOGICAL SCREEN, but a crafted frame may
  declare itself arbitrarily larger (empirically: a 10x10 probed
  screen with an 8192x8192 frame — 320 MB and 29 s from a
  probe-claimed-400-byte image). The GIF frame buffer is now capped
  to the probed size plus slack; frame bombs refuse like any other
  oversize.
- Remote bodies on web streamed incrementally with the 64 MB cap
  enforced DURING the read (array_buffer() materialized a hostile
  chunked reply in full before any check could fire), aborting and
  cancelling the reader the moment the cap is crossed.
- Degenerate raster entities (zero/non-finite size or vectors) no
  longer produce NaN placement math that aborted whole PDF exports —
  they resolve to the broken-reference placeholder.
- Same-name resolution now has a deterministic winner (newest
  registration, via insertion order) instead of HashMap iteration
  order; URL query strings no longer break by-name matching; the
  image pick matches its refusal note by the quoted file name
  (substring collisions like a.tif/2011.tif attributed errors to the
  wrong file); a dropped remote outcome at the queue cap triggers one
  unconditional catch-up re-resolution instead of waiting for another
  event; the unknown-size refusal says so instead of printing 0x0;
  and the build script fails cleanly when there are no fonts to
  verify.

(cherry picked from commit c6db94e8)

Ported onto main (#1717 review): the build-web.sh hunk stays out with
the wrapper; the new messages are cataloged (image refusal under the
file group it is looked up in, plus the extraction cap, shared-copy
warning and plot-preview task title that were missing), and the web
SAVEALL failure reuses the existing SAVEALL message.
2026-10-12 12:02:05 +03:00
Afonsop 93e97bdf18 feat: bounded huge-image decoding, webp/gif, remote rasters, Georgian/Armenian fonts
Giant rasters (500 MB aerial/GIS TIFFs) decoded whole: multiple GB of
RGBA on a wasm heap is tab death, and even desktop silently failed
past the image crate's 512 MiB default allocation cap. Decoding now
probes the header for dimensions first and runs in tiers — full decode
under a per-target budget (512 MB wasm / 4 GB native, enforced through
the decoder's allocation limits so oversize fails fast instead of
ballooning), Lanczos3 downsample to a display cap (4096² wasm /
8192² native) when the decode fits but the buffer is oversized, and a
clear localized refusal naming the dimensions and the limit when it
cannot. The probed source dimensions stay the entity's sizing truth,
so a downsampled buffer never shrinks the on-paper footprint; PDF
export self-corrects (effective DPI derives from placement × stored
pixels). Refusals surface once per image through the pick, open, and
drop/re-resolve paths.

Decode coverage gains webp and gif (pure Rust in image 0.25 — no C,
no lockfile churn), with the attach picker and drop filters matching.

Remote http(s) raster references now fetch on web: CORS-classified
failures name CORS, HTTP errors name the status, bodies over 64 MB and
8 s deadlines are bounded, and fetched bytes join the session source
registry (so ARCHIVE can package them and re-resolution reads cache).

Georgian and Armenian Noto subsets ship (generation blocks included),
so those scripts render instead of skipping; scripts still without
subsets remain silently skipped, unchanged.

(cherry picked from commit ca0d7b96)

Ported onto main (#1717 review): Armenian and Georgian take the script
indices after Lao, which main added meanwhile.
2026-10-12 12:02:05 +03:00