From 637e5de5b708a967b226954197acd9c24b57ef70 Mon Sep 17 00:00:00 2001 From: Rick Hennigan Date: Thu, 15 Feb 2024 17:51:37 -0500 Subject: [PATCH] Bugfix: Use correct settings for "VisiblePersonas" and "PersonaFavorites" --- Source/Chatbook/UI.wl | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/Source/Chatbook/UI.wl b/Source/Chatbook/UI.wl index f91fc248..60877bfb 100644 --- a/Source/Chatbook/UI.wl +++ b/Source/Chatbook/UI.wl @@ -598,29 +598,23 @@ makeChatActionMenu[ RaiseConfirmMatch[personas, <| (_String -> _Association)... |>]; (* initialize PrivateFrontEndOptions if they aren't already present or somehow broke *) - If[!MatchQ[CurrentValue[$FrontEnd, {PrivateFrontEndOptions, "InterfaceSettings", "Chatbook", "VisiblePersonas"}], {___String}], - CurrentValue[ - $FrontEnd, - {PrivateFrontEndOptions, "InterfaceSettings", "Chatbook", "VisiblePersonas"} - ] = DeleteCases[Keys[personas], Alternatives["Birdnardo", "RawModel", "Wolfie"]] + If[!MatchQ[CurrentChatSettings[$FrontEnd, "VisiblePersonas"], {___String}], + CurrentChatSettings[$FrontEnd, "VisiblePersonas"] = DeleteCases[ + Keys[personas], + Alternatives["Birdnardo", "RawModel", "Wolfie"] + ] ]; - If[!MatchQ[CurrentValue[$FrontEnd, {PrivateFrontEndOptions, "InterfaceSettings", "Chatbook", "PersonaFavorites"}], {___String}], - CurrentValue[ - $FrontEnd, - {PrivateFrontEndOptions, "InterfaceSettings", "Chatbook", "PersonaFavorites"} - ] = {"CodeAssistant", "CodeWriter", "PlainChat"} + If[!MatchQ[CurrentChatSettings[$FrontEnd, "PersonaFavorites"], {___String}], + CurrentChatSettings[$FrontEnd, "PersonaFavorites"] = {"CodeAssistant", "CodeWriter", "PlainChat"} ]; (* only show visible personas and sort visible personas based on favorites setting *) personas = KeyTake[ personas, - CurrentValue[$FrontEnd, {PrivateFrontEndOptions, "InterfaceSettings", "Chatbook", "VisiblePersonas"}] + CurrentChatSettings[$FrontEnd, "VisiblePersonas"] ]; personas = With[{ - favorites = CurrentValue[ - $FrontEnd, - {PrivateFrontEndOptions, "InterfaceSettings", "Chatbook", "PersonaFavorites"} - ] + favorites = CurrentChatSettings[$FrontEnd, "PersonaFavorites"] }, Association[ (* favorites appear in the exact order provided in the CurrentValue *)