feat: /clear コマンドで終了済みセッションを一覧から消去 - #47
Merged
Merged
Conversation
一覧のコンポーザで `/clear` を実行すると、終了済み(completed / interrupted / rate_limited / failed / conflict / archived)のセッションを 一覧から消去する。実行中(creating / running / awaiting_*)のセッションは ライブ SDK 会話を切らないため残す。 消去したセッションは store と永続スナップショット(state.json)の両方から 外れるため、codiva を再起動しても一覧に戻らない。worktree・ブランチは ディスク上に残す(作業履歴は保持)ので失われるのは codiva の一覧エントリだけ。 - core/commands: CommandAction に 'clear' と COMMANDS エントリを追加 - core/i18n: command.clear を ja/en 両カタログへ - core/session-store: 順序+状態から 1 件外す remove() を追加 - core/session-manager: 終端セッションのみ stop→forget する clear() を追加 - ui/session-list: /clear ハンドラを useCommandRunner に配線(確認なしで即実行)
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.
概要
一覧画面のコンポーザで
/clearを実行すると、これまでのセッション一覧を消去するコマンドを追加しました。completed/interrupted/rate_limited/failed/conflict/archived)を一覧から消去します。creating/running/awaiting_permission/awaiting_input)は残します。ライブの SDK 会話を切ってしまわないためです。.codiva/state.json)の両方から外れるため、codiva を再起動しても一覧に戻りません。変更点
core/commandsCommandActionに'clear'、COMMANDSに/clearエントリを追加core/i18ncommand.clearを ja/en 両カタログに追加core/session-storeremove()を追加core/session-managerstop()→ 破棄するclear()を追加(isTerminalStatusで判定)。永続対象は store 由来なので、消去分はstate.jsonに書かれず復元もされないui/session-list/clearハンドラをuseCommandRunnerに配線README/clearの説明を追記設計判断
persistableState()は store の id を走査するため、store から外すだけで自動的に永続対象から外れる。専用の「消去済みフラグ」を持たずに「再起動しても戻らない」を満たせる。テスト
core/commands.spec:/clearの解決・前方一致・カタログcore/session-store.spec:remove()(該当・不明 id の no-op)core/session-manager.spec: 終端のみ消去・実行中は残す / 永続スナップショットから除外 / onPersist・購読通知 / 対象なし時 no-optests/commands.test.tsx: パレット表示と App 経由の/clear配線npm test(739 passed, core/utils カバレッジ 80% 以上)npm run typecheck/npm run lint/npm run build手動確認 TODO
/clear→ 一覧が消えることを確認/clear→ 実行中のみ残ることを確認