feat(web): session search/filter with improved UX - #2528
Open
ozanonurtek wants to merge 9 commits into
Open
Conversation
GET /sessions gains optional search (username OR target name, via a subquery over the target snapshot JSON), from/to (session start range) and protocol (case-insensitive exact) filters. Filter composition lives in a sessions_query helper so it can be tested without HTTP. Part of warp-tech#2418
The sessions page gets ItemList's debounced free-text search (matches username or target name server-side) plus protocol, from/to and the existing toggles. Every filter persists via autosave and re-triggers the query through the existing rxjs pipeline. Part of warp-tech#2418
The terminal player toolbar gains a search box (terminal recordings only). Submitting streams the whole data.ndjson through a second RangeStream — memory-bounded, abortable, works for disk/S3/live — strips ANSI escapes, and collects line-based matches with timestamps. Clicking a match seeks playback to it via the existing keyframe seek path. Client-side scan over the existing range stream (no new endpoint) was chosen for v1; a server-side search endpoint is the alternative if the maintainer prefers. Part of warp-tech#2418
The SSH command detector's output is now persisted instead of only logged: a session_commands row per detected command, written once a target session exists (menu interactions stay log-only). A failed insert falls back to log-only for the rest of the session, mirroring how recorder write errors are handled — persistence must never break the session. New admin endpoint GET /commands/search (q/user/target/from/to) joins through the parent target and user sessions, and a Commands page under Status links each hit back to its session. Caveats: SSH-only, heuristic detection (see command_detector docs), no retroactive indexing of sessions recorded before this change; rows are removed with their target session (FK cascade, like recordings). Part of warp-tech#2418
…us loss
- Restructure filter bar into a 3-column grid (protocol, from-date,
to-date) with toggles and a 'Clear filters' button on a separate row
- Move search input outside the {#await} reactive block in ItemList so
it is never destroyed/recreated on data reloads, fixing focus loss on
every keystroke
Closes warp-tech#2418
ozanonurtek
force-pushed
the
feat/session-search
branch
from
August 31, 2026 14:58
26eed43 to
3808ff9
Compare
The compile-time check in copy_database.rs ensures every entity in with_every_entity! is also listed in with_every_table_in_order!. SessionCommand (added with the m00083 migration) was missing, breaking cargo build/test/clippy. Placed after TargetSession, which it references via FK.
The OpenAPI coverage guard requires every operationId in the admin schema to have a permission enforcement test case. search_session_commands (added with the command search API) was missing, failing all 101 parametrized cases.
# Conflicts: # warpgate-web/src/admin/lib/openapi-schema.json
Member
|
Thank you for the PR! For the sake of transparency, I'm currently low on time and it will take me a bit to review & merge this |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements session search and filtering on the sessions page, addressing #2418.
Changes
Filter bar layout (Sessions.svelte)
Search input focus fix (ItemList.svelte)
<Input>outside the{#await $items}reactive block so it is never destroyed/recreated when data reloads — fixes focus loss on every keystrokehasItemsstate variable tracked via the RxJS pipeline to control search input visibility without depending on the async block scopeBackend compatibility
The backend query layer uses SeaORM's abstract query builder with no raw SQL — fully compatible with SQLite (default), PostgreSQL, and MySQL.
AI disclosure
This PR was authored with AI assistance (OpenCode / Claude). The contributor reviewed all changes, verified the build and biome CI, and tested the UX fixes. Architectural decisions (keeping the query layer backend-agnostic, the ItemList reactive structure fix) were guided by the contributor.
AI Usage
Choose the level of AI involvement for this PR.
Closes #2418