Skip to content

Dimension tool: edit the dimension text (<> = measured value) - #1931

Open
lewandowskit wants to merge 3 commits into
storytold:mainfrom
lewandowskit:wymiary-tekst
Open

lewandowskit wants to merge 3 commits into
storytold:mainfrom
lewandowskit:wymiary-tekst

Conversation

@lewandowskit

@lewandowskit lewandowskit commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1916. Builds on #1788 (Dimension tool by @osamaamin2011), so this PR also shows its commit; the new work is the last two commits:

  • 6b7b7be i18n(pl): the 36 Dimension-tool strings still untranslated in Polish.
  • fae5955 Dimensions: type your own text over the measurement.

Rebased onto current main (#1788's commit included, with its translation-catalog and doc/src/lib.rs conflicts resolved by keeping both sides). Once #1788 lands I'll rebase so only these remain. @osamaamin2011, if you'd rather take them into your branch, feel free to cherry-pick.

What

Double-click a dimension (Selection, Direct Selection, Group Selection or the Dimension tool), or choose Object › Dimensions › Edit Dimension Text…, and type what the dimension shows instead of its measurement. <> stands for the measured value:

  • <> ±0.5 → 1200 mm ±0.5
  • approx. <> → approx. 1200 mm
  • 1200 mm → replaces the number (drawings not to scale)
  • empty / Use Measured Value → the measurement again

The measurement keeps following the measured art, so <> stays live; undo, save and open keep the text.

Why

In sign and print work we dimension customer drawings all the time, and they are often not to scale (a 6 m façade sign sketched on A4) or need a tolerance, a note or a rounded value. Today a placed dimension's number can't be changed without ungrouping it and losing the link. CAD tools and CorelDRAW call this a text override. It isn't in Illustrator's documented Dimension tool, so it's the owner's call (#1916).

How

  • Dimension.text: Option<String> (serialized only when set); measured_label() is the old label, label() applies the text.
  • dimension.create / dimension.update take text (string; "" or null = the measurement), validated as one line of at most 256 characters.
  • Dialog dimensionText: measured value, text field, live preview, Use Measured Value; UI command dimension.editText {id?} and the Object › Dimensions menu item.
  • UI strings in every catalog; the new error message in every complete one.

Tests

  • Engine: typed_text_replaces_the_label_keeps_following_the_source_and_resets, typed_text_is_one_short_line (all 13 dimension tests pass).
  • UI: opens_on_a_dimension_part_and_types_over_the_measurement; i18n and menu tests pass.
  • Re-run after the rebase onto main a067177. cargo fmt --check clean; clippy clean for this change (main's existing manual_range_contains in thumb_worker.rs is untouched).

Code drafted with AI assistance; I'm a native Polish speaker for the translations.

Checklist

  • cargo xtask ci passes — fmt, clippy, tests, assets, brands, layers and wasm, on macOS (Mac mini M4). One existing test unrelated to this PR fails on macOS only and was skipped, as in Info panel: the selection's area (m²) for print and sign work #1905: vectorcraft-mcp remote_does_not_send_on_a_connection_with_a_stray_line (see comment).
  • No panics in shipped code.
  • Clean-room: nothing copied from Adobe products or GPL/AGPL code.
  • No new assets.

🤖 Generated with Claude Code

osamaamin2011 and others added 3 commits October 13, 2026 19:30
…ngth, angle, radius and diameter annotations
The dialog's section titles, field labels, choices and hints, and the
dimension commands' error messages, had no Polish rows (they are passed to
`tl!` through helper functions). 36 rows added.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DukHNvUY45rjRnvtz91x33
Double-click a dimension (Selection, Direct Selection, Group Selection or
the Dimension tool), or choose Object › Dimensions › Edit Dimension
Text…, to type what the dimension shows instead of its measurement, as
drawings that are not to scale or that need tolerances call for. `<>`
stands for the measured value (`<> ±0.5`, `ok. <>`); an empty field shows
the measurement again. The measurement keeps following the measured art,
so `<>` stays live.

- `Dimension.text` (saved in native files only when set) and
  `measured_label()`; `label()` applies the text.
- `dimension.create` and `dimension.update` take `text` (string, or ""
  / null for the measurement); one line of at most 256 characters.
- The Edit Dimension Text dialog shows the measurement, the text field
  and a live preview, with Use Measured Value; UI command
  `dimension.editText {id?}`.
- Strings translated into every catalog; the new message into every
  complete one.

Closes storytold#1916. Builds on storytold#1788 (Dimension tool).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DukHNvUY45rjRnvtz91x33

@Messhias Messhias left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cargo xtask ci is incomplete or unchecked on this PR. Run it end to end (fmt, clippy, tests, assets, brands, layers, wasm), tick the checklist when green, and reply here with the outcome. That is required before any approve from here.

@lewandowskit

Copy link
Copy Markdown
Contributor Author

@Messhias ran cargo xtask ci end to end on macOS (Mac mini M4) and ticked the checklist: fmt, clippy, assets, brands, layers and wasm pass, and cargo test --workspace passes except the same existing macOS-only MCP stale-socket test as on #1905 (vectorcraft-mcp tests::remote_does_not_send_on_a_connection_with_a_stray_line, unrelated to this PR), which was skipped. ✅

@bflatastic

Copy link
Copy Markdown
Member

Thanks @lewandowskit, and thanks for opening #1916 first.

I'm holding this for the owner's decision in #1916, as you expected. The reference app's public documentation for the Dimension tool lists Units, Precision, Scale, Hide Units, the arrow and line settings, the font and the text position, and says existing dimensions change through the Properties panel. It doesn't describe typing your own text over the measurement, so a text override is a new option, and that's the owner's call.

If it's approved: #1788 has landed since, so the branch needs a rebase that drops #1788's commit, and the new strings need rows in bg and pt-br too (both are complete catalogs now).

Join us on Discord: https://discord.gg/artcraft

@Messhias Messhias left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Editable dimension text with <> measured value. Checklist ci green aside from the known macOS MCP flake. Product hold on #1916 is the owner's.

@FredApps FredApps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReviewerA — source-read COMMENT (not an approval)

I read the head of the diff: the Dimension tool lets the user edit the dimension text, with <> standing for the measured value (as in AutoCAD and Illustrator's dimension text conventions). A new document module dimension.rs holds persistent dimension recipes whose children are ordinary paths and type for all renderers and exporters. contributors/people.toml gains an entry for a different person (osamaamin2011) than the PR's author, which looks like another branch's change and should be checked. A user-edited text containing <> must substitute the current measurement every time the geometry changes, and a literal <> needs an escape. The recipe is saved in the document and unknown versions must degrade to the plain drawing. I have not run it, and no exact-head CI result exists for this head. Nothing was run.

I ran nothing and have no exact-head CI result for this PR, so this is not an approval. Where a diff was long I read its code hunks rather than every generated or documentation line.

Status: waiting_author.

bflatastic pushed a commit that referenced this pull request Nov 14, 2026
…ort lists

The Polish catalog lacked a row for 1,854 of the status and error
messages that the untranslated report finds in the sources, so the
status bar showed those messages in English.

- pl.tsv gains 1,808 `@msg` rows: the errors of commands and their
  parameter checks, scripts, file import and export, printing and
  plug-ins. The translations are VectorCraft's own, written from the
  English meaning with the catalog's conventions and its existing
  feature names. Placeholders, parameter names, command ids and
  literal values stay as the English writes them.
- 44 of the others get their Polish rows from open #7211, #7214,
  #7116, #7330 and #1931, so this change leaves them out. 2 are
  messages that no catalog has a row for yet. Menu strings, `tl!`
  literals, undo labels and swatch names are unchanged.
- Two of the messages have two placeholders in a row. The catalog does
  not load such a row, so those two are still shown in English.
- The Polish row of docs/localization-parity.md gives the catalog's
  current counts.

Docs: docs/target-app-parity.md, docs/localization-parity.md.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dimension tool: edit the dimension text (text override with <> for the measured value)

6 participants