Skip to content

feat(sl-viewer): Search tab + GET /api/search daemon endpoint - #42

Merged
KooshaPari merged 1 commit into
mainfrom
feat/sl-search-ui
Jul 4, 2026
Merged

feat(sl-viewer): Search tab + GET /api/search daemon endpoint#42
KooshaPari merged 1 commit into
mainfrom
feat/sl-search-ui

Conversation

@KooshaPari

Copy link
Copy Markdown
Owner

Summary

  • Adds a new Search tab to the sl-viewer Dioxus desktop app with form fields for since, until, model, min_tokens, tags (comma-separated, AND logic), and limit (default 50). Clicking Search calls GET /api/search on the sl-daemon at 127.0.0.1:8080 and renders results as bundle cards in the same style as the Bundles tab. Clear resets all fields and results.
  • Adds GET /api/search to sl-daemon/src/http.rs — accepts the same query parameters, applies FilterSpec via the existing apply_filters function, and returns a JSON array of BundleMeta (now also Serialize).
  • 10 unit tests: 5 for params_to_spec (daemon query param → FilterSpec mapping) and 5 for build_query (viewer URL construction), all green with 70 total tests passing.

Test plan

  • cargo test in crates/sl-daemon — 70 tests, 0 failed
  • cargo build -p sl-viewer — clean build, no warnings
  • cargo build -p sl-daemon — clean build, no warnings
  • cargo clippy -- -D warnings in crates/sl-daemon — clean
  • Live: sl serve --watch ./sessions --out ./okf-out, open viewer, click Search tab, enter model claude, click Search → results list appears

🤖 Generated with Claude Code

- Add Tab::Search variant and SearchView Dioxus component in sl-viewer
  with since/until/model/min_tokens/tags/limit form fields, Search and
  Clear buttons, and a results list in bundle-card style
- Add GET /api/search route to sl-daemon http.rs; accepts query params,
  applies FilterSpec via apply_filters, returns JSON array of BundleMeta
- Derive Serialize on BundleMeta so it can be returned by the HTTP handler
- Add 5 unit tests for params_to_spec and 5 for build_query (viewer side)
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Jul 4, 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: 46 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: Free

Run ID: 53e117c1-1be8-4861-b8ef-b9d4a960f36c

📥 Commits

Reviewing files that changed from the base of the PR and between 72c24e8 and f64ac83.

📒 Files selected for processing (5)
  • crates/sl-daemon/src/export.rs
  • crates/sl-daemon/src/http.rs
  • crates/sl-viewer/src/app.rs
  • crates/sl-viewer/src/lib.rs
  • crates/sl-viewer/src/search_view.rs

Note

🎁 Summarized by CodeRabbit Free

The PR author is not assigned a seat. To perform a comprehensive line-by-line review, please assign a seat to the pull request author through the subscription management page by visiting https://app.coderabbit.ai/login.

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

@KooshaPari
KooshaPari merged commit 6ca4961 into main Jul 4, 2026
8 of 11 checks passed
@KooshaPari
KooshaPari deleted the feat/sl-search-ui branch July 4, 2026 04:41
spawn(async move {
#[cfg(feature = "web")]
{
use_web_fetch(url, results, error, loading).await;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

CRITICAL: use_web_fetch is undefined — the web feature will fail to compile

The #[cfg(feature = "web")] branch calls use_web_fetch, but no such function exists in the crate. Enabling the web feature will fail with a compile error.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

}

/// Daemon base URL used for all HTTP calls.
const DAEMON_BASE: &str = "http://127.0.0.1:8080";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Hardcoded daemon address prevents configuration

DAEMON_BASE is locked to http://127.0.0.1:8080. This makes the viewer unusable if the daemon binds to a different address/port, and prevents proxying or remote daemon setups.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

}

/// Minimal percent-encoder — encodes the characters that break query strings.
fn urlencoding(s: &str) -> String {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Incomplete URL encoder breaks on %, ?, and other reserved characters

The custom urlencoding function only encodes a small subset of characters. Missing % (re-encoding risk), ? (query delimiter injection), ', and others. Unencoded % sequences can cause parse failures or misinterpretation.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

let tags_val = tags.clone();
let limit_val = limit.clone();

let on_search = move |_| {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Missing debounce guard on search allows concurrent requests

on_search sets loading.set(true) but never checks loading() to reject or queue additional clicks. Rapid clicks spawn overlapping requests that race to update state.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

#[cfg(not(feature = "web"))]
async fn reqwest_search(url: &str) -> Result<Vec<SearchResult>, String> {
// Dioxus desktop bundles tokio; we can do async HTTP directly.
let client = reqwest::Client::new();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

WARNING: Per-request reqwest::Client discards connection pooling

reqwest::Client is intended to be reused across requests. Creating a new instance per search forces fresh TCP/TLS handshakes and prevents connection reuse, degrading performance under repeated use.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

let tags_display = r.tags.join(", ");
rsx! {
div {
key: "{r.session_id}-{idx}",

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: Include render index in Dioxus key harms reconciliation stability

key: "{r.session_id}-{idx}" couples the key to the list position. When results reorder (e.g. new search), indices shift and Dioxus recycles DOM nodes unnecessarily. Prefer a stable unique key such as r.session_id alone, assuming it is unique.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

parts.push(format!("tags={}", urlencoding(tags)));
}
let limit = limit.trim();
let limit_val = limit.parse::<usize>().unwrap_or(50);

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: Silent fallback on invalid limit obscures user input

limit.parse::<usize>().unwrap_or(50) silently ignores non-numeric values. Consider preserving the invalid text or showing an inline error so the user understands why their input was ignored.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

Code Review Summary

Status: 7 Issues Found | Recommendation: Request Changes

Overview

Severity Count
CRITICAL 1
WARNING 5
SUGGESTION 1
Issue Details (click to expand)

CRITICAL

File Line Issue
crates/sl-viewer/src/search_view.rs 136 use_web_fetch is undefined; the web feature will fail to compile

WARNING

File Line Issue
crates/sl-viewer/src/search_view.rs 30 Hardcoded DAEMON_BASE prevents configurable host/port
crates/sl-viewer/src/search_view.rs 75 Incomplete URL encoder omits %, ?, and other reserved characters
crates/sl-viewer/src/search_view.rs 116 on_search has no debounce guard; concurrent requests can race
crates/sl-viewer/src/search_view.rs 258 Dioxus key includes list index, harming reconciliation stability
crates/sl-viewer/src/search_view.rs 285 Per-request reqwest::Client discards connection pooling

SUGGESTION

File Line Issue
crates/sl-viewer/src/search_view.rs 68 unwrap_or(50) silently drops invalid user input
Files Reviewed (5 files)
  • crates/sl-daemon/src/export.rs - 0 issues
  • crates/sl-daemon/src/http.rs - 0 issues
  • crates/sl-viewer/src/app.rs - 0 issues
  • crates/sl-viewer/src/lib.rs - 0 issues
  • crates/sl-viewer/src/search_view.rs - 7 issues

Fix these issues in Kilo Cloud


Reviewed by step-3.7-flash-20260528 · Input: 161.1K · Output: 31.1K · Cached: 636.4K

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant