fix durable options history routing

This commit is contained in:
dirtydishes 2026-05-16 22:00:21 -04:00
parent 23ed3809cc
commit 1424a2716f
8 changed files with 271 additions and 4 deletions

View file

@ -1003,6 +1003,17 @@ h3 {
overflow: hidden;
}
.history-load-warning {
flex: 0 0 auto;
padding: 8px 12px;
border-top: 1px solid oklch(0.72 0.13 58 / 0.45);
border-bottom: 1px solid oklch(0.72 0.13 58 / 0.45);
background: oklch(0.24 0.05 58 / 0.72);
color: oklch(0.91 0.08 72);
font-size: 0.78rem;
line-height: 1.35;
}
.data-table-wrap {
display: flex;
flex: 1 1 auto;

View file

@ -7109,6 +7109,13 @@ type OptionsPaneProps = {
const OptionsPane = memo(({ state, limit }: OptionsPaneProps) => {
const items = limit ? state.filteredOptions.slice(0, limit) : state.filteredOptions;
const virtual = useTapeVirtualList(items, state.optionsScroll.listRef, getTapeVirtualConfig("options"));
const optionHistorySubscription = state.liveSession.manifest.find(
(subscription) => subscription.channel === "options"
);
const optionHistoryKey = optionHistorySubscription ? getLiveSubscriptionKey(optionHistorySubscription) : null;
const optionHistoryError = optionHistoryKey
? state.liveSession.historyErrors[optionHistoryKey]
: null;
useVirtualHistoryGate(state.mode === "live" && !limit, items.length, virtual.virtualItems.at(-1)?.index ?? -1, () =>
void state.liveSession.loadOlder("options")
);
@ -7139,6 +7146,11 @@ const OptionsPane = memo(({ state, limit }: OptionsPaneProps) => {
}
>
<div className="data-table-shell">
{state.mode === "live" && optionHistoryError ? (
<div className="history-load-warning" role="status">
Older option history failed to load: {optionHistoryError}
</div>
) : null}
{items.length === 0 ? (
<div className="empty">
{state.mode === "live"