Skip to content

Config page: 'Ingest file' button + project picker modal #82

@VarunGitGood

Description

@VarunGitGood

Why

Today the only way to ingest a log file is curl -F service=... -F file=@... /ingest or the worker watching a registered path. New users land on the Config page, have an API key set up, and have no obvious next step to actually push data in. The web UI should support drag-and-drop ingest from inside the app.

Scope (in)

  • Add an "Ingest file" button on /config, placed next to the existing Workers section so the two ingestion paths (one-shot upload vs. continuous watcher) sit together.
  • Clicking opens a shadcn Dialog (modal) with two steps:
    1. Project picker — choose an existing project from a dropdown, or pick "New project…" which reveals a name input.
    2. File dropper — drag-and-drop zone (or click-to-browse) consistent with the rest of the UI: same border, same hover/active states as any other drop zone we add later.
  • After drop: prompt for the service name (required by POST /ingest); allow the filename stem as a default suggestion.
  • Submit → POST /ingest with service, file, and project (name or id). Show the returned ingest stats (chunk_count, lines_total, lines_with_timestamp, level_counts) inline before the dialog closes.
  • Toast on success / error; refresh the project list and (if relevant) the /services cache.

Scope (out)

  • Multi-file batch upload — single file per submission is fine for v1; revisit if asked.
  • Service auto-detection from filename — show as a default value only; user can override.
  • Dropping files outside this modal (e.g. on the chat landing) — out of scope here.

Acceptance

  • Button is visible on the Config page next to Workers.
  • Clicking opens a modal with the project step → file step flow described above.
  • Choosing an existing project and dropping a .log file calls POST /ingest with the right form fields and shows the success stats.
  • Choosing "New project…", naming it, and dropping a file creates the project and ingests the file in one round-trip (the project form field on /ingest is get-or-create).
  • The drop zone styling matches the rest of the app's shadcn components and will be reusable for future drop zones.

Files

  • web/app/config/page.tsx — add the button + dialog trigger.
  • web/components/config/IngestFileDialog.tsx (new) — the modal flow.
  • web/components/config/FileDropZone.tsx (new) — extracted dropper so it can be reused elsewhere later.
  • web/lib/api.tsingest(file, service, project?) helper if not already there.
  • repi/api/ingest.py — no change (already accepts project).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions