Commit Graph
723 Commits
Author SHA1 Message Date
aiongg cd25951cd8 Merge commit 'e8b4dde5' into docking-native-ime 2026-10-26 02:22:57 +00:00
aiongg 28f4036f3b docking: native floating windows publish their IME descriptor
A native floating window is an egui pass of its own, and can draw several
panel bodies. A Composer drawn there records its descriptor, and the dock
area publishes it once, after the window's last body, so a body drawn after
the editor's cannot clear it and end the composition. DockContent::window_drawn
runs at the same point for apps that publish their own descriptor.
2026-10-26 02:21:16 +00:00
aiongg e8b4dde513 Merge remote-tracking branch 'upstream/main' into lang-4-window 2026-10-26 02:13:23 +00:00
aiongg 1e6f127844 docking: a drop beside a too-narrow frame at its row's edge takes room from the other side (#353) 2026-10-25 22:13:01 -04:00
aiongg c692b6816d Merge remote-tracking branch 'upstream/main' into docking-native-ime 2026-10-26 02:05:07 +00:00
aiongg 9f89fe8f6d Add craft-menu: one menu definition, native on macOS and an egui bar on Windows, Linux and web (#66)
* Add craft-menu: Mac menu-bar layout and native-menu driver

A platform-free menu model (built directly or from flat rows), the macOS
layout (app menu, Window, Help, system-key clash resolution, translatable
labels), and NativeMenu, which feeds a backend's key equivalents to egui as
key presses, runs Minimize and craft-quit's Quit, and re-syncs only when the
app's state changes. Generalised from PhotoCraft's native_menu.rs.

* craft-menu: macOS menu bar through muda

* craft-menu: clipboard keys, layout-assigned shortcuts, Hide Others and atomic rebuilds

* craft-menu: menu key equivalents run while a text field has the keys

* craft-menu: commands as CommandRef, item kinds, craft-keymap chords

Items and rows run a craft_keymap::CommandRef and take a craft_keymap::Chord
shortcut; crates/menu/src/chord.rs is gone. Native ids are the command's key,
made unique with #2, #3 when a command is shown twice. Item.checked becomes
ItemKind { Plain, Check, Radio } (radio shows as a check item on macOS).
The built-in items' commands are Builtin::{Hide, HideOthers, Minimize, Quit}.
MenuRole gains Edit, View and Other; tag_submenu finds its menu by role.
While text editing, the keys left to the field are the clipboard keys and
craft_keymap::text_editing_chords. Adds the Platforms, Document and Gate types
(data only) and MenuBar::documents.

* craft-menu: Gate::allows, the one rule for what may run from the menus

* craft-menu: Windows, Linux and web layouts, documents in Window, keymap adapter

layout(bar, Target, options) dispatches to mac_layout, desktop_layout or
web_layout. Every layout drops what the target's Platforms leave out and lists
MenuBar::documents as radio items last in the Window menu (ItemRole::Document
is gone). Windows and Linux put About in Help, Settings in Edit as
Preferences and Quit in File (Exit on Windows); the web layout has no Quit and
takes the browser's own shortcuts off the items, reporting clashes. tidy drops
empty submenus.

apply_keymap sets shortcuts and toggle check items from a craft-keymap Keymap;
apply_state sets enabled and checked per frame.

* craft-menu: the egui-drawn menu bar for Windows, Linux and the web

* craft-menu: gate, command hook and one muda handler for the native menu

- NativeMenu::set_gate: app items greyed in place while modal or recording a
  shortcut; take_clicks drops clicks the gate forbids when they are taken.
  While recording, key equivalents reach egui as plain key presses.
- NativeMenu::on_command: a hook called from the menu event handler for each
  allowed app click; take_clicks still returns every command.
- Dispatch, shared between the driver and the backend's handler
  (Backend::attach replaces Backend::set_text_editing).
- Only Cmd or Ctrl chords become key equivalents; other shortcuts are not
  shown natively (building an attributed title needs unsafe objc2 calls).
- mac: one muda event handler per process, routed to the latest install;
  mac::install_app_menu ports craft-quit's minimal app menu onto it.
- craft_quit::install_app_menu is deprecated in favor of
  craft_menu::mac::install_app_menu.

* craft-menu: the bar takes Target, README section and NOTICE credit

* craft-menu: bar tests beside the layout and native ones; only a click outside closes the menus

* craft-menu: clippy (complex types, Copy clones, elided lifetimes)

* craft-menu: keyboard access to the egui bar

A tap on Alt alone or F10 focuses the bar, Alt+letter opens a menu and
a letter in an open menu runs or opens the row with that mnemonic, as
in a Windows menu bar. Mnemonics are assigned per level from the shown
labels, underlined only while the keyboard drives the bar, and a label
without an ASCII letter shows its English letter after it ("文件(F)")
through the optional english hook. Preferred letters come from
MenuBarUi::mnemonics. A Mac target has none, and a dialog or the
shortcut recorder keeps the keys. Ported from PhotoCraft's menu_keys.rs
and menu_keys_tests.rs.

* craft-menu: one installer or the other; sort mnemonics before checking uniqueness

* craft-menu: egui 0.37

* craft-menu: text fields keep their Edit items; web names by the browser's system; sync per frame; stable check kinds; handled hook clicks

* craft-menu: sync reports a clash change on an unchanged bar
2026-10-25 21:59:22 -04:00
aiongg f85b11b8e4 docking: AppKit moves a native window for its bar drag on macOS (#341)
* docking: AppKit moves a native window for its bar drag on macOS

Moving a native window with OuterPosition every frame jitters on macOS:
the window's reported place and the pointer events disagree about where
the window is. On macOS the bar press (or the start of a drag of a
window's only tab or group) now sends ViewportCommand::StartDrag, which
winit turns into performWindowDragWithEvent, and the dock area sends no
OuterPosition for that drag.

egui keeps running frames during the move, but the window's reported
place lags it, so each frame takes the window's place as AppKit's
cursor (NSEvent::mouseLocation) less the pressed point. Drop targets,
the drag fade, cross-window routing and the drop use that point. The
drag ends on the first frame where NSEvent::pressedMouseButtons or egui
reports the release, and is resolved once; a desktop drop records
cursor less grab. Ctrl/Cmd is read from AppKit's modifier flags, since
AppKit sends no key events during the move, and Escape does not cancel
the move. A press released within the click distance docks nothing.
Windows, X11 and Wayland keep their paths.

The window system seam (WindowSystem, formerly DesktopCursor) tells the
cursor, the button, the modifiers and whether it moves windows.
NativeHost models AppKit's move (moves_windows, held): the window
follows the cursor at the grab and reports its place late. The
app-driven cursor path from #325 and its stale-pointer model are
removed, since macOS no longer takes that path.

* docs: a cancel during an AppKit bar drag leaves the window moving
2026-10-25 21:58:02 -04:00
aiongg 1a14a6802f Merge branch 'lang-3-fonts' into lang-4-window 2026-10-26 01:55:56 +00:00
aiongg 1f1c1ab490 Merge branch 'lang-2-ui' into lang-3-fonts 2026-10-26 01:55:48 +00:00
aiongg fdd6ad530e Merge remote-tracking branch 'upstream/main' into lang-2-ui
# Conflicts:
#	Cargo.lock
2026-10-26 01:55:42 +00:00
aiongg 5e31171462 Merge branch 'lang-1-text' into lang-2-ui 2026-10-26 01:55:34 +00:00
aiongg fdecd50f47 font-store: removing a family's last style keeps files the store didn't install 2026-10-26 01:55:20 +00:00
aiongg f4c6718d68 craft-text: a locale's script must match the hyphenation patterns' script 2026-10-26 01:54:26 +00:00
skylar taylor-barrick cb53221767 fix(print): stop relying on inflate error output; bump miniz_oxide to 0.9 (#348)
* fix(print): do not treat early inflate errors as partial output

* chore(deps): bump miniz_oxide to 0.9
2026-10-25 20:37:49 -04:00
Dylan M. Taylor e3bcd5657f update(install): retry a busy disk-image attach for about a minute (#349) 2026-10-25 19:56:47 -04:00
Dylan M. Taylor c5a345e472 Merge pull request #347 from storytold/chore/deps-safe-refresh
chore(deps): safe dependency refresh (serde_json, fixed_decimal, roxmltree, miniz_oxide)
2026-10-25 19:03:41 -04:00
skylar 8e42b9ff4e fix(print): keep miniz_oxide at 0.8 2026-10-25 16:52:57 -06:00
skylar ce020c5811 chore(deps): bump roxmltree, miniz_oxide, serde_json, fixed_decimal
craft-print: roxmltree 0.20 -> 0.21 (locked 0.21.2, fixes a stack
overflow on deeply nested XML) and miniz_oxide 0.8 -> 0.9.
Lockfile only: serde_json 1.0.154, fixed_decimal 0.7.3.
2026-10-25 16:35:43 -06:00
Dylan M. Taylor 495e5971bc Merge pull request #344 from dylanmtaylor/fix/update-prompt-glyphs
fix(update): draw the prompt's close mark and version pill without glyphs a font may lack
2026-10-25 16:36:37 -04:00
Dylan M. Taylor 47edfe3255 fix(update): use egui::Role for the close button's accessibility info 2026-10-25 16:31:38 -04:00
Dylan M. Taylor 4f6fe25d77 fix(update): draw the prompt's close mark and version pill without glyphs a font may lack
The close button was a ✕ (U+2715) text glyph and the version pill used →, neither of which the bundled faces are guaranteed to have; apps that panic on a missing glyph took the whole prompt down. The close mark is two painted strokes, the pill reads 'v0.1.0 to 0.2.0', and a test asserts the prompt paints only ASCII text.

Fixes #343
2026-10-25 16:31:12 -04:00
aiongg 0ca797fbcd Merge branch 'lang-3-fonts' into lang-4-window 2026-10-25 19:44:12 +00:00
aiongg e51a392278 Merge branch 'lang-2-ui' into lang-3-fonts 2026-10-25 19:44:10 +00:00
aiongg 91eb5f19cd ui workflow: path filters list craft-ui and craft-i18n only 2026-10-25 19:44:08 +00:00
aiongg 47b9e5bf05 Merge branch 'lang-3-fonts' into lang-4-window 2026-10-25 19:42:40 +00:00
aiongg 402828151d Merge branch 'lang-2-ui' into lang-3-fonts 2026-10-25 19:42:34 +00:00
aiongg 5120c0ce2d Font store and Font Manager: review fixes
- FontStore::remove_files only touches names the family's manifest entry
  lists and that are safe file names.
- A user source's folder carries a hash of its full ID, so sources whose
  IDs slug alike don't share a folder.
- The download dialog and the sidebar note name the family's own source,
  and the server for a source the user added.
- The face cache takes out only faces the last frame didn't draw.
- The catalog test lists missing translations instead of failing.
- ATTRIBUTION lists the three bundled craft-font-index files.
2026-10-25 19:41:46 +00:00
aiongg 4617a971ae craft-ui, craft-fonts-build: harness direction, caret clamp, served-face conversion, byte-equal font copies 2026-10-25 19:40:45 +00:00
aiongg 4577959305 Merge branch 'lang-1-text' into lang-2-ui 2026-10-25 19:37:14 +00:00
aiongg a04bb9da2a craft-text: locale codes with a script or year subtag; Slovak data through feature unification 2026-10-25 19:37:05 +00:00
aiongg e3b9e239c5 docking: a window-edge drop beside an iconic column highlights only the edge (#336)
A group dragged to the window edge where an iconic column sits showed the
edge line and an outline around the column. The edge line is drawn just
inside the window, so it lay in the column's body, and paint_drop_line
outlines the iconic column a line lies in. That outline is for drops into
the column; a window-edge drop docks beside it, so it now shows the line
alone.
2026-10-25 15:20:32 -04:00
aiongg f8a83e8204 craft-window: window list, cascade placement, Window menu and viewports for apps with one window per document 2026-10-25 19:09:54 +00:00
aiongg 06a4ec194a craft-font-catalog, craft-font-store and craft-font-manager: installed fonts, the font store and the Font Manager panel 2026-10-25 19:09:33 +00:00
aiongg 3c574ddc61 craft-ui: interface fonts, text direction, IME composer, localized widgets and screen testing
craft-fonts-build gains Embed::serve (served faces for web builds) and the coverage module that craft-ui's fonts use.
2026-10-25 19:08:59 +00:00
aiongg acf6f79739 craft-text: hyphenation, line-break segmentation, bidi and line breaking 2026-10-25 19:08:20 +00:00
Dylan M. Taylor db19c373c8 Merge pull request #333 from dylanmtaylor/fix/updater-pending-close
fix(update): keep the close request pending while the app holds unsaved work
2026-10-25 15:03:02 -04:00
aiongg 271594c081 window: the title bar's empty area takes no keyboard focus (#334) 2026-10-25 14:36:07 -04:00
Dylan M. Taylor 05c9f70e6e fix(update): keep the close request pending while the app holds unsaved work
A user can dismiss the prompt while the update installs and then edit. The close request is now kept until the app can close, so a close the user cancels is asked again once the work is saved. The installed message is set when the install finishes.
2026-10-25 14:05:40 -04:00
Dylan M. Taylor 5b0f3c572a Merge pull request #332 from dylanmtaylor/feat/updater-can-start
feat(update): Updater::show_if holds the install back while the app has unsaved work
2026-10-25 14:03:27 -04:00
aiongg c13668493c docking: test send_keys from a native input hook (#331) 2026-10-25 14:02:27 -04:00
Dylan M. Taylor 12f199b2b5 feat(update): Updater::show_if holds the install back while the app has unsaved work
The restart helper is scheduled before the app closes, so a close the user then cancels would leave it waiting for an exit that never comes. Apps pass whether it is safe to start.
2026-10-25 13:55:49 -04:00
Dylan M. Taylor b9ba47f589 Merge pull request #330 from storytold/fix/zip9-windows
fix(update): zip 9's entry name is fallible (Windows build)
2026-10-25 13:18:52 -04:00
Dylan M. Taylor f3540a1327 fix(update): check the executable's name before the app quits for an update
windows_precheck now refuses an executable that isn't the app's own, as the helper does, so the error is shown while the app can still show it. check_helper keeps the same check as the final guard.
2026-10-25 13:18:35 -04:00
Dylan M. Taylor 51da82901c test(update): a standalone executable updates from the portable zip
Detection now treats any executable as a standalone install, so the helper's test no longer expects a refusal once portable.txt is gone.
2026-10-25 13:12:18 -04:00
Dylan M. Taylor 8b7e8a13de fix(update): the update helper only restarts the app's own executable
check_helper accepted any existing file as a standalone install, so a differently named executable passed (the Windows test caught it). The program's name must be one of the app's own.
2026-10-25 13:05:31 -04:00
Dylan M. Taylor dbc86fdbf3 fix(update): zip 9's entry name is fallible
Fixes the Windows build after the move to zip 9: an entry whose name can't be read counts as unsafe.
2026-10-25 12:59:00 -04:00
Dylan M. Taylor a0916808f7 Merge pull request #268 from storytold/migration/egui-037-20261024
Migrate shared UI to egui 0.37 and preserve current docking and printing fixes
2026-10-25 12:57:14 -04:00
Dylan M. Taylor 9eba2520da fix(update): clean clippy on macOS and Windows
The macOS module imported staging_dir without using it, and the Windows helper never used its app argument.
2026-10-25 12:55:32 -04:00
Dylan M. Taylor 6ff2a458b4 Merge remote-tracking branch 'storytold/main' into migration/egui-037-20261024 2026-10-25 12:54:10 -04:00
Dylan M. Taylor 1c59a349f0 Merge pull request #327 from dylanmtaylor/fix/update-deny
fix(update): drop dirs, move to zip 9, add an Updater for egui apps
2026-10-25 12:50:44 -04:00