feat(mode): enabled conditional transcript compaction logic

- Introduced conditional scrollback clearing during UI renders when transcript compaction is enabled.
- Updated `CommandController` and `EventController` to respect the `display.collapseCompacted` setting.
- Configured `SelectorController` to trigger a chat rebuild and UI reset when the compaction setting changes.
- Updated `InteractiveMode` to dynamically toggle between collapsed and full inline history based on user settings.
This commit is contained in:
can1357
2026-07-13 01:29:53 +02:00
parent d6f8c061b4
commit 5c2bae47ac
5 changed files with 37 additions and 6 deletions
@@ -1200,7 +1200,15 @@ export class CommandController {
this.ctx.rebuildChatFromMessages();
this.ctx.statusLine.invalidate();
this.ctx.ui.requestRender();
// Same as the auto-compaction rebuild: a collapsed transcript is an
// intentional replacement, so drop the stale pre-compaction scrollback
// instead of repainting the shrunken frame below it. With collapse
// disabled the full history stays inline and scrollback is kept.
if (this.ctx.settings.get("display.collapseCompacted")) {
this.ctx.ui.requestRender(true, { clearScrollback: true });
} else {
this.ctx.ui.requestRender();
}
} catch (error) {
if (error instanceof CompactionCancelledError) {
outcome = "cancelled";