fix(ui): finish-audit fixes — blank search glyph, quadratic truncation, scope-rail refusal leak
CI / ci (push) Canceled after 0s
CI / ci (pull_request) Canceled after 0s

Three-reviewer audit of the polish overhaul:
- magnifyinglass -> magnifyingglass (blank SF Symbol, all 3 seats)
- WordBoundaryTruncation.fit measures each word once (O(n^2) -> O(n)
  on pathological imported titles; live-title pins unchanged)
- scopeHostedSession defers behind an in-flight replay instead of
  refusing (automatic actions never leak a 'Resume refused' row);
  replay completion re-fires the pending scope — pinned over the real
  client path with loadReplayHold, flip-verified
- transcript ForEach on stable row ids, not indices
- delete dead softBorder param; fold caretPastLeadingBlanks onto
  firstContentLocation; native TextField prompt for the search field
- ElidedPathText.candidates/elide nonisolated (off-actor first(where:)
  trapped the host); new pins: degenerate truncation shapes,
  firstContentLocation, elide ladder
This commit is contained in:
AlexKucera committed 2026-11-07 21:13:31 +01:00
1 parent 3a7d495b4b
commit efad422e03
13 files changed
+163 -65

No files matched your search

+12
View File
@@ -551,6 +551,9 @@ final class MentorSessionModel {
timeout: Self.promptTimeout,
)
replayingSessionId = nil
// Finish-audit: the replay slot is free — a scope switch that
// deferred BEHIND this replay applies now.
firePendingScopeIfRequested()
// The real adapter (0.21.5, live-verified #30 dogfood) answers
// session/load WITHOUT a top-level sessionId — the id rides
// `_meta.hermes.sessionProvenance.acpSessionId`. The fake's
@@ -585,6 +588,7 @@ final class MentorSessionModel {
return true
} catch {
replayingSessionId = nil
firePendingScopeIfRequested()
// Partial replay rows (if any) + the failure row stay in the
// ENTRY's store — attributed, visible on its next row click.
appendRow(.text("Resume failed — \(error.localizedDescription)"), to: entry.sessionId)
@@ -609,6 +613,14 @@ final class MentorSessionModel {
pendingScopePieceTitle = pieceTitle
return
}
// Finish-audit: a replay in flight defers the switch too — the
// scope rail is an AUTOMATIC action and must never leak a
// "Resume refused" row into the transcript (the replay's
// completion re-fires the pending scope).
guard replayingSessionId == nil else {
pendingScopePieceTitle = pieceTitle
return
}
pendingScopePieceTitle = nil
let target = SessionRoster.hostedSessionId(forOpenPieceTitle: pieceTitle, in: roster)
guard activeEntry?.sessionId != target else { return }