Skip to content

Promote memory_dirs management to Sources tab (follow-up to #295) #297

@memtomem

Description

@memtomem

Summary

Promote memory_dirs management from inside the Config tab (Indexing card) to its own section of the existing Sources tab. The current location works but the widget fights for vertical space inside a config card, truncates long paths, and conceptually mixes "action-based immediate persist" semantics with the rest of the "batched Save" config fields.

Context

Shipped in #295: a categorized + editable memory_dirs widget with per-item remove/reindex, per-group reindex, top-level reindex-all, inline add input, and per-dir "(N chunks) / (not indexed) / missing" status badges fed by GET /api/memory-dirs/status.

Observed during smoke on a real post-v0.1.12 config (29 dirs, 4 categories):

  • Paths truncate (/Users/pdstudio/memo…) because the widget sits in a 2-column config-table cell.
  • The widget is an "immediate persist" island inside a Save/dirty section — users see a (disabled, since _NO_RESET_FIELDS) reset button column and no Save button for it, which is inconsistent with the rest of the card.
  • Sources tab already has per-file stats UI, so memory_dirs fits there conceptually: Sources = where memory comes from; memory_dirs = the roots of those sources.

Proposed design

Layout

  • Move memory_dirs widget out of Config tab → Sources tab, as a top panel above the existing per-file stats list.
  • Full-width layout (no 2-column grid): each dir row gets enough space for the absolute path + badges + actions without truncation.
  • Keep the 4-category collapsible grouping (User / Claude projects / Claude plans / Codex) that shipped in fix: memory_dirs editable widget with per-dir index status #295.
  • Existing Sources tab content (per-file stats, source list) stays below; filter it by the currently-expanded dir group, or leave cross-dir for now.

Config tab

  • Leave a breadcrumb in the Indexing card ("Memory Dirs are managed in Sources tab") so users who look for it in the old location get redirected.
  • Keep env var hint + chunk settings where they are.

Per-dir stats enrichment (optional, follow-on within same issue)

Sources tab's additional real estate lets us surface richer state per dir beyond the minimal badges shipped in #295:

  • Last indexed timestamp (already in DB via MAX(updated_at))
  • File count + chunk count + avg chunks/file
  • Click → drill into the existing per-file stats filtered to that dir
  • Maybe a sparkline or badge for "stale files" (mtime > last_indexed) if we want to nudge reindex

Scope boundaries

  • Keep the same set of API endpoints (GET /api/memory-dirs/status, POST /api/memory-dirs/{add,remove}, POST /api/{index,reindex}). No backend changes expected beyond maybe extending memory_dir_stats with last_updated.
  • Don't touch the categorization logic (_detect_provider_dirs in config.py) — it's the server-side source of truth for client-side bucketing.
  • i18n: keys migrate from settings.memory_dirs.* to sources.memory_dirs.* (or keep as-is with cross-refs). Preserve en/ko parity (existing test_i18n.py guards).

Why not in #295

#295 was already bundling two concerns (UI readability + missing-index bug). Adding a tab-level reshuffle would have doubled the review surface and risked drift from the core "make memory_dirs editable + status-visible" goal. Shipping the widget first in its current location let us validate the primitives (badge + action-based persist) before redesigning the container.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions