Skip to content

Commit

Permalink
Pull request #105: Feature/LLM-491 FewerCodeBlockButtons
Browse files Browse the repository at this point in the history
Merge in PAC/chatbook from feature/LLM-491_FewerCodeBlockButtons to main

* commit 'a8ab2c424fb178ae2a5a9849470763281ab827ff':
  Added `GetFocusedNotebook`
  Small fix with icon generality of copy-evaluate button
  Fixed my merge mistake
  Corrections to design elements
  Remove NA insert button, update insert-evaluate tooltip
  Add updated workspace code block icons
  Add string resource template for workspace insert-evaluate tooltip
  • Loading branch information
Kevin Daily authored and rhennigan committed Nov 26, 2024
2 parents 48658b9 + a8ab2c4 commit 46ca461
Show file tree
Hide file tree
Showing 18 changed files with 570 additions and 235 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
(* Created with the Wolfram Language : www.wolfram.com *)
RawBoxes @ ToBoxes @
Graphics[{Thickness[0.125],
Style[{FilledCurve[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}},
{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}}, {{0, 2, 0}, {0, 1, 0},
{0, 1, 0}, {0, 1, 0}}, {{0, 2, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}},
{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}}, {{0, 2, 0}, {1, 3, 3},
{0, 1, 0}, {1, 3, 3}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0},
{0, 1, 0}, {1, 3, 3}, {0, 1, 0}, {1, 3, 3}, {0, 1, 0}, {1, 3, 3},
{0, 1, 0}, {1, 3, 3}, {0, 1, 0}, {1, 3, 3}, {0, 1, 0}, {1, 3, 3}}},
{{{6.822000026702881, 6.291999816894531}, {1.1779999732971191,
6.291999816894531}, {1.1779999732971191, 7.008999824523926},
{6.822000026702881, 7.008999824523926}, {6.822000026702881,
6.291999816894531}}, {{6.822000026702881, 4.8580002784729},
{1.1779999732971191, 4.8580002784729}, {1.1779999732971191,
5.575000286102295}, {6.822000026702881, 5.575000286102295},
{6.822000026702881, 4.8580002784729}},
{{6.822000026702881, 3.4250001907348633}, {1.1779999732971191,
3.4250001907348633}, {1.1779999732971191, 4.142000198364258},
{6.822000026702881, 4.142000198364258}, {6.822000026702881,
3.4250001907348633}}, {{6.822000026702881, 1.9910001754760742},
{1.1779999732971191, 1.9910001754760742}, {1.1779999732971191,
2.7080001831054688}, {6.822000026702881, 2.7080001831054688},
{6.822000026702881, 1.9910001754760742}},
{{2.800999879837036, 9.597000122070312}, {5.199999809265137,
9.597000122070312}, {5.599999904632568, 8.79699993133545},
{2.4010000228881836, 8.79699993133545}, {2.800999879837036,
9.597000122070312}}, {{7.5, 9.}, {6.357000350952148, 9.},
{6.3429999351501465, 9.052000045776367}, {6.340000152587891,
9.105000495910645}, {6.315000534057617, 9.155000686645508},
{5.914000511169434, 9.955999374389648}, {5.779999732971191,
10.22700023651123}, {5.501999855041504, 10.398000717163086},
{5.198999881744385, 10.397000312805176}, {4.801000118255615,
10.397000312805176}, {4.801000118255615, 11.197000503540039},
{3.2009999752044678, 11.197000503540039}, {3.2009999752044678,
10.397000312805176}, {2.800999879837036, 10.397000312805176},
{2.497999906539917, 10.398000717163086}, {2.2209999561309814,
10.22700023651123}, {2.0850000381469727, 9.954999923706055},
{1.6850000619888306, 9.155000686645508}, {1.6610000133514404,
9.105999946594238}, {1.6660000085830688, 9.052000045776367},
{1.6519999504089355, 9.}, {0.5, 9.}, {0.2239999920129776, 9.},
{0., 8.775999069213867}, {0., 8.5}, {0., 0.5},
{0., 0.2239999920129776}, {0.2239999920129776, 0.}, {0.5, 0.},
{7.5, 0.}, {7.776000022888184, 0.}, {8., 0.2239999920129776},
{8., 0.5}, {8., 8.5}, {8., 8.775999069213867},
{7.776000022888184, 9.}, {7.5, 9.}}}]},
FaceForm[RGBColor[0.2901960784313726, 0.5843137254901961, 0.8, 1.]]]},
ImageSize -> {11., 16.}, PlotRange -> {{-0.5, 8.5},
{-0.5, 11.697400093078613}}, AspectRatio -> Automatic,
BaselinePosition -> Center -> Center]
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
(* Created with the Wolfram Language : www.wolfram.com *)
RawBoxes @ ToBoxes @
Graphics[{Thickness[0.07016411257027613],
Style[{JoinedCurve[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0},
{0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0},
{0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0},
{0, 1, 0}, {0, 1, 0}, {0, 1, 0}}},
{{{7.126100063323975, 14.347000122070312}, {5.716100096702576,
11.91700005531311}, {3.158100128173828, 13.049000024795532},
{3.4361002445220947, 10.248000144958496}, {0.7041001319885254,
9.64900016784668}, {2.5631003379821777, 7.548000335693359},
{0.7041001319885254, 5.446000099182129}, {3.4351003170013428,
4.8470001220703125}, {3.156100034713745, 2.045999526977539},
{5.716100096702576, 3.177000045776367}, {7.126100063323975,
0.7469997406005859}, {8.536100029945374, 3.175999641418457},
{11.094099998474121, 2.0450000762939453}, {10.816099882125854,
4.845000267028809}, {13.548099994659424, 5.445000648498535},
{11.689099788665771, 7.546000003814697}, {13.548099994659424,
9.648000240325928}, {10.817099809646606, 10.247000217437744},
{11.096100091934204, 13.04800009727478}, {8.536100029945374,
11.91700005531311}, {7.126100063323975, 14.347000122070312}}},
CurveClosed -> {1}]}, CapForm["Butt"], JoinForm[{"Miter", 1.}],
Thickness[0.05262308442770709], RGBColor[0.2901960784313726,
0.5843137254901961, 0.8, 1.]],
Style[{FilledCurve[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}},
{{{5.526100158691406, 10.766900062561035}, {5.526100158691406,
4.3668999671936035}, {10.32610034942627, 7.582900285720825},
{5.526100158691406, 10.766900062561035}}}]},
FaceForm[RGBColor[0.2901960784313726, 0.5843137254901961, 0.8, 1.]]]},
ImageSize -> {16., 17.}, PlotRange -> {{-0.5, 14.752300262451172},
{-0.5, 15.594200134277344}}, AspectRatio -> Automatic,
BaselinePosition -> Center -> Center]
67 changes: 66 additions & 1 deletion FrontEnd/TextResources/ChatbookResources.tr
Original file line number Diff line number Diff line change
Expand Up @@ -6298,7 +6298,72 @@ TD2Mb3lNEkxzlMqBaSGoOMw9MD7MvTC+5EEUPjx8oOahhB8ACaE9/g==
AspectRatio->Automatic,
BaselinePosition->(Center -> Center),
ImageSize->{8., 7.},
PlotRange->{{-0.5, 7.5}, {-0.5, 6.5}}]
PlotRange->{{-0.5, 7.5}, {-0.5, 6.5}}],

"WorkspaceCodeBlockCopy" -> GraphicsBox[
{Thickness[0.125], FaceForm[{RGBColor[
0.2901960784313726, 0.5843137254901961, 0.8], Opacity[1.]}],
FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}}, {{0, 2, 0}, {
0, 1, 0}, {0, 1, 0}, {0, 1, 0}}, {{0, 2, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1,
0}}, {{0, 2, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}}, {{0, 2, 0}, {0, 1,
0}, {0, 1, 0}, {0, 1, 0}}, {{0, 2, 0}, {1, 3, 3}, {0, 1, 0}, {1, 3, 3}, {
0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {1, 3, 3}, {0, 1,
0}, {1, 3, 3}, {0, 1, 0}, {1, 3, 3}, {0, 1, 0}, {1, 3, 3}, {0, 1, 0}, {1,
3, 3}, {0, 1, 0}, {1, 3, 3}}}, {{{6.822000026702881,
6.291999816894531}, {1.1779999732971191`, 6.291999816894531}, {
1.1779999732971191`, 7.008999824523926}, {6.822000026702881,
7.008999824523926}, {6.822000026702881, 6.291999816894531}}, {{
6.822000026702881, 4.8580002784729}, {1.1779999732971191`,
4.8580002784729}, {1.1779999732971191`, 5.575000286102295}, {
6.822000026702881, 5.575000286102295}, {6.822000026702881,
4.8580002784729}}, {{6.822000026702881, 3.4250001907348633`}, {
1.1779999732971191`, 3.4250001907348633`}, {1.1779999732971191`,
4.142000198364258}, {6.822000026702881, 4.142000198364258}, {
6.822000026702881, 3.4250001907348633`}}, {{6.822000026702881,
1.9910001754760742`}, {1.1779999732971191`, 1.9910001754760742`}, {
1.1779999732971191`, 2.7080001831054688`}, {6.822000026702881,
2.7080001831054688`}, {6.822000026702881, 1.9910001754760742`}}, {{
2.800999879837036, 9.597000122070312}, {5.199999809265137,
9.597000122070312}, {5.599999904632568, 8.79699993133545}, {
2.4010000228881836`, 8.79699993133545}, {2.800999879837036,
9.597000122070312}}, CompressedData["
1:eJxTTMoPSmViYGBQBWIQDQFyDhBaCUQ3TMyVROYnWMeD+QfmS4H5DJoxYP6C
Q6YQ9f1OYL5DjD+Yf+D9cnEwXfFSGSy+Qw7MT7AsUQHzeZjEwPLHToP5C46d
FgHTzhB+gqWJMDa+w90UNRD9YOlsTmx8mPoFRRlsKPqf/2ZGsW/2EUZk9zSI
rGMAy399oQzx19df9sj+KZkM5i9wNQPzF7xfDubDwqNheh6YDwsvkJOQ+Qoc
a86gyYPBAf9eRWQ+EKDzYeaAAcwcJPOwqmNAxCfEnvlS8mjmKqC5SwHN3TA+
zD1gPsy9SObB/INIPwC/b2f2
"]}]},
AspectRatio->Automatic,
BaselinePosition->(Center -> Center),
ImageSize->{11., 16.},
PlotRange->{{-0.5, 8.5}, {-0.5, 11.697400093078613`}}],

"WorkspaceCodeBlockInsertAndEvaluate" -> GraphicsBox[
{Thickness[0.07016411257027613],
{RGBColor[0.2901960784313726, 0.5843137254901961, 0.8], Thickness[
0.05262308442770709], Opacity[1.], CapForm["Butt"],
JoinForm[{"Miter", 1.}],
JoinedCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {
0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1,
0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0, 1, 0}, {0,
1, 0}, {0, 1, 0}}}, CompressedData["
1:eJxTTMoPSmVmYGBgBGJRIGZiAIMEhUYZBxBj1UYdEB3heVcMRHM0XlUHi59y
5gTRHWKSWiBaQamWG0Q/+FmnApb/2/7MHkgd8PRRBvEPWDWygMXVDeWQ5R22
nBAF6xOtButnCEkWBtEJG+3B5jOYxjEg289QnwUWh7sv5/lzkDlbqoUUQfyG
ogyw/ANdAzWwvGYMWP+N6wtVwe5wTwSbP2GBhDaIdlh3HGz/hosJYH8tkNKX
Q5bfcMwb7P4XUYvA+i+UQfzHYWIINr9isgTY/zD7YeGDEn4ArS1I9w==
"],
CurveClosed->{1}]},
{FaceForm[{RGBColor[0.2901960784313726, 0.5843137254901961, 0.8], Opacity[
1.]}], FilledCurveBox[{{{0, 2, 0}, {0, 1, 0}, {0, 1, 0}}}, {{{
5.526100158691406, 10.766900062561035`}, {5.526100158691406,
4.3668999671936035`}, {10.32610034942627, 7.582900285720825}, {
5.526100158691406, 10.766900062561035`}}}]}},
AspectRatio->Automatic,
BaselinePosition->(Center -> Center),
ImageSize->{16., 17.},
PlotRange->{{-0.5, 14.752300262451172`}, {-0.5, 15.594200134277344`}}]
}
@|
@|
Expand Down
2 changes: 2 additions & 0 deletions FrontEnd/TextResources/ChatbookStrings.tr
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
"FormattingCopyToClipboardLabel" -> "Copy",
"FormattingInsertContentLabel" -> "Insert",
"FormattingInsertContentAndEvaluateTooltip" -> "Insert content as new input cell below and evaluate",
"FormattingInsertContentAndEvaluateWorkspaceChatTooltip" -> "Insert this into `1` and evaluate.",
"FormattingInsertContentAndEvaluateWorkspaceChatTooltipNew" -> "Insert this into a new notebook and evaluate.",
"FormattingCopyToClipboardTooltip" -> "Copy to clipboard",
"FormattingInsertContentTooltip" -> "Insert content as new input cell below",
"FormattingToolUsing" -> "Using ",
Expand Down
2 changes: 2 additions & 0 deletions FrontEnd/TextResources/ChineseSimplified/ChatbookStrings.tr
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
"FormattingCopyToClipboardLabel" -> "\:590D\:5236",
"FormattingInsertContentLabel" -> "\:63D2\:5165",
"FormattingInsertContentAndEvaluateTooltip" -> "\:5728\:4E0B\:9762\:63D2\:5165\:5185\:5BB9\:4F5C\:4E3A\:65B0\:7684\:8F93\:5165\:5355\:5143\:5E76\:8BA1\:7B97",
"FormattingInsertContentAndEvaluateWorkspaceChatTooltip" -> "Insert this into `1` and evaluate.",
"FormattingInsertContentAndEvaluateWorkspaceChatTooltipNew" -> "Insert this into a new notebook and evaluate.",
"FormattingCopyToClipboardTooltip" -> "\:590D\:5236\:5230\:526A\:8D34\:677F",
"FormattingInsertContentTooltip" -> "\:5728\:4E0B\:9762\:63D2\:5165\:5185\:5BB9\:4F5C\:4E3A\:65B0\:7684\:8F93\:5165\:5355\:5143",
"FormattingToolUsing" -> "\:4F7F\:7528 ",
Expand Down
2 changes: 2 additions & 0 deletions FrontEnd/TextResources/ChineseTraditional/ChatbookStrings.tr
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
"FormattingCopyToClipboardLabel" -> "\:8907\:88FD",
"FormattingInsertContentLabel" -> "\:63D2\:5165",
"FormattingInsertContentAndEvaluateTooltip" -> "\:63D2\:5165\:5982\:540C\:5728\:4E0B\:65B9\:65B0\:589E\:8F38\:5165\:5132\:5B58\:683C\:7684\:5167\:5BB9\:4E26\:9032\:884C\:8A08\:7B97",
"FormattingInsertContentAndEvaluateWorkspaceChatTooltip" -> "Insert this into `1` and evaluate.",
"FormattingInsertContentAndEvaluateWorkspaceChatTooltipNew" -> "Insert this into a new notebook and evaluate.",
"FormattingCopyToClipboardTooltip" -> "\:8907\:88FD\:81F3\:526A\:8CBC\:7C3F",
"FormattingInsertContentTooltip" -> "\:63D2\:5165\:5982\:540C\:5728\:4E0B\:65B9\:65B0\:589E\:8F38\:5165\:5132\:5B58\:683C\:7684\:5167\:5BB9",
"FormattingToolUsing" -> "\:6B63\:5728\:4F7F\:7528 ",
Expand Down
2 changes: 2 additions & 0 deletions FrontEnd/TextResources/French/ChatbookStrings.tr
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
"FormattingCopyToClipboardLabel" -> "Copier",
"FormattingInsertContentLabel" -> "Ins\[EAcute]rer",
"FormattingInsertContentAndEvaluateTooltip" -> "Ins\[EAcute]rer le contenu en tant que nouvelle cellule d\[CloseCurlyQuote]entr\[EAcute]e ci-dessous et l\[CloseCurlyQuote]\[EAcute]valuer",
"FormattingInsertContentAndEvaluateWorkspaceChatTooltip" -> "Insert this into `1` and evaluate.",
"FormattingInsertContentAndEvaluateWorkspaceChatTooltipNew" -> "Insert this into a new notebook and evaluate.",
"FormattingCopyToClipboardTooltip" -> "Copier dans le presse-papiers",
"FormattingInsertContentTooltip" -> "Ins\[EAcute]rer le contenu en tant que nouvelle cellule d\[CloseCurlyQuote]entr\[EAcute]e ci-dessous",
"FormattingToolUsing" -> "Utilisation de ",
Expand Down
2 changes: 2 additions & 0 deletions FrontEnd/TextResources/Japanese/ChatbookStrings.tr
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
"FormattingCopyToClipboardLabel" -> "\:30b3\:30d4\:30fc",
"FormattingInsertContentLabel" -> "\:633f\:5165",
"FormattingInsertContentAndEvaluateTooltip" -> "\:30b3\:30f3\:30c6\:30f3\:30c4\:3092\:65b0\:898f\:306e\:5165\:529b\:30bb\:30eb\:3068\:3057\:3066\:4e0b\:306b\:633f\:5165\:3057\:8a55\:4fa1\:3059\:308b",
"FormattingInsertContentAndEvaluateWorkspaceChatTooltip" -> "Insert this into `1` and evaluate.",
"FormattingInsertContentAndEvaluateWorkspaceChatTooltipNew" -> "Insert this into a new notebook and evaluate.",
"FormattingCopyToClipboardTooltip" -> "\:30af\:30ea\:30c3\:30d7\:30dc\:30fc\:30c9\:306b\:30b3\:30d4\:30fc",
"FormattingInsertContentTooltip" -> "\:30b3\:30f3\:30c6\:30f3\:30c4\:3092\:65b0\:898f\:306e\:5165\:529b\:30bb\:30eb\:3068\:3057\:3066\:4e0b\:306b\:633f\:5165\:3059\:308b",
"FormattingToolUsing" -> "\:4f7f\:7528\:4e2d\:ff1a",
Expand Down
2 changes: 2 additions & 0 deletions FrontEnd/TextResources/Korean/ChatbookStrings.tr
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
"FormattingInsertContentLabel" -> "\:633F\:5165",
"FormattingInsertContentAndEvaluateTooltip" -> "\:C544\:B798\:C5D0 \:CF58\:D150\:CE20\:B97C \:C0C8 \:C785\:B825 \
\:C140\:B85C \:C0BD\:C785\:D558\:ACE0 \:D3C9\:AC00",
"FormattingInsertContentAndEvaluateWorkspaceChatTooltip" -> "Insert this into `1` and evaluate.",
"FormattingInsertContentAndEvaluateWorkspaceChatTooltipNew" -> "Insert this into a new notebook and evaluate.",
"FormattingCopyToClipboardTooltip" -> "\:D074\:B9BD\:BCF4\:B4DC\:C5D0 \:BCF5\:C0AC",
"FormattingInsertContentTooltip" -> "\:CF58\:D150\:CE20\:B97C \:C0C8 \:C785\:B825 \:C140\:B85C \:C544\:B798\:C5D0 \:C0BD\:C785",
"FormattingToolUsing" -> "\:C0AC\:C6A9\:C911 ",
Expand Down
2 changes: 2 additions & 0 deletions FrontEnd/TextResources/Spanish/ChatbookStrings.tr
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@
"FormattingCopyToClipboardLabel" -> "Copiar",
"FormattingInsertContentLabel" -> "Insertar",
"FormattingInsertContentAndEvaluateTooltip" -> "Insertar contenido como una nueva celda de entrada debajo y evaluar",
"FormattingInsertContentAndEvaluateWorkspaceChatTooltip" -> "Insert this into `1` and evaluate.",
"FormattingInsertContentAndEvaluateWorkspaceChatTooltipNew" -> "Insert this into a new notebook and evaluate.",
"FormattingCopyToClipboardTooltip" -> "Copiar al portapapeles",
"FormattingInsertContentTooltip" -> "Insertar contenido como una nueva celda de entrada debajo",
"FormattingToolUsing" -> "Utilizando ",
Expand Down
1 change: 1 addition & 0 deletions Source/Chatbook/ChatModes/ChatModes.wl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ $subcontexts = {
"Wolfram`Chatbook`ChatModes`Context`",
"Wolfram`Chatbook`ChatModes`Evaluate`",
"Wolfram`Chatbook`ChatModes`NotebookAssistanceInstructions`",
"Wolfram`Chatbook`ChatModes`NotebookFocus`",
"Wolfram`Chatbook`ChatModes`ShowNotebookAssistance`",
"Wolfram`Chatbook`ChatModes`UI`"
};
Expand Down
1 change: 1 addition & 0 deletions Source/Chatbook/ChatModes/Common.wl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ HoldComplete[
`createWorkspaceChat,
`evaluateAttachedInlineChat,
`findCurrentWorkspaceChat,
`focusedNotebookDisplay,
`getContextFromSelection,
`getNotebookAssistanceInput,
`getSelectionInfo,
Expand Down
Loading

0 comments on commit 46ca461

Please sign in to comment.