Add account UI and secure session storage

This commit is contained in:
Hamza Ayed
2026-10-03 00:54:16 +03:00
parent b0cd825838
commit f745bed0f7
14 changed files with 456 additions and 13 deletions
@@ -423,6 +423,28 @@ class ChatCubit extends Cubit<ChatState> {
}
}
Future<void> reloadForAccountChange() async {
if (state.isSending) return;
emit(
state.copyWith(
messages: const [],
conversations: const [],
clearActiveConversation: true,
isLoadingHistory: true,
isWorkspaceMode: false,
clearSelectedWorkspacePath: true,
availableWorkspaceFiles: const [],
selectedWorkspaceFiles: const [],
clearSelectedSkill: true,
requestStatus: RequestStatus.idle,
clearAgentProgress: true,
clearPendingFileChangeProposal: true,
clearError: true,
),
);
await Future.wait([_loadHistory(), _loadAgentSkills()]);
}
Future<void> _saveCurrent(List<ChatMessage> messages) async {
if (messages.isEmpty) return;
final firstQuestion = messages.firstWhere(