Fixes#4030
On a small screen (an 11-inch 1366x768 panel) the system can report a very large display scale. The Auto interface size followed it blindly, so the window and ribbon came out far bigger than the screen and File > Options, where the size is set, could not be reached.
What this changes:
- Auto interface size is now capped so a window of at least 900x460 points still fits the screen (about 152% on 1366x768). Scales that already fit (for example 1920x1080 at 100-150%, or 1366x768 at up to 150%) are unchanged. If the screen size is unknown there is no cap.
- A size chosen in File > Options is still taken as is. If a large size pushes the options out of reach, Ctrl+Shift+0 (Cmd+Shift+0 on Mac) returns to Auto from anywhere. Ctrl+Alt+0 is not used because it is AltGr+0 on some layouts and would type a character.
- `ui.interfaceSize` and the "Auto (n%)" label in Options report the capped value. The cap is never saved to `ui.json`.
- Tests: the cap for several screen sizes, the shortcut, AltGr+0 still typing, and the reported percent. Docs: ui-parity, control-protocol, ROADMAP progress log.
Not covered:
- The root cause of the oversized scale (X11 DPI detection) is handled by #721 and #3240. This change is separate and works with or without them.
- A manually chosen large size can still push controls off screen, but there is now a way back.
- Not tested on a real 1366x768 screen.
`cargo xtask ci` passed locally on the pushed code; GitHub CI has not run yet.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit
* **New Features**
* Auto interface sizing now scales down on smaller displays to keep a window of at least 900×460 points within the screen. Sizes selected in Options remain uncapped, and the minimum Auto scale is 100%.
* Press Ctrl+Shift+0 (⌘⇧0 on Mac) to restore Auto sizing. When Auto sizing is capped, the displayed zoom percentage reflects the screen-fit limit; the cap does not change the saved size.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Register Latin Bosnian as an interface language, with catalog-backed locale, plural and font regressions. Preserve the existing system-locale detector; POSIX script-modifier handling is outside this change.
Original contribution by @nine-codes.
* UI: open font dropdown and select font name on click (#5914)
* UI: select font name only on opening dropdown and scope to search (#5914)
* UI: refresh highlight from current font whenever combo opens (#5914)
* UI: restore font order and match enter ordering for highlight (#5914)
* UI: address review comments on font dropdown interactions and docs (#5914)
* UI: handle system font action in dialog font combos and test focus selection (#5914)
* UI: reset highlight on open and preserve query on scrollbar focus (#5914)
* UI: drop dialog routing changes to keep scope narrow (#5914)
* UI: test genuine blur and refocus while font dropdown is open (#5914)
* chore: cut over image codecs and zip to craft-libs, fix main test regressions
* tests: store ODS mimetype and use standard ODF namespaces in mailings test
* Remove unused quick-xml workspace dependency
* fix: use standard ODF namespaces in file_dialogs test and preserve trailing line in markdown import_on_with_lines
* fix(geom): use png_chunks for PNG dimensions and p.fits(budget) in decode_for_drawing
- Wire craft-wordmodel, craft-docx, craft-rtf (doc), and craft-doc-binary into workspace
- Delete ~26,300 lines of app-owned DOCX parser/serializer in crates/docx
- Implement zero-copy media transfer and FitState custom XML round-trip via craft_wordmodel bridge
- Delete ~5,400 lines of app-owned RTF parser/serializer in crates/formats/src/rtf
- Delegate RTF import, export, parse, and esc to craft-rtf
- Add cfb_guard DIFAT validation and float sanitization on model bridge
- Net reduction: 31,697 deletions, 818 insertions (-30,879 LOC)
#6537 declared a test change but committed 50 text files with CRLF, which
`cargo fmt --check` does not catch. Restore the bytes from c37baf76: no text
file carries CRLF, and the tree is identical to that commit again.
Refs #6537, #6539.
The #5858 early return kept page anchoring for any object that does not
move with text, which includes a body frame that came from an .odt with
text:anchor-type="page". Moving it then skipped the paragraph placement
and the save wrote the page anchor and number back, contradicting #5705's
an_odt_frame_moved_from_its_page_loses_the_page_number.
Only header/footer objects (and drops on a page with no anchoring text)
keep page anchoring now, which is what #5812 needed. The body test that
pinned the opposite is updated to the #5705 rule.
- Recognize a marked Fit One Page custom XML store across package and document
relationships, skipping passthrough only after loading successfully.
- Reserve the Fit One Page part path in EmbedWriter taken paths to prevent collisions.
- Track typography provenance per formatting location rather than sorted multisets.
- Validate stepPt parameter and reject non-positive or non-finite values.
- Report "already fits on one page" before an exhausted cumulative budget.
* docx: ignore w:lnNumType without w:countBy (#6209)
* DOCX: record the w:lnNumType rule in the parity docs (#6209)
A row for `w:lnNumType` (§17.6.8), its status line and a revision entry in
`docs/file-format-parity.md`, the progress-log bullet in `ROADMAP.md`, a comment in
the reader saying why a missing `w:countBy` leaves numbering off, and a save check in
the zero-interval test.
- Record original and reduced font sizes, line spacings and paragraph
spacings as multisets, so restoring neighbouring sizes clears the
exhausted budget, and paragraph spacing keeps the budget when line
spacing rounds back to its original.
- Resolve font and spacing budgets independently, letting the remaining
component be used instead of refusing the whole command.
- Persist FitState in a namespaced DOCX custom XML part and restore it on
read; add a DOCX round-trip regression.
Pass LayoutOptions::hides_deleted per story into the explicit-break scan and
the font floor, so hide_marked, revisions in balloons and moved-from text are
seen exactly as Print layout sees them. This keeps the guards from counting
deletions the page no longer contains.
- Anchor cumulative budget provenance to the original sizes and spacings
recorded before the first fit, instead of matching every current value
against every recorded value. Restoring body and heading sizes now resets
the budget.
- Build the initial and trial layouts from the session's hide_marked,
deletions_in_balloons and resolved numeral settings, so hidden or
ballooned deletions and numeral shaping paginate as in Session::layout.
- Add regressions for mixed body/heading sizes, mixed line spacings, and
Session::layout parity under non-default visibility and numeral settings.
The gate's Clippy flags needless_range_loop in the borderless/bordered table
fixtures. Iterate the rows and cells mutably instead; no behaviour change.
Resolve each cell's conditional table-style character formatting before
checking whether a page break is hidden, matching min_blocks_font_size and
layout's region selection. A first-row or banded hidden override now agrees
with Print layout. Add a regression with a hidden first-row override.
- Round paragraph spacing up to hundredths, so a very small value is never
reduced by more than the requested factor.
- Ignore page-break characters in hidden or tracked-deleted runs, matching
Print layout visibility, so a hidden break cannot force a refusal.
- Scale paragraph spacing without rounding a small value to zero or
compressing past the requested factor.
- Detect resolved page_break_before and nested table paragraphs as explicit
breaks, and refuse before evaluating candidates.
- Count non-text body items in the final-page volume limit.
- Give the ribbon button an accessible label and test it through the
rendered Layout ribbon in both themes.
* View: editable Markdown source view for .md files (#5826)
Co-authored-by: oldgranola <marken.john206@gmail.com>
* Address review feedback on Markdown source view
- Fix view.markdownSourceText purity and input validation
- Single-pass block line mapping in markdown parser
- Reuse parsed documents and block line ranges on apply and leave
- Bound memory usage with MAX_SOURCE_BYTES and clamp caret byte offsets
- Isolate temp directories in tests and test caret validation
- Preserve dirty state while markdown text edits are pending
- Flush pending markdown text edits in swap_doc
* Address CodeRabbit review feedback on Markdown source view
- Exempt view.markdownSourceText in command refusal
- Preserve original source line mapping when filtering link definitions
- Map between egui char indices and byte-offset caret in history and undo
* Remap block line numbers in a single linear pass
* Refuse over-limit Markdown Source edits to prevent document truncation
* Keep a Markdown file's own text when it is opened from handed-over bytes
`file.open` kept a Markdown file's exact text only for path-backed opens, so a
platform that hands the bytes over (data) lost front matter, comments and the
author's line endings on the first save, and the rewritten flag could not say
so. The kept text now comes from the same bytes `read_document` decodes, still
bounded by MAX_SOURCE_BYTES through FileText::from_bytes; the path read stays
for opens without data.
---------
Co-authored-by: oldgranola <marken.john206@gmail.com>
Co-authored-by: CommandCodeBot <noreply@commandcode.ai>