
I’d use the sequence below. I have made one small dependency change: **Slice 6 creates the drawer shell and moves the existing stream information into it**, while Slices **7A–7C simplify each tab’s contents**. Otherwise, the Insights button would either be temporarily broken or the information would disappear between slices.

The prompts assume the reference images live under `codex_refs/`. Adjust that path when necessary.

A useful general rule for every slice is that the readable files under `src/plotsrv/static/js/` and `src/plotsrv/static/css/` are the source of truth. The fingerprinted files under `static/dist/` are generated and should be rebuilt with `scripts/build_ui_assets.py`, not edited manually.

# Codex prompts

## Slice 1 — Shared header status

**References**

* `codex_refs/01-header-live.png`
* `codex_refs/02-header-new-data.png`

```text
Implement Slice 1 of the plotsrv UI work: introduce the new shared header
status component and the state model that supports it.

Before changing code, inspect the existing render-agnostic page shell, status
handling, history/snapshot handling, UI configuration, and relevant tests.
Likely starting points include:

- src/plotsrv/html.py
- src/plotsrv/static/js/core/state.js
- src/plotsrv/static/js/core/status.js
- src/plotsrv/static/js/core/history.js
- src/plotsrv/static/css/layout.css
- src/plotsrv/static/css/controls.css
- src/plotsrv/static/css/status.css
- src/plotsrv/ui_config.py

Reference images:

- codex_refs/01-header-live.png
- codex_refs/02-header-new-data.png

The images are strong design references, not pixel-perfect specifications.
Preserve plotsrv’s restrained, lightweight character and use judgement where
the mockups contain generated-image quirks or conflict with the existing UI.

Create one consistent status element in the top header, positioned between the
plotsrv branding and the view selector. It should replace the existing separate
historical indicator and freshness dot as the main header-level representation
of view state.

The component should be able to represent at least:

- the latest view, currently up to date;
- stale and very stale data using the existing freshness policy;
- a historical snapshot;
- a future “new data available” state, even though the mechanism that produces
  that state will be implemented in Slice 2.

Keep these concepts separate internally rather than treating all of them as one
“live” boolean:

- whether the user is viewing latest data or a snapshot;
- the freshness of the latest underlying data;
- whether this browser has applied the latest available data.

Use a small explicit client-side state model and derive presentation from it.
Do not make CSS classes or DOM text the source of truth.

The status element should look interactive and should be implemented as an
accessible button. Because the fuller modal is Slice 4, provide only a minimal
working details surface using information already available, or another small
extensible interaction that avoids leaving a dead button. Do not build the
full arrival timeline in this slice.

Keep the component shared across ordinary tables, plots, artifacts, JSON,
Markdown, HTML, empty views, and streams. Do not introduce stream-only
assumptions into the shared header.

Do not remove useful lower-page error or status information yet unless its
replacement is already present. The bottom bar and old lower status treatment
will be handled later.

Potential difficulties to account for:

- A historical snapshot must not be described as stale simply because it is
  old; it is an intentionally selected historical view.
- Stream lifecycle state such as retrying or disconnected is related to, but
  not identical to, ordinary freshness.
- Existing UI settings such as show_freshness, show_history_banner, and
  show_statusline must not be silently broken. Review their intended
  compatibility and make any changed behaviour explicit in code and tests.
- Header layout must continue to work with long view names and on mobile.

Keep this slice focused on shared status architecture and the header component.
Do not implement automatic update notification yet.

Add or update focused tests. Edit source JS/CSS rather than generated bundles,
then rebuild the committed UI assets. Run the relevant tests available locally.

Do not commit or upversion. At the end, report:

- the state model introduced;
- the files changed;
- the tests and asset build run;
- the states and screen sizes I should inspect manually;
- any policy decision that remains open.
```

---

## Slice 2 — Smart, non-disruptive updates

**No image is needed for this slice.**

```text
Implement Slice 2 of the plotsrv UI work: replace timed browser refresh with a
lightweight, automatic, non-disruptive update mechanism.

Before changing code, inspect the complete current update path for ordinary
views and streams. Likely relevant areas include:

- src/plotsrv/store.py
- src/plotsrv/app.py
- src/plotsrv/http_streams.py
- src/plotsrv/streams/server_state.py
- src/plotsrv/static/js/core/state.js
- src/plotsrv/static/js/core/auto_refresh.js
- src/plotsrv/static/js/core/status.js
- src/plotsrv/static/js/core/app.js
- src/plotsrv/static/js/renderers/table.js
- src/plotsrv/static/js/renderers/stream.js
- src/plotsrv/static/js/renderers/table_plot_controls.js

Keep plotsrv’s existing ingestion model unchanged: applications and stream
producers should continue to send data to plotsrv through ordinary HTTP. This
slice concerns how the plotsrv server tells an open browser that something has
changed.

Choose the lightest robust mechanism that fits the project. Server-sent events
are likely suitable, but they are not mandatory if inspection reveals a
cleaner equivalent. Avoid WebSockets, a large client framework, or a new runtime
dependency unless there is a compelling reason.

The notification channel should communicate only that relevant state changed,
along with a bounded change token or small metadata. The browser should still
retrieve the actual table, plot, artifact, status, or incremental stream rows
through the existing HTTP endpoints.

There is already a per-view render_revision for ordinary rendered state. It may
be useful, but note that stream records currently live in StreamRegistry and
do not automatically advance that ordinary render revision. Ensure stream
appends, meaningful lifecycle changes, session changes, and relevant summary
changes participate in update awareness without coupling stream records to
ordinary snapshot publishing.

Implement a clear policy:

- Historical snapshots and selected historical stream sessions never
  automatically jump to latest.
- When the latest view is safe to update, apply the new data automatically.
- At minimum, active table search or filters should prevent automatic mutation
  of what the user is viewing.
- Consider grouping, explicit sorting, plot mode, plot interaction, open
  editors/panels, and similar state. Centralise the eligibility decision rather
  than scattering checks through renderers.
- When automatic application is paused, retain the visible data and set the
  shared status state to “new data available”.
- Give the user a clear explicit way to apply the waiting update. Applying it
  should preserve meaningful table or plot settings where practical; it must
  not silently clear filters or reset the working view.
- Coalesce multiple incoming notifications into one pending update rather than
  building a client-side backlog.

Preserve the stream cursor and incremental-fetch model. When an update is
allowed, the browser should still request only the new stream rows where
continuity permits.

Handle disconnects, reconnects, duplicate notifications, hidden browser tabs,
view changes, and multiple browser clients cleanly. Do not create unbounded
per-client queues or leak server-side subscribers.

A view can become stale merely because time passes, even when no new server
event occurs. Update relative ages and freshness transitions locally from the
known last-update timestamp and configured thresholds where possible. Do not
replace data polling with equally frequent status polling.

Retire the old interval-based behaviour, including the stream’s fixed one-second
browser polling. Remove or neutralise the obsolete auto-refresh selector so the
UI does not offer a setting that no longer controls anything. Leave the fuller
bottom-bar redesign for Slice 3. A manual refresh may remain temporarily only
as an intentional fallback until that slice.

Potential difficulties to account for:

- Ordinary views and stream views currently have different refresh paths.
- Heartbeats are not data arrivals, although lifecycle changes may still need
  to update the status UI.
- A notification may arrive while a fetch is already in flight.
- An update can occur between the initial page response and opening the event
  connection, so revision comparison must close that race.
- Freshness of server data and currency of the visible browser view are
  different states.

Add focused server and browser-contract tests, including update coalescing,
snapshot behaviour, active filters, stream cursors, reconnects, and cleanup.
Rebuild generated UI assets and run relevant tests.

Do not commit or upversion. At the end, report:

- the notification architecture chosen and why;
- the exact automatic-update eligibility policy;
- how ordinary and stream changes are represented;
- tests run and manual scenarios to inspect;
- any remaining ambiguity or resource concern.
```

---

## Slice 3 — Thin floating bottom bar

**References**

* `codex_refs/03-bottom-bar-storage-on.png`
* `codex_refs/04-bottom-bar-storage-off.png`

```text
Implement Slice 3 of the plotsrv UI work: replace the current page-bottom
controls with the new thin floating bottom bar.

Before changing code, inspect how footer controls are generated for every
renderer, how snapshot history is loaded, how export currently works, and how
storage enablement is determined. Likely relevant areas include:

- src/plotsrv/html.py
- src/plotsrv/app.py
- src/plotsrv/config.py
- src/plotsrv/ui_config.py
- src/plotsrv/static/js/core/history.js
- src/plotsrv/static/js/core/status.js
- src/plotsrv/static/js/renderers/table.js
- src/plotsrv/static/js/renderers/artifact.js
- src/plotsrv/static/js/renderers/plot.js
- src/plotsrv/static/css/layout.css
- src/plotsrv/static/css/controls.css
- src/plotsrv/static/css/status.css

Reference images:

- codex_refs/03-bottom-bar-storage-on.png
- codex_refs/04-bottom-bar-storage-off.png

The images are strong design references rather than pixel-perfect authority.
Keep the result visually restrained and consistent with the surrounding
plotsrv interface.

Make the lower control bar persistently accessible without requiring the user
to scroll to the end of the content. It should feel like a slim floating or
sticky toolbar, substantially thinner than the existing footer. Choose the CSS
positioning approach that works reliably with plotsrv’s page/card layout.

The bar should include:

- an Export control;
- a Snapshots control, replacing user-facing “History” terminology;
- optional existing controls that must remain supported, such as server
  termination, placed unobtrusively rather than silently removed.

Remove the manual Refresh and Auto-refresh controls now that Slice 2 supplies
smart updates.

Export should become a small dropdown where more than one truthful scope is
available. For rich tables, this will normally distinguish the current
filtered/visible table view from the complete published table available to
plotsrv. Preserve current file-backed export behaviour where appropriate.

Be precise for streams: plotsrv retains a bounded recent raw window, not
necessarily the complete source logfile. Do not label an option “whole
dataset”, “all stream data”, or similar unless that data is genuinely
available. Suitable stream scopes may be the current filtered view and the
complete currently retained raw window.

Where only one meaningful export exists, a simple export action is acceptable;
do not manufacture a dropdown containing duplicate or misleading choices.

For snapshots:

- When snapshot storage is enabled and available for the view, show the normal
  Snapshots selector.
- When enabled but no snapshots exist yet, communicate “No snapshots yet”
  without implying a failure.
- When storage is disabled or this view is not admitted to storage, do not show
  an apparently functional selector. Present a compact disabled/informational
  treatment inside the same control area, explaining in plain language why
  snapshots are unavailable.
- Add an explicit server capability/result field where needed. Do not infer
  “storage disabled” merely from an empty /history response, because an empty
  list can also mean storage is enabled but no snapshot has been written.
- Preserve snapshot URL behaviour and the ability to return to latest data.

Remove the old lower freshness/last-updated box only after its important
information and errors have a suitable home in the header status component,
its details surface, or another visible alert. Do not accidentally discard
restoration notices, deleted-snapshot errors, or renderer load failures.

Potential difficulties to account for:

- The floating bar must not cover table pagination, plot labels, mobile
  controls, or the final lines of Markdown/HTML.
- It needs to work on very short as well as very long pages.
- Storage admission may differ globally, per view, and for watched sources.
- Export semantics differ between rich tables, simple tables, file-backed
  tables, streams, artifacts, and server-rendered plots.
- Existing UI configuration options should retain sensible behaviour.

Add focused tests for generated HTML, storage enabled/disabled/empty states,
snapshot switching, and export choices. Rebuild UI assets and run relevant
tests.

Do not commit or upversion. At the end, report:

- the final bar contents for each renderer kind;
- the storage capability contract;
- exact export meanings;
- files and tests changed;
- desktop and mobile cases I should inspect manually.
```

---

## Slice 4 — Status and freshness modal

**References**

* `codex_refs/05-live-status-modal.png`
* optionally `codex_refs/06-arrival-timeline-detail.png`

```text
Implement Slice 4 of the plotsrv UI work: expand the header status control into
a useful, accessible status and freshness modal.

Before changing code, inspect the status component from Slice 1, the smart
update state from Slice 2, current freshness policy, stream lifecycle/status
data, and any existing plotting primitives that can be reused.

Reference images:

- codex_refs/05-live-status-modal.png
- codex_refs/06-arrival-timeline-detail.png, if present

These images show the overall concept and visual direction. They are not a
requirement to implement every field, button, chart control, or exact layout in
this first version. Prefer a coherent and truthful smaller implementation over
a large modal full of placeholder or weakly defined information.

The modal should open above the current view from the shared header status
button. At minimum, give the user a clear plain-language explanation of:

- whether they are viewing latest data or a snapshot;
- whether the visible browser view is current or a newer update is waiting;
- when plotsrv last received relevant data;
- when this browser last applied an update, where known;
- current freshness state;
- the configured expected interval and stale/very-stale thresholds, when
  freshness is enabled;
- relevant stream lifecycle or continuity state for stream views, without
  pretending plotsrv knows the application’s full state.

When newer data is waiting, include an explicit Update now action.

Add an initial data-arrival timeline. Keep it lightweight and modest:

- A simple dot/rug-style time series is suitable because this is event timing,
  not a continuous y-valued measurement.
- Provide an automatic useful time range and basic range adjustment.
- Do not add a large charting dependency merely to reproduce the mockup.
- Monthly aggregation, seven separate day facets, extensive zooming, and every
  conceptual control shown in the image may be deferred if they would make
  this slice disproportionately large.

Ordinary views currently retain only the latest update timestamp, not a history
of arrivals. Add a small bounded update-activity representation if needed.
Keep it independent of optional snapshot storage: update arrivals and snapshots
are different concepts. A bounded process-lifetime history is acceptable for
the first implementation if its scope is clearly communicated. Do not imply
that activity survives restart unless it actually does.

For streams, distinguish source records arriving from producer heartbeats.
Heartbeat or lifecycle changes may be shown elsewhere in the modal, but they
must not appear as data-arrival dots unless records were actually accepted.

Keep separate:

- server data arrival;
- server freshness;
- browser application of an update;
- snapshot selection.

Make the dialog accessible: labelled title, sensible initial focus, keyboard
dismissal, focus containment/restoration, scrollable content, and a mobile
layout that does not overflow the viewport. Avoid an unnecessarily strong
overlay because the underlying view remains useful context.

Potential difficulties to account for:

- Freshness can change locally as time passes without a new server event.
- Arrival history must be bounded.
- Stream and ordinary-view arrival mechanisms differ.
- Historical snapshots should show their timestamp and state without being
  evaluated as though they were live data.
- The modal must not expose internal queue/storage diagnostics by default;
  technical information can use progressive disclosure.

Add focused tests for modal markup/state, timeline data bounds, current versus
waiting updates, snapshots, freshness disabled, and stream-specific status.
Rebuild UI assets and run relevant tests.

Do not commit or upversion. At the end, report:

- what information the first modal version contains;
- how timeline activity is recorded and bounded;
- what parts of the conceptual mockup were deliberately deferred;
- tests run;
- manual states I should inspect.
```

---

## Slice 5 — Consolidate shared table and plot behaviour

**Reference**

* `codex_refs/07-table-plot-controls.png`

```text
Implement Slice 5 of the plotsrv UI work: audit, consolidate, and finish the
shared Table/Plot capability for table-rendered views.

This codebase already contains substantial shared plotting work. Do not start
again or introduce a parallel plotting system. Begin by understanding the
existing implementation and identify only the remaining duplication,
inconsistency, or renderer coupling.

Likely relevant areas include:

- src/plotsrv/html.py
- src/plotsrv/static/js/renderers/table.js
- src/plotsrv/static/js/renderers/table_plot.js
- src/plotsrv/static/js/renderers/table_plot_controls.js
- src/plotsrv/static/js/renderers/stream.js
- src/plotsrv/static/js/renderers/json.js
- the corresponding table, plot-control, stream, and JSON CSS
- relevant table, stream, JSON-renderer, and browser-asset tests

Reference image:

- codex_refs/07-table-plot-controls.png

The image is a strong indication of desired hierarchy and simplicity, not a
pixel-perfect specification.

The intended result is one coherent table-exploration capability used by:

- ordinary rich tables;
- stream-backed tables;
- eligible rectangular JSON table views.

Make the Table/Plot switch, shared controls, state, and data-scope language
consistent across those surfaces. Extract reusable HTML or controller helpers
where this materially reduces the duplicated ordinary-table and stream markup,
but do not turn this into a broad frontend-framework rewrite.

Preserve the established rule that ordinary table plots use currently loaded
rows that pass the browser’s active filters, and disclose that scope clearly.

Streams may also plot derived summary windows. Keep that source explicitly
separate from raw retained rows:

- derived summaries are not original source records;
- raw-table filters do not automatically apply to summary windows;
- the UI must make the selected plot source understandable.

Ensure state remains stable across:

- switching Table and Plot;
- data updates applied by Slice 2;
- filtering and clearing filters;
- column changes;
- grouping;
- selecting current versus historical data where supported.

Review empty data, no numeric fields, unsuitable field selections, row/point
limits, and renderer errors. Keep failure states readable rather than leaving
an empty SVG area.

Do not force the feature into the server-rendered simple-table mode if doing so
would require a separate implementation or undermine its purpose. Make its
supported capability explicit instead.

Potential difficulties to account for:

- state.tabulatorInstance is intentionally shared by ordinary and stream table
  controllers; avoid creating competing instances or duplicated state.
- Some logic currently branches on config.kind === "stream".
- Rectangular JSON is still an artifact renderer even when it mounts the table
  explorer.
- The page assumes one active table surface and uses global element IDs.
- The existing lightweight SVG renderer suits plotsrv’s resource philosophy;
  do not add a large plotting dependency in this slice.

This is an architectural and behavioural consolidation slice, not the final
plot-design exercise. Avoid speculative new plot types or extensive visual
polish.

Add focused tests demonstrating the same core behaviour for an ordinary table,
a stream table, and eligible rectangular JSON. Rebuild UI assets and run
relevant tests.

Do not commit or upversion. At the end, report:

- what was already shared;
- what was consolidated or corrected;
- any deliberately retained renderer-specific behaviour;
- tests run;
- remaining plot-design questions for the later brainstorming work.
```

---

## Slice 6 — Stream controls and drawer foundation

**References**

* `codex_refs/08-stream-controls.png`
* `codex_refs/09-current-stream-ui.png`

```text
Implement Slice 6 of the plotsrv UI work: simplify the stream main page, add the
compact stream-control strip, and establish the functional Stream Insights
drawer.

Before changing code, inspect the current stream HTML, shared table controller,
stream history/session selection, and the browser functions that render Since
last visit, Noteworthy observations, and Derived compact history.

Likely relevant areas include:

- src/plotsrv/html.py
- src/plotsrv/static/js/renderers/stream.js
- src/plotsrv/static/js/renderers/table.js
- src/plotsrv/static/js/renderers/table_plot_controls.js
- src/plotsrv/static/css/renderers/stream.css
- src/plotsrv/static/css/renderers/table.css
- src/plotsrv/static/css/renderers/table_plot_controls.css
- src/plotsrv/http_streams.py
- relevant stream browser and storage tests

Reference images:

- codex_refs/08-stream-controls.png
- codex_refs/09-current-stream-ui.png

The first image is a strong visual direction, not a pixel-perfect authority.
The second image documents the verbose development UI being replaced.

Add a shallow Stream controls strip directly above the ordinary table controls.
Its main structure should be:

- Session first;
- Grouping second;
- Insights at the right.

Keep the normal table controls beneath it, including Search, Filters, Columns,
Reset view, and Table/Plot. Stream-specific controls must not appear on
ordinary views.

Session should represent the current session and any genuinely available
stored sessions. When persistent stream history is unavailable or no stored
sessions exist, show a truthful static Current session state rather than an
empty or misleading dropdown. Do not confuse stream session history with
ordinary snapshot storage.

Move grouping into the Stream controls strip for stream views while preserving
ordinary table grouping behaviour elsewhere.

The Insights action must be functional in this slice. Create the accessible
right-hand drawer and move the three existing information sections into tabs:

- Since last visit;
- Noteworthy;
- History.

At this stage, preserve most of the existing information and wording. Slices
7A–7C will simplify each tab separately. The goal here is structural movement,
not a full content rewrite.

The drawer should be closed by default. On desktop it should behave as a
substantial companion panel from the right, approximately half the available
screen with a sensible maximum width. On mobile it may become nearly or fully
screen width. Use a light or absent backdrop so the underlying table remains
useful context.

Remove the three large permanent information panels from the main page once
their content is available in the drawer. Preserve existing element identities
or update their selectors carefully so the current rendering logic continues
to work.

Retain important stream lifecycle, source-health, retry, continuity, and
unavailable-state information. It can be condensed or moved into the shared
status/modal or the drawer, but it must not simply disappear as part of making
the page cleaner.

Potential difficulties to account for:

- The current stream and ordinary table HTML are partly duplicated.
- stream.js expects specific element IDs and currently renders directly into
  inline sections.
- The Insights button must not be left dead between slices.
- Switching current/stored sessions must update table, summaries, tab content,
  status, cursor state, and plot source coherently.
- Moving the Group control must not split the shared table state into a second
  stream-only implementation.
- Focus should move into the drawer when opened and return to Insights when
  closed. Tabs need keyboard-usable semantics.

Do not substantially rewrite the meaning of Since last visit, Noteworthy, or
History in this slice. Preserve their current truthfulness and move them first.

Add focused tests for stream-only rendering, session states, drawer
open/close/tab behaviour, and ordinary-table non-regression. Rebuild UI assets
and run relevant tests.

Do not commit or upversion. At the end, report:

- the new main-page hierarchy;
- where lifecycle and health information now appears;
- session behaviour with storage on and off;
- tests run;
- the drawer and mobile states I should inspect.
```

---

## Slice 7A — Simplify “Since last visit”

**Reference**

* `codex_refs/10-insights-since-last-visit.png`

```text
Implement Slice 7A of the plotsrv UI work: redesign the Since last visit tab in
the Stream Insights drawer for a casual, non-technical user.

Before changing code, understand the existing checkpoint and exact-comparison
logic in both state.js and stream.js. The existing implementation is
deliberately conservative about continuity, session identity, counter
regression, and unavailable comparisons. Preserve those truthfulness rules.

Reference image:

- codex_refs/10-insights-since-last-visit.png

The image is a strong design and content-hierarchy reference, not a
pixel-perfect specification.

Make Since last visit the natural default tab. Present a concise primary
summary first, such as:

- how many accepted records arrived;
- whether noteworthy activity occurred;
- when the latest relevant activity was observed;
- or, when exact comparison is unavailable, a short neutral explanation.

Use plain language. A casual user should not need to understand producer
sessions, compatible checkpoints, monotonic counters, browser sequence
numbers, or checkpoint schema versions to understand the result.

Preserve the important distinction between:

- zero known changes;
- exact comparison unavailable;
- continuity uncertain;
- the producer session changing;
- viewing a historical stored session.

Never turn an unknown comparison into “0 new records”.

Place implementation details behind a collapsed Technical details disclosure.
That area may include session IDs, stream instance identity, counter values,
checkpoint reason, continuity state, and exact timestamps where useful.

Keep the existing browser-local checkpoint semantics unless a change is
strictly necessary for presentation. In particular, do not casually change its
storage key/schema or make the baseline advance during every update.

Use safe DOM text rendering for all stream-controlled values.

Potential difficulties to account for:

- BigInt-backed counters and compatibility validation are important for exact
  comparison.
- The first valid response of a visit establishes the comparison baseline; it
  must not turn into “since the last automatic update”.
- Session changes and server restarts can make comparison impossible.
- Historical sessions should not update the live-visit checkpoint.

Keep this slice focused on the Since last visit tab. Do not redesign the
Noteworthy or History content yet.

Add focused tests for exact deltas, no changes, unavailable checkpoints,
continuity uncertainty, session changes, and historical sessions. Rebuild UI
assets and run relevant tests.

Do not commit or upversion. At the end, report:

- the plain-language states now shown;
- where technical information remains available;
- confirmation that comparison semantics were preserved;
- tests run;
- examples I should inspect manually.
```

---

## Slice 7B — Simplify “Noteworthy”

**Reference**

* `codex_refs/11-insights-noteworthy.png`

```text
Implement Slice 7B of the plotsrv UI work: redesign the Noteworthy tab in the
Stream Insights drawer for a casual, non-technical user.

Before changing code, inspect the existing deterministic noteworthy object
types and rendering paths. Preserve the existing server-side classification
and bounded-retention semantics. This is primarily a presentation and language
slice, not a new anomaly-detection system.

Reference image:

- codex_refs/11-insights-noteworthy.png

The image gives strong direction for hierarchy and card-like presentation but
is not a pixel-perfect specification.

Replace the current implementation-oriented item labels with short,
human-readable summaries. Examples of the intended style include:

- “New status appeared”
- “Data structure changed”
- “Warning received”
- “Continuity may have been interrupted”
- “A new high value was observed”

Use the actual event type and data to choose truthful wording. Do not infer
meaning from arbitrary message text and do not add NLP, anomaly detection, or
alerting claims.

Each item should present:

- a clear title;
- a short explanation;
- a useful observed time;
- a restrained visual indication of category or severity where appropriate.

Do not rely on colour alone. Keep warning/error styling proportionate; neutral
schema or first-appearance information should not look like a system failure.

Retain exact object type, server/browser sequence, noteworthy reason, schema
revision, raw source record, extrema details, and similar fields behind a
Technical details disclosure. Preserve the ability of a technical user to
inspect what plotsrv actually observed.

Clearly communicate that Noteworthy is a bounded retained selection rather
than a complete event history, but do this once in calm plain language rather
than repeating a warning on every item.

Provide good states for:

- no noteworthy items;
- items that have aged out of bounded retention;
- malformed or unknown-but-valid future item types;
- loading or request failure.

Continue using textContent or equivalent safe DOM construction for
source-controlled fields. Do not introduce unsafe HTML interpolation while
making the cards more visual.

Potential difficulties to account for:

- Some items are source records; others are plotsrv system notices.
- Recognised severity is deterministic and narrower than arbitrary log text.
- First appearances and numeric extrema are noteworthy observations, not
  necessarily warnings.
- The collection can be truncated or age out, so counts and wording must not
  imply completeness.

Keep this slice focused on the Noteworthy tab. Do not redesign derived history
or alter server classification rules unless a small correction is clearly
required.

Add focused rendering tests for each main item category, bounded/empty states,
unknown types, safe source text, and accessible disclosures. Rebuild UI assets
and run relevant tests.

Do not commit or upversion. At the end, report:

- the item categories and user-facing names;
- how boundedness is communicated;
- where raw technical data remains;
- tests run;
- examples I should inspect manually.
```

---

## Slice 7C — Simplify “History”

**Reference**

* `codex_refs/12-insights-history.png`

```text
Implement Slice 7C of the plotsrv UI work: redesign the History tab in the
Stream Insights drawer so derived compact stream history is understandable to
a casual user.

Before changing code, inspect:

- the current stream summary payload and tiers;
- summary retention and aggregation rules;
- current versus stored-session selection;
- durable_history metadata;
- the existing rendering in stream.js;
- the known limitations of storage-enabled stream persistence on this branch.

Reference image:

- codex_refs/12-insights-history.png

The image is a strong conceptual and visual reference, not a pixel-perfect
specification.

Rename user-facing “Derived compact history” to simply “History”. Explain in
plain language that older observations may be summarised as they leave the
short recent-data window.

The primary presentation should answer:

- whether older summarised activity exists;
- what period it covers;
- the level of time resolution;
- the most useful counts or numeric summaries;
- whether the user is looking at the current or a stored session.

Avoid presenting every internal field at once. Show a small useful summary and
put full aggregate bounds, category tracking, sequence ranges, truncation
metadata, tier names, and raw JSON behind Technical details.

Preserve the strict distinction between:

- recent raw source records;
- derived aggregate windows;
- cumulative oldest-history summaries;
- stored stream sessions.

Derived windows must never be presented as original logfile rows. Raw-table
filters do not automatically apply to them unless that has been explicitly and
correctly implemented.

Do not equate this History tab with snapshot storage. Current-session compact
summaries can exist while persistent storage is disabled. Stored session
selection is a separate capability controlled from the Stream controls strip.

Provide calm, useful empty states such as “No older history yet”. Storage being
off should not make current-session compact history look broken.

The current development branch has known unresolved P1 issues in stream
persistence. Do not claim that stored stream history is a complete archive or
guaranteed audit record, and do not hide known continuity/incompleteness
metadata. Do not undertake a broad persistence repair incidentally in this UI
slice; represent the available information honestly.

Keep terminology approachable. Technical terms such as fine window, coarse
window, compact generation, bounded categorical retention, or schema revision
belong in optional details rather than the primary view.

Finish any small consistency issues across the three drawer tabs that become
apparent here, such as matching empty-state structure, tab counts, loading
language, and disclosure styling, but do not turn this into a general
application hardening pass.

Potential difficulties to account for:

- Summaries have different resolutions and may be progressively compacted.
- Category counts can contain an explicit untracked/other portion.
- Numeric minima/maxima include exact source-sequence provenance.
- Historical sessions can contain compact summaries without persisted raw
  records.
- Persistence incompleteness and continuity uncertainty must remain visible
  when relevant without dominating the casual interface.

Add focused tests for no history, fine/coarse/cumulative windows, stored
sessions, storage disabled, truncation, and technical disclosures. Rebuild UI
assets and run relevant tests.

Do not commit or upversion. At the end, report:

- the new plain-language history model;
- which aggregate information is primary versus technical;
- how current and stored sessions are distinguished;
- tests run;
- examples I should inspect manually.
```

