Skip to content

fix: improve lore import UX — stdout logging, prompt ordering, only-ask-once#278

Merged
BYK merged 1 commit into
mainfrom
fix/import-ux
May 13, 2026
Merged

fix: improve lore import UX — stdout logging, prompt ordering, only-ask-once#278
BYK merged 1 commit into
mainfrom
fix/import-ux

Conversation

@BYK
Copy link
Copy Markdown
Owner

@BYK BYK commented May 13, 2026

Summary

  • Red output fixed: lore import used console.error() for all messages, making everything appear red. Switched informational messages to console.log (stdout). Progress indicators stay on stderr (standard practice for \r-based updates).
  • Prompt ordering fixed: lore run now offers to import existing conversations before asking which agent to launch (moved maybeAutoImport() before resolveLaunchTarget() in run.ts).
  • Only-ask-once: Replaced the wasDeclined()/recordDeclined() sentinel row hack with a last_import_at timestamp on the projects table (V22 migration). Set unconditionally after the prompt fires regardless of the user's answer, so re-running lore never re-prompts — even if the background import hasn't finished or failed silently.

Changes

File What changed
packages/core/src/db.ts V22 migration: ALTER TABLE projects ADD COLUMN last_import_at INTEGER. New helpers: getLastImportAt(), setLastImportAt().
packages/core/src/import/history.ts Removed recordDeclined(), wasDeclined(), DECLINED_SOURCE_ID. listImports() still filters legacy __declined__ rows for backwards compat.
packages/core/src/import/index.ts Updated re-exports (removed recordDeclined/wasDeclined, added listImports).
packages/core/src/index.ts Added getLastImportAt/setLastImportAt to barrel exports.
packages/gateway/src/cli/import.ts console.errorconsole.log for informational messages. Removed unused recordDeclined import.
packages/gateway/src/cli/import-auto.ts console.errorconsole.log. Replaced isFreshProject()+wasDeclined() guards with getLastImportAt() !== null. Calls setLastImportAt() unconditionally after prompt. Removed isFreshProject().
packages/gateway/src/cli/run.ts Moved maybeAutoImport(config) before resolveLaunchTarget(). Renumbered step comments.
packages/core/test/db.test.ts Updated migration count (21→22). Added tests for last_import_at column, getLastImportAt/setLastImportAt round-trip.
packages/core/test/import/history.test.ts Removed declined test block. Updated listImports test.

…sk-once

- Switch informational messages from console.error to console.log in
  import.ts and import-auto.ts so they don't appear red in terminals.
  Keep progress indicators on stderr (standard practice).

- Move maybeAutoImport() before resolveLaunchTarget() in run.ts so the
  import prompt appears before the agent selection picker.

- Replace isFreshProject()/wasDeclined()/recordDeclined() sentinel row
  hack with a last_import_at timestamp on the projects table (V22
  migration). Set unconditionally after the prompt fires, regardless of
  the user's answer, preventing re-prompting on subsequent runs even if
  the background import hasn't finished yet.

- Remove dead code: recordDeclined, wasDeclined, DECLINED_SOURCE_ID,
  isFreshProject. listImports() still filters legacy __declined__ rows
  for backwards compat.
@BYK BYK force-pushed the fix/import-ux branch from ea36a35 to a991498 Compare May 13, 2026 08:20
@BYK BYK merged commit bab5388 into main May 13, 2026
7 checks passed
@BYK BYK deleted the fix/import-ux branch May 13, 2026 08:23
This was referenced May 13, 2026
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