Commit 193d59c
Address PR review findings for history exploration feature
Fix all blockers, major, and minor issues from hu-ahmed's review:
Blockers:
- B1: Make tab-sync guard async-safe via setTimeout(0) to survive
Bootstrap's async shown.bs.tab events
- B2: Fix toDatetimeLocalValue to properly convert UTC to local
timezone, preventing 404s for non-UTC users
- B3: Add Environments.addChangeListener to thingsHistory and
thingUpdates to close SSE streams on environment switch
Majors:
- M1: Add fetch token to prevent stale diff responses from
overwriting newer state
- M2: Wrap JSON.parse in onHistoricalMessage in try/catch
- M3: Validate from <= to range before opening SSE stream
- M4: Add missing .max constraint on historicalFromRevision input
- M5: Add thingId guard in thingsHistory probe callback
- M6: Restore Ace.Editor type annotations in policy files
- M7: Scope number input CSS to history/diff containers
- M9: Add MAX_MESSAGES cap (5000) with user notification
- M10: Use closest('tr') for robust row click handling
- M11: Return promises from refreshThingAtRevision/Timestamp,
update banner on error
- M12: Call thingsDiff.ready() before registering listeners
- M13: Show toast on unexpected historical stream error
Minors:
- Extract shared probeOldestRevision helper to things.ts
- Extract shared toDatetimeLocalValue to utils.ts
- Deduplicate HISTORY_FIELDS constant (export from things.ts)
- Use structuredClone instead of JSON roundtrip
- Make historyModeActive a getter (isHistoryModeActive)
- Fix Term[] return type (was mistyped [Term?] tuple)
- Use Bootstrap Collapse API instead of classList manipulation
- Add AceDiff destroy() support, reuse SVG in minimap
- Pin ace-diff version exactly (4.0.0)
- Add null safety for sibling.parentElement
- Type messages/filteredMessages as any[]
- Cast ace as proper type instead of any
- Remove unused Time Travel button from Diff view
- Fix minimap click scroll bounce (disable animation)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 3c76339 commit 193d59c
15 files changed
Lines changed: 373 additions & 234 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | | - | |
| 326 | + | |
| 327 | + | |
327 | 328 | | |
328 | 329 | | |
329 | 330 | | |
330 | 331 | | |
331 | 332 | | |
332 | 333 | | |
333 | | - | |
334 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
335 | 338 | | |
336 | 339 | | |
337 | 340 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
99 | | - | |
100 | 98 | | |
| 99 | + | |
101 | 100 | | |
102 | 101 | | |
103 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | | - | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
38 | | - | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
| 85 | + | |
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
108 | 115 | | |
0 commit comments