Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assistant output cells do not run the correct cell initialization the first time they appear #299

Closed
rhennigan opened this issue Jul 28, 2023 · 0 comments · Fixed by #503
Assignees
Labels
auto assistant Issues related to automatic AI assistance bug Something isn't working desktop Issues affecting chat notebooks in the desktop front end

Comments

@rhennigan
Copy link
Member

Assistant output cells appear to be using the Initialization setting inherited from the ChatOutput style, which only adds the three-dot menu:

AssistantCellInitialization

This is the menu that appears to get attached:

AttachCell[
cell$,
Cell[
BoxData[
TemplateBox[
{"ChatOutput", RGBColor[0.92549, 0.941176, 0.960784]},
"ChatMenuButton"
]
],
"ChatMenu"
],
{Right, Top},
Offset[{-7, -7}, {Right, Top}],
{Right, Top}
]

It should be using the menu defined in the Initialization here, which also adds a button to disable assistance:

AttachCell[
cell$,
Cell[
BoxData[
TagBox[
GridBox[
{
{
TagBox[
TooltipBox[
ButtonBox[
TemplateBox[{}, "CloseAssistant"],
ButtonFunction :>
With[ { cell = EvaluationCell[] },
Quiet[Needs["Wolfram`Chatbook`" -> None]];
Catch[
Symbol["Wolfram`Chatbook`ChatbookAction"][
"DisableAssistance",
cell
],
Blank[]
]
],
Appearance ->
Dynamic[
FEPrivate`FrontEndResource[
"FEExpressions",
"SuppressMouseDownNinePatchAppearance"
]
],
Evaluator -> Automatic,
Method -> "Preemptive"
],
"\"Disable automatic assistance\"",
TooltipStyle -> "TextStyling"
],
Annotation[#1, "Disable automatic assistance", "Tooltip"] &
]
},
{
TemplateBox[
{"AssistantOutput", RGBColor[0.815686, 0.870588, 0.92549]},
"ChatMenuButton"
]
}
},
GridBoxAlignment -> {"Columns" -> {{Left}}},
DefaultBaseStyle -> "Column",
GridBoxItemSize -> {"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}},
GridBoxSpacings -> {"Columns" -> {{Automatic}}, "Rows" -> {{0}}}
],
"Column"
]
],
"ChatMenu"
],
{Right, Top},
Offset[{-7, -7}, {Right, Top}],
{Right, Top}
]

The correct initialization is used when cutting and pasting the cell, so there appears to be stylesheet bug somewhere.

@rhennigan rhennigan added bug Something isn't working desktop Issues affecting chat notebooks in the desktop front end auto assistant Issues related to automatic AI assistance labels Jul 28, 2023
@rhennigan rhennigan self-assigned this Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto assistant Issues related to automatic AI assistance bug Something isn't working desktop Issues affecting chat notebooks in the desktop front end
Projects
None yet
1 participant