Skip to content

Commit bbe2ec0

Browse files
HanSur94claude
andcommitted
feat(companion): inline time-range control (dropdown + Custom date strip)
Replace the separate-window time picker with an in-toolbar uidropdown (six presets, apply-on-select) plus a 'Custom...' item that reveals an in-window overlay strip under the toolbar: a Relative (N + unit) tab and an Absolute (Start/End date pickers) tab with live preview, validation, and Apply/Cancel. No separate figure/modal is created -- the strip parents to the companion figure via the dropdown's ancestor. Resolves the rejected modal-window UX from phase 1041 and adds direct date entry per user request. - CompanionTimeBar: dropdown + overlay strip; both mode panels overlap in a single host cell (fixes a stacked/clipped layout bug); preset/relative/ absolute commit paths reuse the shared CompanionTimeRange. - TestCompanionTimeBar: rewritten for the dropdown + strip (12 tests). - TestFastSenseCompanion: default-label assertion btn.Text -> btn.Value. - 1041 HUMAN-UAT / MANUAL-VERIFY: updated to the inline design; gap resolved. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent e81e7a5 commit bbe2ec0

5 files changed

Lines changed: 612 additions & 452 deletions

File tree

.planning/phases/1041-global-kibana-style-time-range-for-the-companion-with-windowed-sensor-loading/1041-HUMAN-UAT.md

Lines changed: 49 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,58 +3,75 @@ status: partial
33
phase: 1041-global-kibana-style-time-range-for-the-companion-with-windowed-sensor-loading
44
source: [1041-VERIFICATION.md, 1041-MANUAL-VERIFY.md]
55
started: 2026-06-02
6-
updated: 2026-06-02
6+
updated: 2026-06-03
77
---
88

99
## Current Test
1010

11-
[awaiting human testing — deferred by user decision ("finalize now, defer visual"); run the steps below in a live MATLAB session via `/gsd:verify-work 1041`]
11+
[Design-change gap RESOLVED. The separate-window picker was replaced by an inline
12+
toolbar control: a preset dropdown (applies instantly) plus a 'Custom…' item that
13+
reveals an in-window relative/absolute editor strip under the toolbar — no separate
14+
figure is ever created. User verified the inline control live on 2026-06-03 ("much
15+
better"), including a follow-up fix to the Custom-strip spacing (overlapping mode
16+
panels). Remaining deep manual checks (empty-state, live-slide, persistence) are
17+
covered by automated tests; the visual checklist in 1041-MANUAL-VERIFY.md was
18+
updated to the inline design and can be re-run as desired.]
1219

1320
## Tests
1421

15-
### 1. Default range button label + color
16-
expected: Toolbar range button (left of the gear) reads "Last 7 days" with the inactive WidgetBorderColor background (no Accent — no filter set yet).
17-
result: [pending]
22+
### 1. Default range control label + color
23+
expected: Toolbar range dropdown (col 9, left of the gear) reads "Last 7 days" with the inactive WidgetBorderColor background when no filter is set.
24+
result: passed
1825

19-
### 2. Picker opens; three tabs; Quick active
20-
expected: Clicking the button opens a 400x280 "Time Range" popup with Quick/Relative/Absolute tabs; Quick active; six presets listed; "Last 7 days" preset highlighted; Apply hidden in Quick; non-modal.
21-
result: [pending]
26+
### 2. Dropdown lists presets + Custom…
27+
expected: Opening the dropdown shows six presets (24h / 7d / 30d / 90d / 1y / All data) plus a trailing "Custom…" item. No separate window opens.
28+
result: passed
2229

23-
### 3. One-click quick apply + label update + re-query
24-
expected: Clicking "Last 30 days" closes the popup immediately, button text → "Last 30 days", background → Accent, and any open dashboard/ad-hoc plot re-queries to the last 30 days.
25-
result: [pending]
30+
### 3. Preset applies instantly + label/accent update + re-query
31+
expected: Selecting a preset (e.g. "Last 30 days") applies immediately; dropdown Value updates, background → Accent, and any open dashboard / ad-hoc plot re-queries.
32+
result: passed
2633

27-
### 4. Relative builder: live preview + Apply
28-
expected: Relative tab shows spinner (N) + unit dropdown + live preview label that updates as N/unit change; Apply closes popup and updates the button label (e.g. "Last 14 weeks") and re-queries open views.
29-
result: [pending]
34+
### 4. Custom… reveals an inline strip (no separate window)
35+
expected: Selecting "Custom…" reveals an overlay strip under the toolbar INSIDE the companion window (no 'Time Range' figure; figure count unchanged). Relative/Absolute toggle + Apply/Cancel.
36+
result: passed
3037

31-
### 5. Absolute tab: validation + valid apply
32-
expected: Two date pickers; Start > End disables Apply and shows "Invalid: start must be before end" in red; a valid range enables Apply and sets a date-string button label (e.g. "2026-06-02 to 2026-06-04").
33-
result: [pending]
38+
### 5. Absolute date entry: pickers + validation + apply
39+
expected: Absolute tab shows Start/End date pickers; Start End disables Apply with red "Invalid: start must be before end"; a valid range applies, closes the strip, and sets a date-string label (e.g. "2026-05-27 to 2026-06-03", Accent).
40+
result: passed
3441

35-
### 6. Empty-state widget for data outside the window
36-
expected: Opening an ad-hoc plot for a tag whose data does not overlap the active window shows a centered bold "No data in selected range" label (no axes, no crash).
37-
result: [pending]
42+
### 6. Relative builder: spinner + unit + apply
43+
expected: Relative tab shows an N spinner + unit dropdown + live preview; Apply commits e.g. "Last 14 days".
44+
result: passed
3845

39-
### 7. Relative window slides on live tick; absolute stays fixed
40-
expected: With a "Last 7 days" relative range and live mode on, the right edge tracks wall-clock "now" each tick with no flicker and the label stays "Last 7 days"; switching to an Absolute window keeps the window fixed across live ticks.
41-
result: [pending]
46+
### 7. Empty-state widget for data outside the window
47+
expected: Opening a tag whose data does not overlap the active window shows a centered "No data in selected range" label (no axes, no crash).
48+
result: pending
49+
note: covered by automated out-of-extent getXYRange tests (test_sensor_tag_range); manual visual optional.
4250

43-
### 8. Theme restyle of the range button (and popup)
44-
expected: Switching theme via Settings restyles the range button (and the popup if open) to the new theme colors.
45-
result: [pending]
51+
### 8. Relative window slides on live tick; absolute stays fixed
52+
expected: With a relative range + live mode, the right edge tracks wall-clock "now" each tick (label unchanged); switching to an Absolute window keeps it fixed.
53+
result: pending
54+
note: manual-only (requires live ticks); RangeChanged → setTimeWindow re-query covered by TestFastSenseCompanion.
4655

47-
### 9. Persistence across reopen
48-
expected: After setting a non-default range and reopening the companion, the button reads the last-used range (Accent) and currentTimeWindow() returns the restored span — loaded from companionPrefs.
49-
result: [pending]
56+
### 9. Theme restyle + persistence across reopen
57+
expected: Switching theme restyles the dropdown (and open strip); reopening the companion restores the last-used range from companionPrefs.
58+
result: pending
59+
note: theme restyle covered by TestCompanionTimeBar; persistence by automated companion tests.
5060

5161
## Summary
5262

5363
total: 9
54-
passed: 0
64+
passed: 6
5565
issues: 0
56-
pending: 9
66+
pending: 3
5767
skipped: 0
58-
blocked: 0
5968

6069
## Gaps
70+
71+
- truth: "Time-range selection is integrated into the companion's top toolbar (no separate window)"
72+
status: resolved
73+
reason: "User: the picker opened a separate modal window via the 'Last 7 days' button; wanted it integrated in the top bar, not a new window. Follow-up: also wanted a date picker / edit field for direct date entry."
74+
severity: major
75+
test: 2
76+
artifacts: [libs/FastSenseCompanion/CompanionTimeBar.m, tests/suite/TestCompanionTimeBar.m, tests/suite/TestFastSenseCompanion.m]
77+
resolution: "Reworked CompanionTimeBar from a separate uifigure popup to an inline toolbar uidropdown (six presets, apply-on-select) plus a 'Custom…' item that reveals an in-window overlay strip under the toolbar with a Relative (N + unit) tab and an Absolute (Start/End date pickers) tab, Apply/Cancel. The strip parents to the companion figure (derived via ancestor of the dropdown) — no separate window. Fixed a layout bug where the two mode panels stacked and clipped (now overlap in one host cell). TestCompanionTimeBar rewritten for the dropdown + strip (12/12); TestFastSenseCompanion default-label assertion updated from btn.Text to btn.Value (5/5 range subset). User-verified live 2026-06-03."
Lines changed: 61 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# Manual Verification: Phase 1041 — Global Time Range for FastSenseCompanion
22

3-
**Purpose:** Verify behaviors that cannot be asserted headlessly — picker visual rendering,
4-
one-click preset interaction, relative-slide on live ticks, empty-state widget display,
5-
persistence across sessions, and theme restyle.
3+
**Purpose:** Verify behaviors that cannot be asserted headlessly — inline control
4+
rendering, one-click preset interaction, Custom-strip date entry, relative-slide on
5+
live ticks, empty-state widget display, persistence across sessions, and theme restyle.
6+
7+
> **Design note (2026-06-03):** The original separate-window picker was replaced by an
8+
> **inline toolbar control** per user request: a preset **dropdown** in toolbar column 9
9+
> (applies on select) plus a trailing **"Custom…"** item that reveals an **in-window
10+
> overlay strip** under the toolbar (Relative / Absolute tabs, Apply / Cancel). No
11+
> separate figure / modal window is ever opened.
612
713
**Prerequisites:**
814
- Run `install()` once in the MATLAB Command Window to add paths and compile MEX.
@@ -31,75 +37,75 @@ TagRegistry.register('s2', t2);
3137
c = FastSenseCompanion('Registry', TagRegistry);
3238
```
3339

34-
### Step 1 — Default range button label and color
40+
### Step 1 — Default range control label and color
3541

3642
**Action:** Inspect the companion toolbar after it opens.
3743

3844
**Expected:**
39-
- The range button (positioned to the left of the gear) reads **"Last 7 days"**.
40-
- The button background matches the inactive (WidgetBorderColor) toolbar style — same
45+
- The range **dropdown** (positioned to the left of the gear, toolbar column 9) reads
46+
**"Last 7 days"**.
47+
- The dropdown background matches the inactive (WidgetBorderColor) toolbar style — same
4148
as the Tile, Wiki, and Events buttons. No Accent highlight (no filter is set yet).
4249

4350
---
4451

45-
### Step 2 — Picker opens; three tabs visible; Quick tab active
52+
### Step 2 — Dropdown lists presets + "Custom…" (no separate window)
4653

47-
**Action:** Click the "Last 7 days" toolbar button.
54+
**Action:** Open the range dropdown.
4855

4956
**Expected:**
50-
- A 400 × 280 px popup titled **"Time Range"** opens near the companion window.
51-
- Three tabs are visible in the top strip: **Quick**, **Relative**, **Absolute**.
52-
- **Quick** tab is active (Accent background on the Quick tab button).
53-
- The Quick panel shows six preset buttons:
57+
- The dropdown lists six presets, in order:
5458
"Last 24 hours", "Last 7 days", "Last 30 days", "Last 90 days", "Last 1 year", "All data".
55-
- The **"Last 7 days"** preset button is highlighted (Accent background) because it
56-
matches the current spec.
57-
- The Apply button row is **hidden** in Quick mode (Cancel is visible).
58-
- Clicking anywhere outside the popup does NOT close it (non-modal).
59+
- A final **"Custom…"** item appears after the presets.
60+
- The current spec ("Last 7 days") is the selected value.
61+
- **No popup / separate figure** opens just by viewing the list.
5962

6063
---
6164

62-
### Step 3 — One-click quick apply + label update + re-query
65+
### Step 3 — One-click preset apply + label update + re-query
6366

64-
**Action:** With the picker open (from Step 2), click **"Last 30 days"**.
67+
**Action:** Select **"Last 30 days"** from the dropdown.
6568

6669
**Expected:**
67-
- Popup **closes immediately** (no separate Apply needed).
68-
- Toolbar button text changes to **"Last 30 days"**.
69-
- Toolbar button background changes to the **Accent color** (visual signal that a filter
70-
is active — non-default range).
70+
- The preset applies **immediately** (no separate Apply step).
71+
- Dropdown value changes to **"Last 30 days"**.
72+
- Dropdown background changes to the **Accent color** (visual signal that a filter is
73+
active — non-default range).
7174
- Any open dashboard or ad-hoc plot **re-queries** its data to the last 30 days. For a
7275
disk-backed sensor this is visible as fewer points loading; for an in-RAM tag the line
7376
updates to the 30-day slice.
7477

7578
---
7679

77-
### Step 4 — Relative builder tab: live preview + Apply
80+
### Step 4 — Custom… → Relative builder (live preview + Apply)
7881

79-
**Action:** Click the "Last 30 days" toolbar button to reopen the picker. Click the
80-
**Relative** tab.
82+
**Action:** Select **"Custom…"** from the dropdown, then click the **Relative** tab in the
83+
strip that appears under the toolbar.
8184

8285
**Expected:**
83-
- The Relative panel becomes visible: a spinner (N), a unit dropdown, "Last … until now" labels.
84-
- Default values reflect the current spec (N = 30, unit = days).
85-
- Change the spinner to **14** and the dropdown to **weeks**.
86+
- An **in-window strip** appears directly under the toolbar (NOT a separate window). The
87+
companion figure count does not change.
88+
- The Relative panel shows a spinner (N), a unit dropdown, and "Last … until now" labels.
89+
- Change the spinner to **14** and the unit dropdown to **weeks**.
8690
- A preview label below the controls updates live: it shows a date range
8791
approximately `YYYY-MM-DD to YYYY-MM-DD` spanning 98 days from today.
8892
- Click **Apply**.
8993

9094
**After Apply:**
91-
- Popup closes.
92-
- Toolbar button reads **"Last 14 weeks"**.
95+
- The strip closes.
96+
- The toolbar dropdown reads **"Last 14 weeks"** (shown as a transient leading item).
9397
- Open views re-query to the 98-day window.
9498

9599
---
96100

97-
### Step 5 — Absolute tab: validation + Apply
101+
### Step 5 — Custom… → Absolute date entry: validation + Apply
98102

99-
**Action:** Reopen the picker; click the **Absolute** tab.
103+
**Action:** Select **"Custom…"** again. The strip opens on the **Absolute** tab by default
104+
(direct date entry).
100105

101106
**Expected:**
102-
- Two date pickers (Start, End) with default values (today − 7 days, today).
107+
- Two date pickers (Start, End) are visible, seeded from the current range (or
108+
today − 7 days … today).
103109

104110
**Sub-step A — Validation:**
105111
- Set the Start date picker to today's date.
@@ -111,7 +117,7 @@ c = FastSenseCompanion('Registry', TagRegistry);
111117
- Fix the End date to tomorrow's date.
112118
- Preview label shows **"1 days"** (or "2 days" depending on clock).
113119
- Apply is enabled; click **Apply**.
114-
- Popup closes; toolbar button reads a date string e.g. **"2026-06-02 to 2026-06-04"**.
120+
- The strip closes; the dropdown reads a date string e.g. **"2026-06-02 to 2026-06-04"**.
115121
- Open views re-query to that fixed window.
116122

117123
---
@@ -127,41 +133,41 @@ Open an ad-hoc plot for `s1` from the companion Inspector ("Plot" button).
127133
**Expected:**
128134
- The spawned plot window shows a **centered bold label**: **"No data in selected range"**
129135
(14pt bold, muted foreground color, inside the widget panel). No axes, no crash.
130-
- The toolbar button still shows the active range (Accent color).
136+
- The toolbar dropdown still shows the active range (Accent color).
131137

132138
---
133139

134140
### Step 7 — Relative-window slide on live tick (requires a live-to-today sensor)
135141

136-
**Action:** Ensure the active range is **"Last 7 days"** (click the button, pick the preset
142+
**Action:** Ensure the active range is **"Last 7 days"** (select the preset in the dropdown
137143
if needed). Open a live-to-today sensor (e.g., `s2` which spans from 2025 to today).
138144
Click **Live** to start live mode.
139145

140146
Let at least 3 live ticks elapse (default: 1 second per tick).
141147

142148
**Expected for relative range:**
143149
- The right edge of the data window slides with wall-clock "now" — new tail samples
144-
appear on every tick WITHOUT a popup re-open or full figure rerender flicker.
145-
- The toolbar button label remains **"Last 7 days"** (it does not add a timestamp or change).
150+
appear on every tick WITHOUT a strip re-open or full figure rerender flicker.
151+
- The toolbar dropdown value remains **"Last 7 days"** (it does not add a timestamp or change).
146152

147153
**Expected for absolute range (regression):**
148-
- Change the range to an Absolute window (e.g., yesterday to today). Live ticks
154+
- Change the range to an Absolute window (via Custom… → Absolute). Live ticks
149155
continue but the window is **fixed** — the left edge does NOT slide.
150156

151157
---
152158

153-
### Step 8 — Theme restyle of the range button and popup
159+
### Step 8 — Theme restyle of the range control (and open strip)
154160

155-
**Action:** With the picker popup closed, open the companion Settings dialog (gear button).
161+
**Action:** With the Custom strip closed, open the companion Settings dialog (gear button).
156162
Switch the theme (e.g., from dark to light). Close the settings dialog.
157163

158164
**Expected:**
159-
- The range button restyles to the new theme (FontColor + BackgroundColor match the new
160-
theme's ToolbarFontColor / WidgetBorderColor or Accent as appropriate).
165+
- The range dropdown restyles to the new theme (FontColor + BackgroundColor match the new
166+
theme's foreground / WidgetBorderColor or Accent as appropriate).
161167

162-
**Bonus (if popup is open):**
163-
- Reopen the picker popup; switch the theme while it is visible. The popup's background
164-
and control colors update to the new theme.
168+
**Bonus (if the strip is open):**
169+
- Open Custom… so the strip is visible; switch the theme while it is open. The strip's
170+
background and control colors update to the new theme; the active tab keeps its Accent.
165171

166172
---
167173

@@ -173,7 +179,7 @@ Switch the theme (e.g., from dark to light). Close the settings dialog.
173179
3. Reopen: `c2 = FastSenseCompanion('Registry', TagRegistry);`.
174180

175181
**Expected:**
176-
- The toolbar button on the new companion reads **"Last 30 days"** (Accent color).
182+
- The toolbar dropdown on the new companion reads **"Last 30 days"** (Accent color).
177183
- `c2.currentTimeWindow()` returns a `[t0, t1]` span of ~30 days.
178184
- The restored range is loaded from `companionPrefs` automatically.
179185

@@ -183,15 +189,15 @@ Switch the theme (e.g., from dark to light). Close the settings dialog.
183189

184190
| Step | Description | Result | Notes |
185191
|------|-------------|--------|-------|
186-
| 1 | Default label "Last 7 days" + WidgetBorderColor background || |
187-
| 2 | Picker 400x280, 3 tabs, Quick active, presets listed, Cancel visible || |
188-
| 3 | One-click "Last 30 days" closes popup + Accent + re-query || |
189-
| 4 | Relative tab: live preview updates; Apply closes + updates label || |
190-
| 5A | Absolute: start > end → Apply disabled + red error text || |
191-
| 5B | Absolute: valid range → Apply + date-string label || |
192+
| 1 | Default dropdown value "Last 7 days" + WidgetBorderColor background || |
193+
| 2 | Dropdown lists 6 presets + "Custom…"; no separate window || |
194+
| 3 | Selecting "Last 30 days" applies instantly + Accent + re-query || |
195+
| 4 | Custom… → Relative: live preview; Apply closes strip + updates value || |
196+
| 5A | Custom… → Absolute: start > end → Apply disabled + red error text || |
197+
| 5B | Custom… → Absolute: valid range → Apply + date-string value || |
192198
| 6 | Empty-state "No data in selected range" for out-of-window sensor || |
193199
| 7 | Relative window slides on live tick; Absolute stays fixed || |
194-
| 8 | Theme switch restyles button (and popup if open) || |
200+
| 8 | Theme switch restyles dropdown (and open strip) || |
195201
| 9 | Persistence: reopen companion restores last-used range || |
196202

197203
**Tester:** ______________________
@@ -205,5 +211,5 @@ Switch the theme (e.g., from dark to light). Close the settings dialog.
205211
---
206212

207213
*This checklist covers the two manual-only validation targets from `1041-VALIDATION.md`:*
208-
*1. CompanionTimeBar picker visuals + popup interaction (presets / relative / absolute)*
214+
*1. CompanionTimeBar inline control visuals + interaction (dropdown presets / Custom relative / Custom absolute)*
209215
*2. Relative-window slide on live tick*

0 commit comments

Comments
 (0)