mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-03 14:09:42 +02:00
refactor: drop the two store members nothing consults
`TuiModelStore.confirmSatisfied()` and `approvalFor()` had no caller outside their own tests. The first one mattered: it answered "does the typed text authorize this kill?" with an exact name match, while the rule actually consulted (`confirmAccepts()` in tui-app) also accepts the 8-character id prefix a mux name carries. Two divergent answers to one question, the stricter one unreachable and waiting to be picked up by mistake. knip cannot see class members, so the dead-code sweep never flagged either. The tests they existed for now assert observable state instead, and the approvals one got stronger on the way: it checks that a session id coming back does not inherit the dead session's dialog, which is the invariant `removeSession()` is actually keeping. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+6
-10
@@ -349,10 +349,6 @@ export class TuiModelStore implements TuiRenderModel {
|
||||
});
|
||||
}
|
||||
|
||||
approvalFor(sessionId: string): ApprovalItem | undefined {
|
||||
return this.approvalsBySession.get(sessionId);
|
||||
}
|
||||
|
||||
sessions(): TuiSessionRow[] {
|
||||
return [...this.sessionsById.values()];
|
||||
}
|
||||
@@ -440,7 +436,12 @@ export class TuiModelStore implements TuiRenderModel {
|
||||
this.touch();
|
||||
}
|
||||
|
||||
/** Arm the typed-name confirmation for `x` (kill). */
|
||||
/**
|
||||
* Arm the typed-name confirmation for `x` (kill). Whether what the user typed
|
||||
* AUTHORIZES the kill is `confirmAccepts()` in tui-app, which owns that rule
|
||||
* for every caller: a second copy here answered the same question differently
|
||||
* (it refused the id prefix a mux name carries) and nothing consulted it.
|
||||
*/
|
||||
beginConfirmKill(row: TuiRow): void {
|
||||
this.confirm = {
|
||||
sessionId: row.session.sessionId,
|
||||
@@ -457,11 +458,6 @@ export class TuiModelStore implements TuiRenderModel {
|
||||
this.touch();
|
||||
}
|
||||
|
||||
/** Does the typed text authorize the kill? Exact match on the name shown. */
|
||||
confirmSatisfied(): boolean {
|
||||
return this.confirm !== null && this.confirm.typed.trim() === this.confirm.name;
|
||||
}
|
||||
|
||||
/** Drop whatever overlay owns the keyboard and go back to the list. */
|
||||
closeOverlay(): void {
|
||||
this.confirm = null;
|
||||
|
||||
Reference in New Issue
Block a user