Fix branch selector for single message and --no-session mode
- Allow branch selector to open with single user message (changed <= 1 to === 0 check) - Support in-memory branching for --no-session mode (no files created) - Add isEnabled() getter to SessionManager - Update sessionFile getter to return null when sessions disabled - Update SessionSwitchEvent types to allow null session files - Add branching tests for single message and --no-session scenarios fixes #163
This commit is contained in:
@@ -136,8 +136,8 @@ export class UserMessageSelectorComponent extends Container {
|
||||
this.addChild(new Spacer(1));
|
||||
this.addChild(new DynamicBorder());
|
||||
|
||||
// Auto-cancel if no messages or only one message
|
||||
if (messages.length <= 1) {
|
||||
// Auto-cancel if no messages
|
||||
if (messages.length === 0) {
|
||||
setTimeout(() => onCancel(), 100);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1214,7 +1214,7 @@ export class InteractiveMode {
|
||||
private showUserMessageSelector(): void {
|
||||
const userMessages = this.session.getUserMessagesForBranching();
|
||||
|
||||
if (userMessages.length <= 1) {
|
||||
if (userMessages.length === 0) {
|
||||
this.showStatus("No messages to branch from");
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user