diff --git a/AGENTS.md b/AGENTS.md index e7ea250..78be1fd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -129,7 +129,7 @@ Single-context: `CONTEXT.md` + `docs/adr/` at the repo root. See `docs/agents/do # GitNexus — Code Intelligence -This project is indexed by GitNexus as **museion** (2285 symbols, 5850 relationships, 138 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely. +This project is indexed by GitNexus as **museion** (2295 symbols, 5861 relationships, 138 execution flows). Use the GitNexus MCP tools to understand code, assess impact, and navigate safely. > Index stale? Run `node .gitnexus/run.cjs analyze` from the project root — it auto-selects an available runner. No `.gitnexus/run.cjs` yet? `npx gitnexus analyze` (npm 11 crash → `npm i -g gitnexus`; #1939). @@ -177,6 +177,7 @@ Session logs live in `docs/devlog/` (one per completed task/issue/milestone). Fu | Date | Log | |------|-----| +| 2026-10-08 | [20261008-issue84-view-menu-doubled_log.md](docs/devlog/20261008-issue84-view-menu-doubled_log.md) | | 2026-10-08 | [20261008-issue83-save-indicator-honesty_log.md](docs/devlog/20261008-issue83-save-indicator-honesty_log.md) | | 2026-10-08 | [20261008-issue77-editing-parity_log.md](docs/devlog/20261008-issue77-editing-parity_log.md) | | 2026-10-06 | [20261006-issue76-apex-html-reading_log.md](docs/devlog/20261006-issue76-apex-html-reading_log.md) | @@ -185,5 +186,4 @@ Session logs live in `docs/devlog/` (one per completed task/issue/milestone). Fu | 2026-10-03 | [20261003-issue18-post-lifecycle_log.md](docs/devlog/20261003-issue18-post-lifecycle_log.md) | | 2026-10-01 | [20261001-issue17-home-posts-list_log.md](docs/devlog/20261001-issue17-home-posts-list_log.md) | | 2026-10-01 | [20261001-issue55-verdict-substrate-adr-0010_log.md](docs/devlog/20261001-issue55-verdict-substrate-adr-0010_log.md) | -| 2026-09-25 | [20260925-issue50-profile-backup-s2-6_log.md](docs/devlog/20260925-issue50-profile-backup-s2-6_log.md) | -| 2026-09-16 | [20260916-issue14-acp-bridge-s2-2_log.md](docs/devlog/20260916-issue14-acp-bridge-s2-2_log.md) | +| 2026-09-25 | [20260925-issue50-profile-backup-s2-6_log.md](docs/devlog/20260925-issue50-profile-backup-s2-6_log.md) | diff --git a/docs/devlog/20261008-issue84-view-menu-doubled_log.md b/docs/devlog/20261008-issue84-view-menu-doubled_log.md new file mode 100644 index 0000000..4caec1e --- /dev/null +++ b/docs/devlog/20261008-issue84-view-menu-doubled_log.md @@ -0,0 +1,49 @@ +# View Menu doubled (#84) + +> **Date:** 2026-10-08 +> **Type:** issue +> **Reference:** https://git.babylondreams.de/AlexKucera/museion/issues/84 + +## Goal + +Kill the doubled View menu: "Toggle Reading Mode" (#68) lived in its own `CommandMenu("View")`, putting a second View menu in the menu bar beside the system one. The toggle must keep working (⌘R, `.toggleReadingMode` notification). + +## What Was Done + +- `Museion/MuseionApp.swift` — swapped `CommandMenu("View")` for `CommandGroup(after: .toolbar)`, so the reading toggle joins the system View menu instead of creating a duplicate. Button, shortcut, and notification post untouched. +- `MuseionTests/MuseionTests.swift` — new test `single View menu hosts the reading toggle`: hosted in the real app, inspects `NSApp.mainMenu`, asserts exactly one View-titled top-level menu and that it carries the item. +- TDD verified: test RED against the original code (two View menus — real assertion failure), GREEN with the fix. Full suite (unit + UI smoke) green; SwiftLint 0 violations on both files. +- Reviews: implement-skill review (standards: approve; spec: PASS, no findings) and finish-audit fanout (security STRIDE: 0 findings; general: 0 actionable; ponytail: 2 comment shrinks, applied — net −6 comment lines). + +## Decisions & Rationale + +| Decision | Rationale | +|----------|-----------| +| `CommandGroup(after: .toolbar)` over other placements | The platform way to append into the system View menu (after the Toolbar section); `CommandMenu("View")` is a *new* top-level menu by definition — that was the whole bug. | +| Discriminate on View-titled menu **count**, not contents | The system View menu's items are context-lazy (absent without a toolbar), so in the hosted test it can legitimately hold only our item. Counting View-titled menus catches the duplicate both ways. | +| Test via `NSApp.mainMenu` in the hosted suite | MuseionTests runs inside the real app process, so the live menu bar is assertable — no UI-test machinery needed for a structural claim. | + +## Gotchas & Fixes + +| Problem | Root Cause | Fix | +|---------|------------|-----| +| First GREEN run still failed (`items.count > 1`) | System View items are context-lazy; the merged menu held only our item in the test host. Probe (dumped menu tree to /tmp) showed one `[View]` menu — the fix itself worked, the assertion was wrong. | Assert `viewMenus.count == 1` + item present. | +| `-only-testing:MuseionTests/MuseionTests` matched 0 tests, "TEST SUCCEEDED" | Swift Testing free functions aren't class-scoped; the filter silently matched nothing — a 0-test success. | Filter at target level (`-only-testing:MuseionTests`), or grep the log for the test-case line. | +| `swiftformat .` reformatted 17 untouched files | Repo-wide format pass touches pre-existing drift in other files. | `git checkout` the collateral; lint only the two changed files. | +| Stash-RED run reported failure but no test line | The RED failure was a compile error (optional `NSApp.mainMenu` used unwrapped) — caught by reading the log, not the summary. | `try #require(NSApp.mainMenu)` in the test. | +| First review fanout dispatch failed ("670 tasks" runaway guard) | Malformed delegate_task payload from an earlier turn. | Re-dispatched cleanly; user said continue. | + +## Files Changed + +| File | Change Summary | +|------|---------------| +| `Museion/MuseionApp.swift` | `CommandMenu("View")` → `CommandGroup(after: .toolbar)`; comment update | +| `MuseionTests/MuseionTests.swift` | +import AppKit; new test pinning one View menu | + +## Open Items & Next Steps + +- None. `PRD.md` carries a pre-existing unrelated modification — left untouched on purpose. + +--- + +*Log written by write-log skill* diff --git a/docs/devlog/INDEX.md b/docs/devlog/INDEX.md index 7d2015e..feff46c 100644 --- a/docs/devlog/INDEX.md +++ b/docs/devlog/INDEX.md @@ -5,6 +5,7 @@ Complete history of session logs in this directory, newest first. One-line summa | Date | Type | File | Summary | |------|------|------|---------| +| 2026-10-08 | issue | [20261008-issue84-view-menu-doubled_log.md](20261008-issue84-view-menu-doubled_log.md) | #84 single View menu: CommandMenu → CommandGroup(after: .toolbar), menu-count pin test — 105 tests green | | 2026-10-08 | issue | [20261008-issue83-save-indicator-honesty_log.md](20261008-issue83-save-indicator-honesty_log.md) | #83 honest save dot: Changed while dirty, Saving… deleted, sticky failed, vanished-disk keepLocal fix — 106 tests green | | 2026-10-08 | issue | [20261008-issue77-editing-parity_log.md](20261008-issue77-editing-parity_log.md) | #77 editing parity: reading-mirrored presenter (30/22/19 ladder, inline traits, 66ch measure), fence-staleness audit fix — 104 tests green | | 2026-10-06 | issue | [20261006-issue76-apex-html-reading_log.md](20261006-issue76-apex-html-reading_log.md) | #76 apex HTML reading surface: WKWebView + bundled apex, data-source-line map, TextKit reading deleted — 94 tests green, PERF-3k 20 ms |