Skip to content

fix(viewer): reactive corpus loading + raw-sessions tab + brand splash - #417

Merged
KooshaPari merged 3 commits into
mainfrom
fix/viewer-data-flow-unblock-20260805
Aug 7, 2026
Merged

fix(viewer): reactive corpus loading + raw-sessions tab + brand splash#417
KooshaPari merged 3 commits into
mainfrom
fix/viewer-data-flow-unblock-20260805

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Aug 7, 2026

Copy link
Copy Markdown
Owner

User description

What

Three commits on `fix/viewer-data-flow-unblock-20260805` that together fix the
"every page has no data" complaint, expose the underlying corpus, and put a
brand on the launch splash.

  1. `198a210` — fix(viewer): reactive corpus loading + raw-sessions tab
    The async `load_sessions` populates one `Signal<Vec>` at the App
    root. Three tab components (`BundlesTab` via `use_effect` + separate
    `bundles` signal; `HistoryTimeline` and `MemoryWiki` via `use_signal(move
    || ...)` initializers) snapshotted that signal at mount, when it was still
    empty. The async load later updated the signal but those tabs never
    re-evaluated, so they froze on "No bundles" / empty rows forever.
    Drop the indirection: each tab now reads `ctx.0.read()` directly in the
    component body, which Dioxus 0.6 tracks as a reactive dependency. Adds
    `Tab::Corpus` (Raw Sessions) that exposes the underlying `Vec>
    with corpus / id / title / message count / last activity, plus a Reload
    button that re-runs discovery on demand. Also adds the brand icon
    pipeline at origin/main (`Tab::icon()`, `ICON_SVG_*` constants,
    `icon_svg()` lookup, `dangerous_inner_html` in the tab button) and
    `assets/icons/line/corpus.svg`.

  2. `335dcba` — feat(viewer): add loading + error states for long corpus discovery
    The first commit fixed the reactivity but the full `DataSource::Auto`
    scan touches 13k+ files and takes minutes on real hardware, so the user
    has no signal that the app is working — just slow. Adds a
    `DiscoveryState` context that exposes `(loading: bool, error: Option)`
    at the App root. `BundlesTab` and `CorpusTab` branch on it:

    • loading && bundles empty -> `LoadingState` skeleton ("Discovering
      local session corpus…").
    • error && bundles empty -> `ErrorState` with a Reload button.
    • otherwise -> real bundles / `FirstRunEmpty`.
  3. `6c9a623` — feat(viewer): brand splash with mascot + animated loading dots
    The launch splash was plain "SessionLedger / Viewer" text on a blank
    panel. Replace with a brand splash that ties to the rest of the asset
    suite:

    • Getta mascot (`assets/brand/mascot/getta-base.svg`) embedded at
      compile time, rendered at 96×96 with a soft accent drop-shadow
      and a 2.4s vertical float.
    • 3-dot bouncing spinner (180ms stagger) below the caption, with
      `role=progressbar` + `aria-label`.
    • Caption changed from "Viewer" to "Session viewer".

Why

The user reported:

  • "every page has no data" — root cause was a reactive-read bug,
    now fixed.
  • "there is no page regarding raw session discovery" — added
    `Tab::Corpus`.
  • "boot splash is a white screen with blue sf pro or serifed text which
    looks weak/poor and has no loading skeleton/circle or similar nor our
    branding icons" — replaced with the brand splash.

Verification

  • `cargo test -p sl-viewer --lib --all-features --locked` — 69 passed, 0 failed.
  • `cargo build --release -p sl-viewer --features desktop` — clean.
  • `cargo clippy -p sl-viewer --lib --all-features --locked` — only
    pre-existing warnings (`App` snake_case, `default_subdir` dead code).
  • `cargo fmt --all -- --check` — clean.
  • Installed binary SHA: `a96dff7a…`
  • Binary string-table contains: `tab-corpus`, `panel-corpus`, `Raw
    Sessions`, `Reload discovery`, `Discovering local session corpus`,
    `launch-splash-mascot`, `launch-splash-spinner`, `getta-body` /
    `getta-light` / `getta-amber` / `getta-shadow` gradient defs.
  • `daemon_url::daemon_api_url("/api/stream")` returns
    `http://127.0.0.1:8080/api/stream\` (matches the running sl-daemon).

Out of scope (left for follow-up)

  • Parquet support for `~/.claude/projects/*.parquet` (`JsonCorpusSource`
    only parses `.jsonl`). FR-RAW-3.
  • Custom corpus path picker — the Reload button re-runs the current
    source; a path picker would be FR-RAW-2.
  • macOS menu bar for app-level controls (File / View / Help).
  • Settings page.
  • Grapheon PR feat(p3): Acceptance extractor + compile-to-bundle pipeline #5 (`ci: publish recovered default required gates`) — still open.
  • Pre-existing `main.rs` `fn main` duplicate under `#[cfg(feature =
    "desktop")]` / `#[cfg(feature = "web")]` (test target compiles both
    features).

Test plan for reviewer

cargo test -p sl-viewer --lib --all-features --locked
cargo build --release -p sl-viewer --features desktop
cargo run -p sl-viewer --release

With sl-daemon running on 127.0.0.1:8080

Click through Bundles / History / Memory / Unfinished / Timeline / Corpus

to see real session data

Click the Raw Sessions tab; click "Reload discovery" to re-run


CodeAnt-AI Description

Make corpus discovery visible and expose raw sessions in the viewer

What Changed

  • Existing Bundles, History, and Memory views now update when asynchronous session discovery finishes instead of remaining empty from their initial state.
  • Added a Raw Sessions tab showing discovered sessions by source, title, ID, message count, and latest activity, sorted with the newest sessions first.
  • Added loading, error, empty, and retry states for long-running corpus discovery, including a Reload discovery action.
  • Added branded tab icons and an animated mascot with a loading indicator to the launch splash.
  • Added opt-in smoke tests for checking real local Codex, Claude, and Cursor corpora.

Impact

✅ Fewer empty viewer tabs after startup
✅ Clearer progress and retry feedback during corpus scans
✅ Direct visibility into discovered local sessions

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Droid added 3 commits August 6, 2026 01:40
The async corpus loader populates a single Signal<Vec<Session>> in App()
via spawn_blocking. Earlier revisions piped that signal through
use_effect (BundlesTab) and use_signal(move || ...) initializers
(HistoryTimeline, MemoryWiki) before reading it from the rsx body. Both
patterns snapshot the signal at mount, when sessions is still empty, so
the tabs froze on 'No bundles' / empty rows forever even after
discovery finished.

Drop the indirection: each tab now reads ctx.0.read() directly in the
component body, which Dioxus tracks as a reactive dependency. The async
load now propagates into the visible UI without a manual resubscribe.

Also adds a Raw Sessions tab (Tab::Corpus) that exposes the underlying
Vec<Session> — corpus, id, title, message count, last activity — plus a
Reload button that re-runs discovery on demand. Gives the user a
'feed it myself any data' affordance without a custom-path picker
(FR-RAW-1, FR-RAW-2 deferred).

The brand icon pipeline is re-applied at origin/main (was previously
local-only): tab.icon() method, ICON_SVG_* constants, icon_svg()
lookup, and dangerous_inner_html in the tab button. A new line
icon (corpus.svg) joins the 8 existing tab icons.

While here, cargo fmt --all re-aligned web_exports.rs to the canonical
rustfmt form (125 lines, whitespace only).
The first commit on this branch fixed the empty-data reactivity bug, but
left the UX half-broken: when the async load_sessions call is still
running (minutes on a 13k-file codex corpus), every tab shows the same
'No sessions ingested yet' message. The user has no signal that the
app is working, just slow.

Add a DiscoveryState context that exposes (loading: bool, error:
Option<String>) at the App root. BundlesTab and CorpusTab now branch
on that:

  - loading && bundles empty  -> LoadingState skeleton ('Discovering
    local session corpus…'). Same component the visual fixture path
    uses so the operator gets a familiar skeleton, not a dead end.
  - error && bundles empty    -> ErrorState with a Reload button that
    bumps ReloadTrigger, re-running the discovery effect.
  - bundles empty (post-load)-> FirstRunEmpty (the existing CTA).
  - otherwise                -> real bundles.

Verification (this branch, head SHA 3847d226… before this commit):
  cargo test -p sl-viewer --lib --all-features --locked  -> 69 passed
  cargo build --release -p sl-viewer --features desktop -> clean
  binary string-table includes 'Discovering local session corpus'
    and sl-loading-state CSS hook

Also keep an ignored corpus smoke test behind --ignored so a future
session can run a real Auto scan on demand without blocking lefthook
or CI.
The launch splash was plain 'SessionLedger / Viewer' text on a blank
panel — no brand recognition, no loading affordance, and the
caption duplicated the app name verbatim.

Replace it with a brand splash that ties to the rest of the asset
suite:

  - Getta mascot (the brand scholar-keeper from
    assets/brand/mascot/getta-base.svg) is now embedded at compile
    time and rendered at 96x96 with a soft accent drop-shadow and a
    2.4s vertical float animation. Uses dangerous_inner_html so the
    inline SVG (with its Lab-Coat cobalt gradient body and amber live
    ring) renders without an extra HTTP request.
  - A 3-dot bouncing spinner (splash-spinner-bounce keyframes, 180ms
    stagger) sits below the caption. role=progressbar + aria-label so
    screen readers report the loading state.
  - Caption changed from 'Viewer' to 'Session viewer' to make the
    role clear at a glance.

The pre-existing splash-dismiss animation (1.2s delay, ease-out fade)
is preserved; the splash hold fixture still pins the splash for
visual regression capture.

Verification (post-install):
  binary SHA-256 = a96dff7a…
  binary string-table contains:
    launch-splash-mascot, launch-splash-spinner, launch-splash-spinner-dot
    progressbar, Loading viewer
    getta-body / getta-light / getta-amber / getta-shadow gradient defs
Copilot AI lite review requested due to automatic review settings August 7, 2026 02:06
@codeant-ai

codeant-ai Bot commented Aug 7, 2026

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Reviewed your PR 6c9a623 Aug 07, 2026 · 02:06 02:09

@codeant-ai

codeant-ai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@KooshaPari, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 41 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e0fb6cf6-1c4d-4176-8e85-722e979d8706

📥 Commits

Reviewing files that changed from the base of the PR and between 2c712cb and 6c9a623.

⛔ Files ignored due to path filters (1)
  • assets/icons/line/corpus.svg is excluded by !**/*.svg
📒 Files selected for processing (7)
  • crates/sl-viewer/src/app.rs
  • crates/sl-viewer/src/corpus_tab.rs
  • crates/sl-viewer/src/history_tab.rs
  • crates/sl-viewer/src/lib.rs
  • crates/sl-viewer/src/memory_tab.rs
  • crates/sl-viewer/src/web_exports.rs
  • crates/sl-viewer/tests/corpus_smoke.rs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codeant-ai codeant-ai Bot added the size:XL This PR changes 500-999 lines, ignoring generated files label Aug 7, 2026
// updates the session signal. The earlier `use_signal(move || ...)`
// wrapper only ran the closure once at mount, so the timeline stayed
// frozen on the (then-empty) initial value forever.
let entries = all_timeline_entries(&ctx.0.read());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: selected_idx is retained while entries is rebuilt from the newly loaded session vector. After discovery or reload changes the order or membership, the same index can select a different session, so the detail pane silently changes identity; if the new list is shorter, the selection also disappears. Track the selected session by stable ID or explicitly clear/reconcile the selection when the corpus changes. [stale reference]

Severity Level: Major ⚠️
- ⚠️ History selection can silently change session identity after reload.
- ⚠️ Removed sessions leave the detail pane unexpectedly empty.

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** crates/sl-viewer/src/history_tab.rs
**Line:** 115:115
**Comment:**
	*Stale Reference: `selected_idx` is retained while `entries` is rebuilt from the newly loaded session vector. After discovery or reload changes the order or membership, the same index can select a different session, so the detail pane silently changes identity; if the new list is shorter, the selection also disappears. Track the selected session by stable ID or explicitly clear/reconcile the selection when the corpus changes.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

// change. Mirrors the HistoryTimeline fix — `use_signal(move || ...)`
// initializer only runs once at mount, so the previous code froze on
// the initial empty value.
let pages = all_wiki_pages_from_sessions(&ctx.0.read());

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Every render recomputes all four heuristic extractors for every session. Because this component also reads selected_idx, merely selecting or switching a page reruns the full corpus-wide derivation, which can make the UI sluggish or block rendering for the large local corpus described by the application. Cache the derived pages and invalidate them only when the session signal changes. [performance]

Severity Level: Major ⚠️
- ⚠️ Memory page selection repeats corpus-wide extraction work.
- ⚠️ Large local corpora can make the Memory tab sluggish.

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** crates/sl-viewer/src/memory_tab.rs
**Line:** 66:66
**Comment:**
	*Performance: Every render recomputes all four heuristic extractors for every session. Because this component also reads `selected_idx`, merely selecting or switching a page reruns the full corpus-wide derivation, which can make the UI sluggish or block rendering for the large local corpus described by the application. Cache the derived pages and invalidate them only when the session signal changes.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Ok(load_sessions(&source))
}
};
loading_signal.set(false);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Each reload starts an independent discovery task, but completion is not associated with the reload that started it. A slower earlier task can execute this line after a newer reload, setting loading to false while the newer scan is still running and allowing stale results or errors to overwrite the newer state. Track a generation number and ignore results from obsolete tasks, or cancel the previous task before starting another. [race condition]

Severity Level: Major ⚠️
- ❌ Reloaded corpus can be replaced by stale discovery results.

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** crates/sl-viewer/src/app.rs
**Line:** 329:329
**Comment:**
	*Race Condition: Each reload starts an independent discovery task, but completion is not associated with the reload that started it. A slower earlier task can execute this line after a newer reload, setting `loading` to false while the newer scan is still running and allowing stale results or errors to overwrite the newer state. Track a generation number and ignore results from obsolete tasks, or cancel the previous task before starting another.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

ts_ms,
.collect()
} else if let Some(map) = value.get("mapping").and_then(|m| m.as_object()) {
map.values()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: The mapping object is flattened using map.values(), whose order is based on JSON object-key iteration rather than the conversation's parent/child or chronological order. This makes the message vector scrambled for normal opaque node IDs; HistoryTimeline uses the first messages for previews and the last message for unfinished-state detection, so imported conversations can display incorrect previews and completion status. Follow the mapping parent chain or sort by the source timestamps before constructing the session. [logic error]

Severity Level: Major ⚠️
- ❌ Imported transcript previews can show wrong messages.
- ⚠️ Completion detection can inspect the wrong final message.

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** crates/sl-viewer/src/web_exports.rs
**Line:** 192:192
**Comment:**
	*Logic Error: The mapping object is flattened using `map.values()`, whose order is based on JSON object-key iteration rather than the conversation's parent/child or chronological order. This makes the message vector scrambled for normal opaque node IDs; `HistoryTimeline` uses the first messages for previews and the last message for unfinished-state detection, so imported conversations can display incorrect previews and completion status. Follow the mapping parent chain or sort by the source timestamps before constructing the session.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

_ => String::new(),
})
.unwrap_or_default();
let ts_ms = msg.get("create_time").and_then(|v| v.as_f64().map(|f| f as i64));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Message::ts_ms is defined as Unix milliseconds, but ChatGPT mapping exports use create_time in Unix seconds. Storing the seconds value directly makes imported timestamps about one thousand times too small, causing dates to render near 1970 and making activity comparisons against native millisecond timestamps incorrect. Convert the vendor value from seconds to milliseconds before assigning it. [logic error]

Severity Level: Major ⚠️
- ❌ Imported activity dates render near 1970.
- ⚠️ Raw Sessions sorting uses incorrect timestamps.

Fix in Cursor Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** crates/sl-viewer/src/web_exports.rs
**Line:** 214:214
**Comment:**
	*Logic Error: `Message::ts_ms` is defined as Unix milliseconds, but ChatGPT mapping exports use `create_time` in Unix seconds. Storing the seconds value directly makes imported timestamps about one thousand times too small, causing dates to render near 1970 and making activity comparisons against native millisecond timestamps incorrect. Convert the vendor value from seconds to milliseconds before assigning it.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

@KooshaPari
KooshaPari merged commit 5967a14 into main Aug 7, 2026
92 of 109 checks passed
@KooshaPari
KooshaPari deleted the fix/viewer-data-flow-unblock-20260805 branch August 7, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants