Skip to content

macOS: the encounter template editor (step 3, phase 4, stage 7c) - #132

Merged
brahm merged 32 commits into
mainfrom
claude/project-thread-wd4xxt
Oct 29, 2026
Merged

brahm merged 32 commits into
mainfrom
claude/project-thread-wd4xxt

Conversation

@brahm

@brahm brahm commented Oct 29, 2026

Copy link
Copy Markdown
Owner

Summary

This is the last of the three user-database pull requests for the Mac app. With it, every section of the user databases can be edited on macOS.

The template editor (templates.rs)

  • Encounter templates open in the same record sheet as other records, as a new Editor::Template case of RecordSession.
  • The editor has seven pages:
    • Template: name, monster type and notes.
    • Monsters, NPCs, Items and Traps: one line per entry, with Edit… and Remove, and Add beside the heading.
    • Treasure Types.
    • The 2-20 table information: placement, frequency, hit dice, category and climates.
  • Several things open in a dialog over the page, and the most recent one is the one shown:
    • a line's Properties: dice, percent chance, dependency, the random list with its combo and second box, and for items the coins, escorts and doubles;
    • the monster, item and trap pickers, with their filters and search, and the list capped at 200;
    • an escort's numbers;
    • NPC Creation in template mode, where "Add to Template" hands the generated NPC back to the template.

NPC form (npc.rs)

  • The New NPC form is now generic over the input type, so the template editor reuses it.
  • In template mode it hides the ability scores, as the original does.

Wiring

  • act_on now gets the NPC rules and dice lazily, only when a template opens.
  • edited_here now includes every section of the user databases.
  • The roadmap marks the user databases as done.

There are no new texts to translate.

Checks

  • cargo fmt, cargo clippy -D warnings and cargo test pass on cr-app, cr-mac-ffi and cr-i18n.
  • Swift is built in the macOS CI job.

Generated by Claude Code

claude added 30 commits October 29, 2026 14:03
The Mac app in macos/CoreRules, in SwiftUI, with the scope of the
Windows prototype: the library in three columns with its search, the
first page of New Character, the character's description in Edit
Character, Delete with its confirmation, Import… of a package (also
from the Finder), the sheet printed, saved as PDF and exported, and
Settings with the language.

cr-mac-ffi gains the wizard, the editor and the import as sessions over
cr-app's state machines, the sheet as PDF and exports, and Delete.
The translation extraction reads the Swift sources too; one new text.
macos/scripts/make-app.sh builds Core Rules.app with swiftc, signs it
ad hoc and packs the .dmg, which CI builds and keeps.
NOT_YET_ON_MACOS loses the ten actions the prototype has.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiPLVTLx5V4CMD9nZUR12R
The main window's body was too large for the type checker; each part is
a view of its own now, with typed bindings. SwiftUI's Group is named in
full where the bridge's Group would shadow it, and the number fields
take an explicit UInt32 format.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiPLVTLx5V4CMD9nZUR12R
The weapons section draws the sword the GNOME and Windows apps draw,
which SF Symbols lacks, instead of a hammer. Read Me First leads with
removing the quarantine in Terminal, which opens the app where Open
Anyway is not offered.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiPLVTLx5V4CMD9nZUR12R
cr-mac-ffi gains the library's filters (origin, party, part type, Magic
Only), the commands an entry offers, the items' icons and the pictures
(a monster type's frames, Full Screen), Convert to Character and to
NPC, and the sheet as a session: a character's sheet or the page of an
encounter, table, template or treasure, its PDF, exports and Character
Sheet Options.

The Mac app filters the list, shows those pictures and Core Rules 2.0
as read-only, and opens a sheet in a window of its own: the PDF it
prints, in PDFKit, with Print, Save as PDF, Export and Character Sheet
Options. The menu bar's Print and Save act on the sheet's window in
front.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiPLVTLx5V4CMD9nZUR12R
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiPLVTLx5V4CMD9nZUR12R
The help in a window of its own with its books, search, links, popups,
Back and Print; Help on the screen in front, on the entry in view and on
a monster; About with What's New, Credits, Legal and Troubleshooting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiPLVTLx5V4CMD9nZUR12R
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiPLVTLx5V4CMD9nZUR12R
Read Book opens a book in a window of its own, with its contents, Find,
zoom and the reading position kept between sessions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiPLVTLx5V4CMD9nZUR12R
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiPLVTLx5V4CMD9nZUR12R
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiPLVTLx5V4CMD9nZUR12R
Every page of the wizard, described by the bridge as a form and drawn by
one SwiftUI view; its questions, Choose Portrait, Enter Character's
Levels, and Create.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiPLVTLx5V4CMD9nZUR12R
Describe each page of cr_app::editor as a form, as the Windows app's Edit
Character draws it: Details (with Add Class, Levels… and Add…),
Abilities, Combat, Proficiencies, Skills (with Test and Roll for wild
talents), Spells and Equipment (with the items' icons). The Swift sheet
picks the page with a segmented control and draws it with FormView.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiPLVTLx5V4CMD9nZUR12R
Describe the NPC generator's forms as forms in a sheet, whose Create makes
and saves the NPCs off the main thread, and give Roll on a Table a window
of its own with Roll, Roll Again, Copy Results and Read in Book. The
generators share the random numbers and what the tables leave for the
next roll, kept by the library. They are in a new Tools menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiPLVTLx5V4CMD9nZUR12R
Describe the treasure roller as a form in a window of its own: the
treasure types, Accumulate Rolls and the coin, the treasure as a tree
with each item's Remove, Move Into and Edit Spells, the bundle editor's
dialogs, and the Calculate summary. The toolbar rolls, resets, saves,
prints, saves as PDF and deletes the saved treasure; Edit and Copy open
a saved treasure from the library, and Roll on a Table opens the roller
where the roll says to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiPLVTLx5V4CMD9nZUR12R
The encounter in a window of its own: New Encounter's templates, then
the Encounter page of cr_app::encounter described as a form, with its
packages, hit points, pickers, items, treasure (Roll Treasure opens the
roller with Use Treasure), traps, Save, Print, Save as PDF and Delete.
The 2-20 table editor in another window, with Fill, Roll and the
roll's template dialog. Edit, Copy and Create Encounter on the saved
encounters, tables and templates in the library.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiPLVTLx5V4CMD9nZUR12R
Manage Parties in a sheet: the lists of cr_app::parties described as a
form, with the party chosen, New Party, the buttons that move each
character, Delete Members and Group Encounter's dialog, which opens the
encounter of the party's NPCs or prints or shows their page. Labels of
the catalogs lose their mnemonic in the forms' rows too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiPLVTLx5V4CMD9nZUR12R
RecordSession describes each page of cr_app::records::form as a form,
every kind of field drawn (with new rows for dice, tables of numbers by
level and pictures), with the dialogs its fields open, its questions,
Choose Picture and Save. The Mac app edits a record in a sheet: New in
the list's toolbar and the File menu, Edit, Copy, New Subrace,
Schools… and Delete on a record, New Part asking for the type, and New
Trap, New Monster and the traps' Edit, Copy and Delete from the
encounter's pickers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiPLVTLx5V4CMD9nZUR12R
The record sheet now edits a treasure table and a race's Allowed
Classes as well as a record: RecordSession holds one of the three
editors, each described as a form, the table's entry details and
"How many to remove?" in a dialog over it. Allowed Classes… and
Restore join the record's More menu, Restore asked first, and leave
the list of actions not yet on macOS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiPLVTLx5V4CMD9nZUR12R
The record sheet edits an encounter template too: its seven pages
described as forms, and in a dialog over them a line's Properties, the
monster, item and trap pickers, the numbers of a monster that comes
with an item, and NPC Creation in template mode, whose Add to Template
hands the NPC to the template. Every section of the user databases is
now edited on macOS.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NiPLVTLx5V4CMD9nZUR12R
@brahm
brahm merged commit bb1861d into main Oct 29, 2026
3 checks passed
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.

2 participants