feat: expand activeTab options in SharedUIState to include messages, media, and review

This commit is contained in:
MythEclipse
2026-05-16 21:42:28 +07:00
parent 62d131cf14
commit 9ad7d16a17
2 changed files with 13 additions and 5 deletions
+1 -1
View File
@@ -9,7 +9,7 @@ export interface SharedUIState {
selectedVoiceChannel: string;
selectedTextGuild: string;
selectedTextChannel: string;
activeTab: "voice" | "text";
activeTab: "voice" | "messages" | "media" | "review";
isListening: boolean;
isStreaming: boolean;
}
+12 -4
View File
@@ -54,7 +54,7 @@ interface SharedUIState {
selectedVoiceChannel: string;
selectedTextGuild: string;
selectedTextChannel: string;
activeTab: "voice" | "text";
activeTab: "voice" | "messages" | "media" | "review";
isListening: boolean;
isStreaming: boolean;
}
@@ -84,7 +84,11 @@ export function normalizeSharedUIState(
selectedVoiceChannel: value.selectedVoiceChannel ?? "",
selectedTextGuild: value.selectedTextGuild ?? guild,
selectedTextChannel: value.selectedTextChannel ?? "",
activeTab: value.activeTab === "text" ? "text" : "voice",
activeTab: (["voice", "messages", "media", "review"].includes(
value.activeTab ?? "",
)
? value.activeTab
: "voice") as "voice" | "messages" | "media" | "review",
isListening: value.isListening ?? false,
isStreaming: value.isStreaming ?? false,
};
@@ -117,8 +121,12 @@ function patchSharedUIState(patch: SharedUIStatePatch) {
if (typeof patch.selectedTextChannel === "string") {
sharedUIState.selectedTextChannel = patch.selectedTextChannel;
}
if (patch.activeTab === "voice" || patch.activeTab === "text") {
sharedUIState.activeTab = patch.activeTab;
if (["voice", "messages", "media", "review"].includes(patch.activeTab ?? "")) {
sharedUIState.activeTab = patch.activeTab as
| "voice"
| "messages"
| "media"
| "review";
}
if (typeof patch.isListening === "boolean") {
sharedUIState.isListening = patch.isListening;