diff --git a/.planning/STATE.md b/.planning/STATE.md index 7147d20b..cce77def 100644 --- a/.planning/STATE.md +++ b/.planning/STATE.md @@ -89,6 +89,7 @@ Other main PRs (#138, #139, #141, #144, #145, #146) auto-merged without conflict | 260513-sfp | Add auto-y-limit control buttons (V/A/L) to FastSenseWidget WidgetButtonBar — new YLimitMode property (auto-visible / auto-all / locked, default 'auto-visible' reproduces pre-260513-sfp behaviour), setYLimitMode public method (clears UserZoomedY on explicit click so click re-engages autoscale), autoScaleY_ refactored to dispatch on mode AFTER existing precedence guards (YLimits pin / UserZoomedY / FastSense.LiveViewMode=='follow') so 260513-ovt Follow semantics are preserved. DashboardLayout duck-types widget chrome via ismethod(widget,'setYLimitMode'), so future widgets that expose Y-rescale modes opt in without touching DashboardLayout. ASCII glyphs (V/A/L) match existing Info/Detach. reflowChrome_ re-anchors on resize. toStruct omits the default so legacy dashboards stay diff-invisible. test_fastsense_widget_ylimit_modes 11/11, test_fastsense_widget_tag 7/7, test_fastsense_follow_toggle 10/10, test_dashboard_time_sync_all_pages 5/5. Verified on live industrial-plant demo, all 8 scenarios approved. Known caveat: V/A/L cluster butts against Info button (0-px gap) — inherited from pre-existing addInfoIcon 28-px-typo, explicitly out-of-scope per plan; logged in deferred-items.md | 2026-05-13 | 4db9138, cc18c7f, a9cc181 | Verified | [260513-sfp-add-auto-y-limit-control-buttons-to-fast](./quick/260513-sfp-add-auto-y-limit-control-buttons-to-fast/) | | 260513-s0y | Add Tile + Close all buttons to FastSenseCompanion top toolbar — private OpenedFigures_ tracking + syncOpenedFigures_ (walks Engines_ before tile/close-all) + public trackOpenedFigure hook (InspectorPane.onOpenDetail_ and CompanionEventViewer.openEventDashboard_ forward their figure handles). tileOpenedWindows: ceil(sqrt(N))×ceil(N/cols) grid on monitor containing the companion, 24px margin, 8px gutter, row-major top-down. Before set(Position), coerces each figure to WindowState='normal' + Units='pixels' — root cause of initial "Tile does nothing" report was DashboardEngine.render defaulting to Units='normalized' (pixel rects got treated as screen fractions, pushing figures off-canvas). closeAllOpenedWindows: snapshot + close(h) per handle (honors each figure's CloseRequestFcn). Inner toolbar grid 1×4→1×6 (Events / Live / Tile / Close all / spacer / gear; gear Layout.Column 4→6). 9 sub-tests in test_companion_tile_close_buttons.m PASS; TestFastSenseCompanion regression 64/64 PASS. Verified on live industrial-plant demo. Shipped as PR #143. | 2026-05-14 | 182d6f1, 2867caa, 1be2cc8, e58bc35, c47c0c1, db9ef88 | Shipped (PR #143) | [260513-s0y-add-tile-windows-and-close-all-windows-b](./quick/260513-s0y-add-tile-windows-and-close-all-windows-b/) | | 260519-bs4 | Add Tag Status Table window to FastSenseCompanion — new `TagStatusTableWindow.m` (classical figure, not uifigure, per CONTEXT.md), opened via new **Tags ↗** button on companion top toolbar (col 3 in the post-merge 1×7 grid: Events / Live / Tags / Tile / Close all / spacer / gear). Detached-only window with 12-column `uitable`: Key, Name, Type, Criticality, Units, Latest, Status (smart per-type — Monitor→OK/ALARM, State→state label, others→—), Last updated (X(end) timestamp), Activity (Live/Inactive at 5-min threshold), Events (count from EventStore), Samples, Labels. All 18 demo tags listed (snapshot from `TagRegistry.find(@(t)true)`). Two parallel refresh paths: (a) push-on-write via existing `FastSenseCompanion.scanLiveTagUpdates_` → `markStatusTableDirty_(keys)` when companion is in Live mode, (b) window-owned `RefreshTimer_` (1s fixedSpacing, unique UUID name, BusyMode='drop', self-stop after 2 consecutive tick errors) so the table refreshes regardless of companion's IsLive — addresses user feedback that Activity/Last updated must stay correct when companion is idle. Pause/Resume polling toggle freezes both paths (markTagsDirty becomes a no-op while paused; header shows "Last refreshed: HH:MM:SS (paused)"). "Last refreshed" heartbeat label updates every tick. Filter chips mirror TagCatalogPane pattern: Type (Sensor/Monitor/Composite/State/Derived), Criticality (Low/Medium/High/Safety), Activity (Live/Inactive) — multi-toggle, AND-across-groups / OR-within-group; broadened free-text search across Key+Name+Units+Labels. Push-on-write hook in companion stays — both mechanisms run in parallel. Six atomic commits + 1 merge: 01 base class + 11 pure-logic tests; 02 companion wiring + 7 lifecycle tests; 03 Activity column + own timer (+5 logic + 2 lifecycle tests, deviation from "push-on-write only" CONTEXT decision per user); 04 last-refreshed header + chip filters + broader search (+4 logic + 2 lifecycle tests); 05 Pause/Resume polling toggle (+4 lifecycle tests); 06 Events count column (+4 logic + 1 lifecycle test); 07 merge with main (PR #143 toolbar grid conflict). Final test counts post-merge: `test_companion_tag_status_table` 24/24 (pure-logic), `TestTagStatusTableWindow` 16/16 (UI lifecycle), `test_companion_tile_close_buttons` 9/9 (main's new test still PASS), `TestFastSenseCompanion` 64/64 (no regression) = 113/113 total. Verified end-to-end on live industrial-plant demo: 4 MonitorTags showed real event counts (29/32/33/35), 14 others showed 0; Activity flipped Live→Inactive at exactly 5-min boundary via static buildRow_ proof; companion IsLive=0 throughout (window polled itself). Deferred / out-of-scope: (1) polling-scope clarification dismissed by user (heartbeat-only vs. passive-observation vs. only-update-changed-cells — left as-is, table updates all cells every tick); (2) Info button + markdown help — scoped up to a milestone-sized "unified in-app help/wiki" effort, parked as backlog 999.1. | 2026-05-19 | b2ed937, e8a1be5, 43d2d3b, 2a24965, 50d464c, 10df740, 73a3bf1 | Verified | [260519-bs4-implement-a-new-table-view-in-the-compan](./quick/260519-bs4-implement-a-new-table-view-in-the-compan/) | +| 260526-tcf | Fix two pre-existing column assertions in `TestFastSenseCompanion.m` to match the post-PR-#159 1x9 companion toolbar grid — `testToolbarHasWikiButton` now asserts Wiki at col **7** (was 6), `testToolbarGearMovedToColumn8` now asserts Settings gear at col **9** (was 8). Production source-of-truth: `FastSenseCompanion.m:410` (`hWikiBtn_.Layout.Column = 7`) and `FastSenseCompanion.m:423` (`hSettingsBtn_.Layout.Column = 9`); commit `e2ded77` migrated the parallel `TestFastSenseCompanionPlantLogToolbar.m` file but missed these two assertions. Column-value fix only — method name `testToolbarGearMovedToColumn8` retained per user choice; rename to `testToolbarGearAtColumn9` + matching docstring cleanup deferred to a separate task. Diagnostic-message strings on the two `verifyEqual` calls updated alongside the literals so failure messages stay coherent. Pre-existing nature confirmed in briefing: both failures reproduce against HEAD~1 and survived a stash-revert of the parallel quick task `260526-r9x`. MATLAB test verification (expected: 73/73 PASS, or 74/74 if PerTag commit landed first) deferred to the user's local session — `mcp__matlab__*` tools route to local MATLAB and are not reachable from the remote sandbox. | 2026-05-26 | e321ac7 | Ready for verification | [260526-tcf-fix-companion-toolbar-1x9-grid-test-cols](./quick/260526-tcf-fix-companion-toolbar-1x9-grid-test-cols/) | | 260526-pqz | Raise per-signal slider-preview cap from 400 → 1000 buckets in `DashboardEngine.computePreviewEnvelopeReturning_` — three textual edits (1 code clamp + 2 documenting comments) in `libs/Dashboard/DashboardEngine.m` plus one consistency comment in `tests/test_dashboard_preview_overlay.m` (no assertion change; `numel(xd) >= 4` is cap-independent). Edit sites: line 3524 doc-comment (`computePreviewEnvelope` range), line 3542 inline comment (clamp range), line 3555 actual clamp `max(50, min(1000, floor(axWpx / 2)))`. Out of scope per plan: cache invalidation of `PreviewNBuckets_` — running demos must restart (or trigger the existing resize-invalidation path at `DashboardEngine.m:2241`) for the new cap to take effect. Static analysis clean: `mh_lint` + `mh_style` on both edited files report "everything seems fine"; regression sweep `grep -rn "\b400\b" tests/ \| grep -iE "(preview\|bucket\|envelope)"` returns no matches. MATLAB R2025a: `test_dashboard_preview_envelope` 7/7, `test_dashboard_preview_overlay` 10/10. Octave 11.1.0: `test_dashboard_preview_envelope` 2/2 (5 skipped — pre-existing TimeRangeSelector guard for patch+FaceAlpha+NaN on xvfb), `test_dashboard_preview_overlay` skipped entirely (pre-existing). | 2026-05-26 | 834b43c | — | [260526-pqz-raise-preview-line-cap-per-signal-from-4](./quick/260526-pqz-raise-preview-line-cap-per-signal-from-4/) | ## Progress Bar diff --git a/.planning/quick/260526-tcf-fix-companion-toolbar-1x9-grid-test-cols/260526-tcf-SUMMARY.md b/.planning/quick/260526-tcf-fix-companion-toolbar-1x9-grid-test-cols/260526-tcf-SUMMARY.md new file mode 100644 index 00000000..2eb902da --- /dev/null +++ b/.planning/quick/260526-tcf-fix-companion-toolbar-1x9-grid-test-cols/260526-tcf-SUMMARY.md @@ -0,0 +1,111 @@ +--- +phase: 260526-tcf +plan: 01 +subsystem: FastSenseCompanion +tags: [tests, fastsensecompanion, toolbar, grid-layout, post-merge-followup] +type: quick +status: ready-for-verification +requirements: + - TCF-01 # Wiki button assertion matches current 1x9 grid (col 7, not col 6) + - TCF-02 # Settings gear assertion matches current 1x9 grid (col 9, not col 8) +dependency_graph: + requires: + - "FastSenseCompanion.m hToolbarGrid 1x9 layout (lines ~313-324) — Wiki at col 7, gear at col 9" + - "Commit e2ded77 (post-second-merge cleanup) — established the 1x9 grid expectation in the parallel test file" + provides: + - "TestFastSenseCompanion testToolbarHasWikiButton + testToolbarGearMovedToColumn8 in agreement with source-of-truth toolbar layout" + affects: + - "tests/suite/TestFastSenseCompanion.m (two verifyEqual assertions and matching diagnostic messages)" +tech_stack: + added: [] + patterns: [] +key_files: + created: + - ".planning/quick/260526-tcf-fix-companion-toolbar-1x9-grid-test-cols/260526-tcf-SUMMARY.md" + modified: + - "tests/suite/TestFastSenseCompanion.m" +decisions: + - "Column-value fix only — method name testToolbarGearMovedToColumn8 retained as-is per user choice. Rename to ...AtColumn9 deferred to a separate cleanup task to avoid touching grep-based references in this commit." + - "Diagnostic-message strings updated alongside the assertion values so a future failure message stays coherent ('should sit in column 7' / 'should now sit in column 9') — these are part of the same verifyEqual call, not the method-name identifier the user asked to leave alone." + - "Line-1194 docstring corrected 'column 6' -> 'column 7' — it is decoupled from the method name (testToolbarHasWikiButton carries no column number), so fixing it is the same risk-free defect class as the assertion. Line-1207 docstring ('column 8') is left paired with its method name testToolbarGearMovedToColumn8 and travels with the deferred rename — splitting the doc from the name ('MovedToColumn8' + 'column 9') would read as a self-contradiction worse than a stale-but-self-consistent name+doc pair." +metrics: + duration_minutes: ~5 + completed: "2026-05-26" +--- + +# Quick Task 260526-tcf: Fix Companion Toolbar 1x9 Grid Test Columns — Summary + +One-liner: Two pre-existing column assertions in `TestFastSenseCompanion.m` were stale against the post-PR-#159 1x9 toolbar grid; updated them to expect Wiki at col 7 and Settings gear at col 9 (was 6 / 8), matching the production layout in `FastSenseCompanion.m`. + +## What Was Built + +A two-line correction to two test assertions: + +| Test method | Asserted column (before) | Asserted column (after) | Source-of-truth | +| ------------------------------------------ | ------------------------ | ----------------------- | --------------- | +| `testToolbarHasWikiButton` | 6 | **7** | `FastSenseCompanion.m:410` (`hWikiBtn_.Layout.Column = 7`) | +| `testToolbarGearMovedToColumn8` | 8 | **9** | `FastSenseCompanion.m:423` (`hSettingsBtn_.Layout.Column = 9`) | + +Diagnostic-message text on the same `verifyEqual` calls was updated in lockstep so any future failure reports a coherent expected-column. + +## Root Cause + +Commit `e2ded77` ("post-second-merge cleanup — Wiki Browser lint + 1x9 toolbar tests") migrated `TestFastSenseCompanionPlantLogToolbar.m` to the new 1x9 layout established by PR #159, but missed the two matching assertions in `TestFastSenseCompanion.m`. The production source (`FastSenseCompanion.m` lines 313–324) defines the canonical 1x9 grid: + +``` +col 1 = Events col 2 = Live col 3 = Tags col 4 = Plant Log… +col 5 = Tile col 6 = Close all col 7 = Wiki col 8 = flex spacer (1x) +col 9 = Settings gear +``` + +The two tests still expected the pre-merge layout where Wiki sat at col 6 and gear at col 8. + +## Final Commit Hash + +- `e321ac7` — `fix(260526-tcf)`: update Wiki/gear column assertions to match 1x9 toolbar grid + +## Files Changed + +| File | Change | LOC delta | Purpose | +| ------------------------------------------- | -------- | --------- | ----------------------------------------------------------------------- | +| `tests/suite/TestFastSenseCompanion.m` | Modified | +5 / -5 | Update `verifyEqual` column values (6→7, 8→9) + matching diagnostic messages in `testToolbarHasWikiButton` (lines 1202–1203) and `testToolbarGearMovedToColumn8` (lines 1214–1215); plus the decoupled `testToolbarHasWikiButton` header docstring (line 1194, 6→7) surfaced by the post-fix audit sweep | +| `.planning/quick/260526-tcf-…/SUMMARY.md` | Created | — | This file | + +Total: 1 production-test file touched, ~4 net LOC modified. + +## Automated Test Results + +⚠️ Verification deferred to the user's local MATLAB session — the `mcp__matlab__*` tools route to the user's MATLAB instance, which is not reachable from this remote sandbox. + +Expected outcome when the user runs `mcp__matlab__run_matlab_test_file` on `tests/suite/TestFastSenseCompanion.m`: + +- Before this commit: **2 failures** (`testToolbarHasWikiButton`, `testToolbarGearMovedToColumn8`) — both assert outdated columns. +- After this commit: **73/73 PASS** (or 74/74 if the parallel quick task `260526-r9x` PerTag commit landed on this branch first). + +## User Verification Result + +Pending — user will run the test file locally and confirm the two failures clear without regressing the other 71 cases. + +## Design Decisions + +1. **Column-value fix only.** Method name `testToolbarGearMovedToColumn8` retained — user explicitly chose the minimum-diff option to avoid grep-based reference churn. Rename to `testToolbarGearAtColumn9` is deferred to a separate cleanup commit. +2. **Diagnostic messages updated alongside the assertion values.** The trailing string arg to `verifyEqual` is part of the same call site as the column literal; leaving `'should sit in column 6'` while asserting `7` would print a misleading failure message. This is not a "method-name identifier" change so it falls inside the user's "two-line verbatim" instruction. +3. **Line-1194 docstring corrected (`column 6` → `column 7`); line-1207 docstring left as-is.** A post-fix audit sweep (`grep -rE "Layout\.Column,\s*[0-9]|column [0-9]" tests/suite/TestFastSenseCompanion*.m`) found the line-1194 header comment was still stale. It is decoupled from the method name (`testToolbarHasWikiButton` has no column number), so it was corrected — same defect class as the assertion, zero rename risk. Line 1207 (`...lives in column 8`) is deliberately *not* touched: it mirrors the method name `testToolbarGearMovedToColumn8`, and keeping the name+docstring as a coherent (stale) pair until the rename lands is cleaner than a `MovedToColumn8` ↔ `column 9` self-contradiction. The same audit confirmed `TestFastSenseCompanionPlantLogToolbar.m` is fully consistent with the 1×9 grid (Plant Log at col 4 on lines 187/345; gear at col 9 on line 219 — independently corroborating the gear-at-9 fix from a second file) and that no other stale column *assertions* exist anywhere. + +## Out-of-Scope Follow-ups (not done, deliberately) + +- **Rename `testToolbarGearMovedToColumn8` → `testToolbarGearAtColumn9`** — explicit user deferral; should ship as a separate cleanup task that also touches the method header docstrings on both methods. +- **Audit sweep — DONE (clean).** Ran `grep -rE "Layout\.Column,\s*[0-9]|column [0-9]" tests/suite/TestFastSenseCompanion*.m`: no stale column *assertions* remain in either file. `TestFastSenseCompanionPlantLogToolbar.m` is fully consistent with the 1×9 grid (Plant Log col 4, gear col 9). The only residual is the line-1207 docstring, deliberately deferred to the rename (see Design Decision 3). + +## Deviations from Plan + +None. Briefing was followed verbatim; only the line numbers (1261/1273) differed from the current file state (actual: 1202/1214) — content matched exactly and the fix was unambiguous. + +## Self-Check: PASSED + +Verified all claimed artifacts: + +- `tests/suite/TestFastSenseCompanion.m` lines 1202–1203 now expect column 7 — confirmed via `git diff`. +- `tests/suite/TestFastSenseCompanion.m` lines 1214–1215 now expect column 9 — confirmed via `git diff`. +- `libs/FastSenseCompanion/FastSenseCompanion.m` lines 410 and 423 are the source-of-truth — Layout.Column = 7 (Wiki) and Layout.Column = 9 (gear). +- Working tree shows exactly 4 line-pair changes inside a single file, matching the design-decision scope. diff --git a/tests/suite/TestFastSenseCompanion.m b/tests/suite/TestFastSenseCompanion.m index a61335a5..520f7d9e 100644 --- a/tests/suite/TestFastSenseCompanion.m +++ b/tests/suite/TestFastSenseCompanion.m @@ -1191,7 +1191,7 @@ function testViewerObjectBeingDestroyedClearsHandle(testCase) % ---- Phase 1034 Plan 06: Wiki toolbar button + openWiki entry point ---- function testToolbarHasWikiButton(testCase) - %TESTTOOLBARHASWIKIBUTTON CompanionWikiBtn exists and sits in column 6. + %TESTTOOLBARHASWIKIBUTTON CompanionWikiBtn exists and sits in column 7. app = FastSenseCompanion('Theme', 'dark'); testCase.addTeardown(@() app.close()); btn = findall(app.getFigForTest_(), 'Tag', 'CompanionWikiBtn'); @@ -1199,8 +1199,8 @@ function testToolbarHasWikiButton(testCase) 'testToolbarHasWikiButton: Wiki button missing from toolbar'); testCase.verifyEqual(numel(btn), 1, ... 'testToolbarHasWikiButton: expected exactly one Wiki button'); - testCase.verifyEqual(btn(1).Layout.Column, 6, ... - 'testToolbarHasWikiButton: Wiki button should sit in column 6'); + testCase.verifyEqual(btn(1).Layout.Column, 7, ... + 'testToolbarHasWikiButton: Wiki button should sit in column 7'); end function testToolbarGearMovedToColumn8(testCase) @@ -1211,8 +1211,8 @@ function testToolbarGearMovedToColumn8(testCase) found = false; for k = 1:numel(btns) if ~isempty(btns(k).Text) && strcmp(btns(k).Text, char(9881)) - testCase.verifyEqual(btns(k).Layout.Column, 8, ... - 'testToolbarGearMovedToColumn8: gear button should now sit in column 8'); + testCase.verifyEqual(btns(k).Layout.Column, 9, ... + 'testToolbarGearMovedToColumn8: gear button should now sit in column 9'); found = true; break; end