# Waymarks Changelog ## v0.8.3 ### Added - **Internationalization** — All user-facing strings moved to `lang/en.json`. Settings names and hints, button titles and placeholders, dialog text, theme names, picker labels, notifications, and author badges all route through `game.i18n.localize()` / `game.i18n.format()`. Key namespace: `WAYMARKS.*`. ### Changed - **Compatibility** — `module.json` verified through Foundry v14. Minimum remains v13. No v14-only APIs introduced. - **Permissions dialog** — Replaced custom `eq` Handlebars helper (not shipped by Foundry core) with the built-in `selectOptions` helper. Eliminates "Missing helper: eq" errors in worlds whose game system doesn't register it. - **Scene controls injection** — Guard now accepts both `"tokens"` (v13) and `"token"` (v14 fallback). Added comment flagging these as internal selectors requiring re-verification on major Foundry versions. - **Pointer events** — `WaymarkElement` drag, resize, and all `stopPropagation` guards converted from `mouse*` to `pointer*` events for touch and stylus support and to prevent stranded listeners when the pointer is released off-window. - **Hotbar reference** — `_centerPosition()` now uses `ui.hotbar?.element` (normalized to `HTMLElement`) before falling back to raw DOM queries, consistent with the `ui.controls` and `ui.sidebar` approach. - **Optional chaining** — Replaced `x && x.method()` guard idioms with `x?.method()` throughout `waymarks.js`. - **`NoteManager.registerSettings`** — Comment updated to mark the method as an intentional stable extension point, not transitional dead code. ### Fixed - **`isDark()` guard** — Now returns `false` early for non-string or short hex values instead of producing `NaN` channels. - **`_hex()` guard** — Returns `[0, 0, 0]` for non-string or short inputs, protecting all downstream color math (`_darken`, `_brighten`, `_tint`, terminal/neon background computation). ## v0.8.2 ### Changed - Added plain-English block comments throughout all seven script files explaining what each class, method, and logical block does and why. ### Fixed - **Toolbar button not appearing** — The `renderSceneControls` guard was checking `app.activeControl === "token"` but Foundry v13 uses `"tokens"` (plural). Also replaced the deprecated `app.activeControl` with `app.control?.name`. - **Game Settings dialog appearing behind notes** — Replaced the MutationObserver z-index approach with a fixed z-index band (10–99) for notes, keeping them permanently below Foundry's window layer (100+). - **Text color not flipping on dark backgrounds** — `NoteManager.isDark()` existed but was never called. Now wired up in `WaymarkElement` to set `--wm-auto-text` so sticky, index card, classified, and tavern themes flip to white text when the user picks a dark background color. - **Permission closures going stale after setting changes** — `playerEdit` and `playerPin` settings now trigger `rebuildAll()` when toggled, so notes immediately reflect the new permissions without requiring a scene change or refresh. Added `rebuildAll()` method to `WaymarkRenderer`. ## v0.8.1 ### Fixed - **Magic ownership numbers in socketlib handlers** — `createNoteAsGM` and `sendNoteToGM` were using raw `0`, `2`, `3` for ownership levels. Both now use `CONST.DOCUMENT_OWNERSHIP_LEVELS.NONE`, `OBSERVER`, and `OWNER`, destructured once at the top of the `socketlib.ready` hook. Removed two remaining debug `console.log` calls from those handlers. ## v0.8.0 ### Changed - **`UniversalNoteLayer` renamed to `WaymarkRenderer`** — The old name implied a Foundry canvas layer; notes live on the HTML interface layer. All references updated. - **`WaymarkLayout` migrated to `game.settings` client scope** — Note positions and sizes are now stored via Foundry's settings API (`scope: "client"`) instead of raw `localStorage`. All layout data is stored as a single object keyed by note ID. Properly namespaced and lifecycle-managed by Foundry. (Note: existing `localStorage` positions will not carry over automatically.) - **`WaymarkThemePickerApp` migrated to `HandlebarsApplicationMixin(ApplicationV2)`** — Replaced deprecated `FormApplication` with the v13 application pattern. Removed jQuery from `activateListeners`. Template updated to remove outer `