Skip to content

v1.152.0 - #1821

Merged
Azgaar merged 18 commits into
masterfrom
v1.152.0
Sep 9, 2026
Merged

Azgaar merged 18 commits into
masterfrom
v1.152.0

Conversation

@Azgaar

@Azgaar Azgaar commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Description

Azgaar and others added 7 commits September 7, 2026 23:37
* init - migrate main.js

* continue - options.ts

* continue - settings

* migrateSettingsFormat

* refactor: clean up comments and reorganize LOCKS_KEY declaration

* migrateSettingsFormat

* refactor: remove unused properties and update migration functions for legacy settings

* Refactor options usage to capitalize 'Options' throughout the codebase

- Updated references from 'options' to 'Options' in various files including export-json.ts, load.ts, save.ts, stats.ts, url-params.ts, debugUtils.ts, fileUtils.ts, unitUtils.ts, and preferences.ts.
- Introduced new storage migration logic to handle legacy settings and ensure compatibility with the current options structure.
- Added tests for storage migration and deep merging of options to validate the changes.
- Implemented a deepMerge utility function to facilitate merging of nested objects while preserving existing values.

* Refactor global Options to options and update related references

- Changed all instances of globalThis.Options to globalThis.options across multiple files for consistency.
- Updated tests and utility functions to reflect the new options naming convention.
- Ensured that all settings and configurations are correctly accessed through the new options object.
- Introduced options-model and options-store components to better manage application state and options.
- Adjusted local storage keys for options and locks to maintain compatibility with the new structure.

* graph globald remove

* viewport globals gone

* viewport

* mapId and mapHistory global gone

* ocean style fix

* fixes

* fixes

* init shell

* fixes

* architectural rework - non-final

* fixes

* fixes

* legacy options migration

* fixes

* fixes

* meh changes

* still bad

* unufied model

* update

* fixes

* format

* fixes

* fixes

* fixes

* fix

* fixes

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
…#1807)

* chore: add quill 2 as a dependency

* feat: rich text helpers for the notes editor on quill

* feat: notes editor on quill instead of the remote tinymce

* chore: drop the bundled tinymce

* fix: guard a leading script or style tag in the rich text check

* test: notes editor e2e on the bundled quill editor

* fix: keep ordinary spaces in saved notes and treat table headers as raw markup

* chore: bump to 1.151.3, changelog entry

* chore: re-pin the npm deps hash for the quill dependency

* fix: let the assistant's answers be selected and copied

* quill tools rework

---------

Co-authored-by: Azgaar <azgaar.fmg@yandex.com>
* docs: PRD for notes on entities

Replace the global notes side table with an optional note field on the
entity, widen note support to 17 entity types, and migrate existing maps
in one version step.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* feat: move notes onto the entities they describe

Replace the global `notes` side table with an optional `note` field on
the entity, and give markers the `name` the note used to carry.

- new components/entity-notes.ts: element id <-> entity resolution, note
  get/set/clear, the aggregate walk the editor and the font scan need
- notes editor lists notes grouped by entity type, exchanges csv
  addressed by entity, and drops the separate note title
- delete the ten lifecycle blocks that kept the array in sync: burg
  renumbering, regiment id rewrite on state merge, marker removal,
  added-label removal, the duplicate-marker-id patch, resample splicing
- auto-update distributes an old map's notes onto entities, collides
  river/route duplicates, folds a divergent note title into the text as
  a heading, and hands back what no entity claims as a csv
- .map field 4 is written empty from this version on

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* feat: notes for every note-bearing entity, and feature note restoration

- note buttons in the states, provinces, cultures, religions, biomes,
  zones, goods and markets tables, and in the journey and market dialogs
- every note button is dimmed until its entity has a note
- Features.captureUserData/restoreUserData match a feature's name and
  note back by grid cell after the graph is rebuilt, so a heightmap edit
  that keeps a lake keeps what the user wrote about it; resample carries
  the note along with the name it already carried
- tests for the resolver, the migration and the feature restore
- data model, glossary and wiki describe notes as an entity field

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* refactor: Notes store, shared button markup, contained legacy migration

- entity-notes exports a NotesStore singleton (Notes.get/set/list/...)
  following the Pins and Layers convention, replacing loose functions
- drop the inactive state on note buttons: having no note is normal
- every note button comes from Notes.getButton(id, subject) or
  Notes.getIcon(subject), so the markup and tip are written once
- the v1.152.0 note migration lives entirely inside its isOlderThan
  block: no module state, and the older blocks that renumber markers and
  added labels record a rename map instead of editing notes; the
  unattached notes come back as the migration's return value

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* refactor: move the Notes store to generators, offer orphans from auto-update

Notes sit next to the data they annotate, and the store has controlling
methods, so components/entity-notes becomes generators/notes.

The unattached-note csv is offered from inside the v1.152.0 block, only
when the migration actually found some, so the loader no longer carries
a result through just to open a dialog.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* refactor: remove outdated notes mapping and auto-update details from data model documentation

* feat: enhance notes functionality and editor interactions for entities

* fix actions column

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
@Azgaar
Azgaar requested a review from barrulus September 9, 2026 08:56
@Azgaar Azgaar self-assigned this Sep 9, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in FMG dev board Sep 9, 2026
@netlify

netlify Bot commented Sep 9, 2026

Copy link
Copy Markdown

Deploy Preview for afmg ready!

Name Link
🔨 Latest commit 644534b
🔍 Latest deploy log https://app.netlify.com/projects/afmg/deploys/6aa1abe910196d0008ffbaae
😎 Deploy Preview https://deploy-preview-1821--afmg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@barrulus

barrulus commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Ran the branch locally (tsc / 897 vitest / biome clean; headless boot, legacy prefs adoption,
all three fixtures load → zoom/pan → SVG export → save → reload). The #1666 follow-ups
(string burg-group filters, regenerate prompt after load) are fixed and verified. Notes migrate
correctly on the fixtures and round-trip; culling and full-map export behave.

CI is red: Biome latest flags organizeImports in the three new renderer tests, and
layers.spec.ts › burgs/icons layer needs its #icons snapshot refreshed for the viewport
renderer.

Found, all reproduced in a browser unless marked:

  1. Notes lost for maps saved by a 1.152.0 build before 6390273package.json was
    1.152.0 from the first commit, so a save from the earlier previews has version 1.152.0 and a
    full data[4]; the migration gates on isOlderThan("1.152.0") and load no longer reads the
    field. Silent, no csv offer. Gate on a non-empty data[4] instead (or bump to 1.152.1).
  2. Notes Editor "Focus" offers to delete the note of any off-screen burg/marker/market
    validateHighlightElement looks the element up in the DOM, which the viewport renderers
    no longer hold. Check pack and zoom to the entity instead.
  3. Legacy state/province notes get an <h3>ShortName</h3> heading — the labels editor
    titled them with the short name; the migration compares to fullName. "Duchy of
    Crystormia" → <h3>Crystormia</h3><p>…</p>.
  4. Saved dialog positions restore off-screen — no clamp on restore; a dialog dragged on a
    wide monitor and reopened in a narrower window is unreachable until cleanupData.
  5. (code) Feature restore matches by cell overlap only: a named/noted lake raised to land hands
    its name+note to the enclosing island — add a type check.
  6. (code) Lakes never show their note on hover: <use href="#feature_N"> has no id, the tooltip
    resolves by element id.
  7. (code) The duplicate-marker-id repair now runs after the notes migration, so the renumbered
    marker loses its note.

Smaller: draw-markets.ts template writes literal false/undefined text nodes into partial
views (and the saved SVG); marker notes titled with their own id become the marker name;
markers-in-radius still writes the retired pinned attribute; contour paths add ~30 % to a
.map at interval 1 (linear in cells); Changelog vs latestPublicChanges disagree and neither
lists the markets renderer.

@barrulus

barrulus commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Ran the branch at 1f84f46 over 777 saved maps (Discord attachments 2019–2026, versions
0.58b–1.150.0) and the merge base c222645, headless, fresh profile per map, then save → reload
on the branch. I have the per-map table with the Discord link of every failing file; say if you want it.

  • No load regressions. 628 maps load on the branch vs 622 on master; the 6 extra are files
    master rejected (mapSize on number, options.military is not iterable, Unterminated string in JSON, getWinds) — the repair-not-reject parsing pays off. Pack counts are
    identical on all shared maps; save → reload is identical on 621/628.
  • 146 maps fail on both builds, pre-existing and catalogued by error and version in the
    spec: 40× 0.70a/0.80b flatMap in Lakes.defineShoreline, 10× 1.0/1.1 neighbors.map, 9×
    striping, 7× split in parseLoadedData, 6× habitability in goods, ~12 corrupt JSON, 6
    files whose CRLF delimiters were converted to LF.

Findings:

  1. Notes: 180 of 628 maps (29%) open with "Notes without an element", and 92% of the 32,389
    notes offered are stale auto-generated regiment descriptions.
    Old builds never pruned
    regimentS-R notes when a military was regenerated; one 1.105 map carries 19,300 notes of
    which 19,232 are dead regiments and 68 are real. Suggest dropping unmatched regiment notes
    silently (they are generator output) or splitting the count, so the dialog is about what the
    user wrote.
  2. Pre-1.83 version strings compare wrongly, and the notes migration turns that into
    loss.
    parseMapVersion("1.61") is 1.61.0, so isOlderThan("1.7.0") is false for
    1.61–1.66 maps and the v1.7 marker migration never runs; likewise 1.11/1.22 skip the 1.3–1.7
    blocks, 1.7/1.8 re-run the 1.61–1.652 blocks, and "0.9b" (→ 0.9.0 < 0.70.0) is rejected as
    ancient while 0.70a/0.80b get through. Since eb29c5e (2024-09); before that the gates were
    numeric. In this corpus 98 of 105 loadable 1.11/1.22/1.6x maps keep their markers as SVG
    <use> elements with pack.markers empty. On master that is invisible; on the branch their
    markerElementN notes (2,174 notes on 99 maps, e.g. a 1.61 map loses 244 of 424) are offered
    as CSV and dropped. Fix outside this PR: parse compact versions monotonically
    (1.22 → 1.2.20, 1.61 → 1.6.10, 1.652 → 1.6.52, 1.7 → 1.7.0) and pass the gate strings through
    the same parser; then the v1.7 block converts the markers and noteRenames keeps the notes.
  3. lake_N (232 notes on 8 maps) and roadN ids are not in ELEMENT_PATTERNS — old
    feature/route ids carrying hand-written lore.
  4. LOW: a 1.22 map with a legacy #fogging nested in #fogging-cont ends up with two
    #fogging groups after save → reload.

@Azgaar
Azgaar merged commit d00e331 into master Sep 9, 2026
11 checks passed
@Azgaar
Azgaar deleted the v1.152.0 branch September 9, 2026 19:17
@github-project-automation github-project-automation Bot moved this from Backlog to Done in FMG dev board Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants