Skip to content

Commit

Permalink
Merge remote-tracking branch 'stash/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
rhennigan committed Nov 19, 2024
2 parents 0d26055 + 02265d3 commit f2e5b06
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 39 deletions.
1 change: 1 addition & 0 deletions Developer/Resources/WorkspaceStyles.wl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Cell[
"ClosingSaveDialog" -> False,
DefaultNewCellStyle -> "AutoMoveToChatInputField",
DockedCells -> $workspaceChatDockedCells,
PrivateCellOptions -> {"ContentsOpacity" -> Dynamic[If[CurrentValue["NotebookSelected"], 1, 0.5]]},
Magnification -> 0.85,
Saveable -> False,
Selectable -> False,
Expand Down
1 change: 1 addition & 0 deletions Developer/StylesheetBuilder.wl
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ $workspaceChatDockedCells = {
],
TrackedSymbols :> { }
],
PrivateCellOptions -> {"ContentsOpacity" -> Dynamic[If[CurrentValue["NotebookSelected"], 1, 0.5]]},
CellFrame -> 0,
CellFrameMargins -> 0,
CellMargins -> { { -1, -5 }, { -1, -1 } },
Expand Down
10 changes: 9 additions & 1 deletion FrontEnd/StyleSheets/Wolfram/WorkspaceChat.nb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ Notebook[
TrackedSymbols :> { }
]
],
PrivateCellOptions -> {
"ContentsOpacity" ->
Dynamic[If[CurrentValue["NotebookSelected"], 1, 0.5]]
},
CellFrame -> 0,
CellFrameMargins -> 0,
CellMargins -> {{-1, -5}, {-1, -1}},
Expand All @@ -61,6 +65,10 @@ Notebook[
]
},
ShowCellBracket -> False,
PrivateCellOptions -> {
"ContentsOpacity" ->
Dynamic[If[CurrentValue["NotebookSelected"], 1, 0.5]]
},
TaggingRules -> <|
"ChatNotebookSettings" -> <|
"SetCellDingbat" -> False,
Expand All @@ -75,7 +83,7 @@ Notebook[
Cell[StyleData["CellExpression"], Selectable -> True],
Cell[
StyleData["WorkspaceChatStyleSheetInformation"],
TaggingRules -> <|"WorkspaceChatStyleSheetVersion" -> "1.5.2.3940599860"|>
TaggingRules -> <|"WorkspaceChatStyleSheetVersion" -> "1.5.2.3940930109"|>
],
Cell[
StyleData[
Expand Down
2 changes: 1 addition & 1 deletion FrontEnd/TextResources/ChatbookStrings.tr
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
"WorkspaceToolbarButtonLabelSources" -> "Sources",
"WorkspaceToolbarButtonLabelNew" -> "New",
"WorkspaceToolbarButtonTooltipHistory" -> "Manage conversations",
"WorkspaceToolbarButtonTooltipSources" -> "Add additional source material to the chat context",
"WorkspaceToolbarButtonTooltipSources" -> "Sources for additional material to add to the chat context",
"WorkspaceToolbarButtonTooltipNew" -> "Start a new conversation",
"WorkspaceSourcesOpenNotebooks" -> "Open Notebooks",

Expand Down
71 changes: 34 additions & 37 deletions Source/Chatbook/PreferencesContent.wl
Original file line number Diff line number Diff line change
Expand Up @@ -1161,31 +1161,26 @@ servicesSettingsPanel0[ ] := Enclose[

llmIcon = chatbookIcon[ "llmkit-dialog-sm", False ];
llmHelp = (* If this tooltip isn't meant to be a button, then use infoTooltip[llmLabel, text] *)
PaneSelector[
{
True ->
Button[
Tooltip[
NotebookTools`Mousedown[
Dynamic[ RawBoxes[ FEPrivate`FrontEndResource[ "FEBitmaps", "ProductSelectorInfo" ][ GrayLevel[ 0.537 ], 14 ] ] ],
Dynamic[ RawBoxes[ FEPrivate`FrontEndResource[ "FEBitmaps", "ProductSelectorInfo" ][ GrayLevel[ 0.692 ], 14 ] ] ],
Dynamic[ RawBoxes[ FEPrivate`FrontEndResource[ "FEBitmaps", "ProductSelectorInfo" ][ GrayLevel[ 0.358 ], 14 ] ] ] ],
Pane[ tr[ "PreferencesContentLLMKitLearnMoreTooltip" ], ImageSize -> UpTo[ 274 ] ],
TooltipStyle -> {
Background -> RGBColor[ "#EDEDED" ],
CellFrameColor -> RGBColor[ "#D1D1D1" ],
CellFrameMargins -> 5,
FontColor -> RGBColor[ "#333333" ],
FontFamily -> "Roboto",
FontSize -> 11 } ],
openLLMKitURL[ "learnMoreUrl" ],
Appearance -> "Suppressed",
BaselinePosition -> Baseline,
ImageSize -> Automatic,
Method -> "Queued" ],
False -> ProgressIndicator[ Appearance -> "Percolate" ] },
Dynamic[ Wolfram`LLMFunctions`Common`$LLMKitInfo =!= None ],
ImageSize -> Automatic];
Button[
Tooltip[
NotebookTools`Mousedown[
Dynamic[ RawBoxes[ FEPrivate`FrontEndResource[ "FEBitmaps", "ProductSelectorInfo" ][ GrayLevel[ 0.537 ], 14 ] ] ],
Dynamic[ RawBoxes[ FEPrivate`FrontEndResource[ "FEBitmaps", "ProductSelectorInfo" ][ GrayLevel[ 0.692 ], 14 ] ] ],
Dynamic[ RawBoxes[ FEPrivate`FrontEndResource[ "FEBitmaps", "ProductSelectorInfo" ][ GrayLevel[ 0.358 ], 14 ] ] ] ],
Pane[ tr[ "PreferencesContentLLMKitLearnMoreTooltip" ], ImageSize -> UpTo[ 274 ] ],
TooltipStyle -> {
Background -> RGBColor[ "#EDEDED" ],
CellFrameColor -> RGBColor[ "#D1D1D1" ],
CellFrameMargins -> 5,
FontColor -> RGBColor[ "#333333" ],
FontFamily -> "Roboto",
FontSize -> 11 } ],
If[ !AssociationQ[ Wolfram`LLMFunctions`Common`$LLMKitInfo ], Wolfram`LLMFunctions`Common`UpdateLLMKitInfo[ ] ];
openLLMKitURL[ "learnMoreUrl" ],
Appearance -> "Suppressed",
BaselinePosition -> Baseline,
Method -> "Queued",
ImageSize -> Automatic ];

Pane[
Grid[
Expand Down Expand Up @@ -1221,10 +1216,12 @@ makeLLMPanel[ ] :=
Framed[ tr[ "PreferencesContentLLMKitSubscribeButton" ], BaseStyle -> "ButtonRed1Normal", FrameMargins -> { { 17, 17 }, { 7, 7 } } ],
Framed[ tr[ "PreferencesContentLLMKitSubscribeButton" ], BaseStyle -> "ButtonRed1Hover", FrameMargins -> { { 17, 17 }, { 7, 7 } } ],
Framed[ tr[ "PreferencesContentLLMKitSubscribeButton" ], BaseStyle -> "ButtonRed1Pressed", FrameMargins -> { { 17, 17 }, { 7, 7 } } ] ],
If[ !AssociationQ[ Wolfram`LLMFunctions`Common`$LLMKitInfo ], Wolfram`LLMFunctions`Common`UpdateLLMKitInfo[ ] ];
openLLMKitURL[ "buyNowUrl" ],
Appearance -> "Suppressed",
BaseStyle -> "DialogTextCommon",
BaselinePosition -> Baseline,
Method -> "Queued",
ImageSize -> Automatic ];

username =
Expand Down Expand Up @@ -1264,28 +1261,28 @@ makeLLMPanel[ ] :=
Style[
tr[ "PreferencesContentLLMKitEnabledManage" ],
FontColor -> Dynamic[ If[ CurrentValue[ "MouseOver" ], GrayLevel[ 0.2 ], GrayLevel[ 0.537254 ] ] ] ],
If[ !AssociationQ[ Wolfram`LLMFunctions`Common`$LLMKitInfo ], Wolfram`LLMFunctions`Common`UpdateLLMKitInfo[ ] ];
openLLMKitURL[ "manageSubscriptionUrl" ],
Appearance -> "Suppressed",
BaseStyle -> "DialogTextCommon",
Method -> "Queued",
ImageSize -> Automatic ];


Framed[
Grid[
{
{
PaneSelector[
{
(* We need to quickly check whether we have a subscription without the need for setting up a channel listener. *)
"Loading" ->
DynamicModule[
DynamicModule[ { },
(* Display a progress indicator until $LLMKitInfo is set via initialization *)
{ llmSessionInfo (* really a dummy variable that will hold the same Association as $LLMKitInfo *) },
ProgressIndicator[ Appearance -> "Percolate" ],
Initialization :> ( SessionSubmit[ Wolfram`LLMFunctions`Common`Private`setupRequestLLMKitStatus[ Dynamic[ llmSessionInfo ] ] ] ),
Deinitialization :> ( SessionSubmit[ Wolfram`LLMFunctions`Common`Private`teardownRequestLLMKitStatus[ Dynamic[ llmSessionInfo ] ] ] ),
Initialization :> ( Wolfram`LLMFunctions`Common`UpdateLLMKitInfo[ ] )
SynchronousInitialization -> False
],
"A" ->
"NotCloudConnected" ->
Grid[
{
{ tr[ "PreferencesContentLLMKitSubscriptionRequired" ], SpanFromLeft, SpanFromLeft },
Expand All @@ -1295,7 +1292,7 @@ makeLLMPanel[ ] :=
BaseStyle -> { "DialogText", FontColor -> GrayLevel[ 0.537254 ] },
BaselinePosition -> { 1, 1 }
],
"B" ->
"CloudConnectedButNotSubscribed" ->
Grid[
{
{ tr[ "PreferencesContentLLMKitNoSubscription" ] },
Expand All @@ -1305,7 +1302,7 @@ makeLLMPanel[ ] :=
BaseStyle -> { "DialogText", FontColor -> GrayLevel[ 0.537254 ] },
BaselinePosition -> { 1, 1 }
],
"C" ->
"CloudConnectedAndSubscribed" ->
Grid[
{
{ chatbookIcon[ "CheckmarkGreen", False ], Style[ tr[ "PreferencesContentLLMKitEnabledTitle" ], FontColor -> GrayLevel[ 0.2 ] ] },
Expand All @@ -1319,10 +1316,10 @@ makeLLMPanel[ ] :=
},
Dynamic[
Which[
Wolfram`LLMFunctions`Common`$LLMKitInfo === None, "Loading",
!TrueQ[ CurrentValue[ "WolframCloudConnected" ] ], "A",
!TrueQ[ Wolfram`LLMFunctions`Common`$LLMKitSubscribed ], "B",
True, "C" ] ],
!TrueQ[ CurrentValue[ "WolframCloudConnected" ] ], "NotCloudConnected",
TrueQ[ Wolfram`LLMFunctions`Common`$LLMKitInfo[ "userHasSubscription" ] ], "CloudConnectedAndSubscribed",
!AssociationQ[ Wolfram`LLMFunctions`Common`$LLMKitInfo ], "Loading",
True, "CloudConnectedButNotSubscribed" ] ],
BaselinePosition -> Baseline,
ImageSize -> Automatic ],
"",
Expand Down

0 comments on commit f2e5b06

Please sign in to comment.