enable right sidebar (#663)

This commit is contained in:
Mike Sawka 2024-05-28 22:44:57 -07:00 committed by GitHub
parent 652250ac3c
commit 1234919229
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 11 additions and 19 deletions

View File

@ -334,7 +334,7 @@
"keys": ["Cmd:p"]
},
{
"command": "rightsidebar:open",
"command": "rightsidebar:toggle",
"keys": ["Cmd:Shift:Space"]
}
]

View File

@ -160,7 +160,7 @@ class App extends React.Component<{}, {}> {
</div>
</If>
<If condition={rightSidebarCollapsed && activeMainView == "session"}>
<div className="right-sidebar-triggers" title="Open Wave AI">
<div className="right-sidebar-triggers" title="Open Wave AI (Cmd-Shift-Space)">
<Button
className="secondary ghost right-sidebar-trigger"
onClick={this.openRightSidebar}

View File

@ -57,21 +57,17 @@ class SidebarKeyBindings extends React.Component<{ component: RightSideBar; isOp
componentDidMount(): void {
const { component } = this.props;
const keybindManager = GlobalModel.keybindManager;
keybindManager.registerKeybinding("pane", "rightsidebar", "rightsidebar:open", (waveEvent) => {
return component.onOpen();
keybindManager.registerKeybinding("pane", "rightsidebar", "rightsidebar:toggle", (waveEvent) => {
if (this.props.isOpen) {
return component.onClose();
} else {
return component.onOpen();
}
});
}
componentDidUpdate(): void {
if (this.props.isOpen) {
const { component } = this.props;
const keybindManager = GlobalModel.keybindManager;
keybindManager.registerKeybinding("pane", "rightsidebar:close", "generic:cancel", (waveEvent) => {
return component.onClose();
});
} else {
GlobalModel.keybindManager.unregisterDomain("rightsidebar:close");
}
// remove for now (needs to take into account right sidebar focus so it doesn't conflict with other ESC keybindings)
}
componentWillUnmount(): void {

View File

@ -250,7 +250,7 @@ class CmdInput extends React.Component<{}, {}> {
</If>
<div
key="aichat"
title="Wave AI (Ctrl-Space)"
title="Wave AI (Cmd-Shift-Space)"
className="cmdinput-icon"
onClick={this.clickAIChatAction}
>

View File

@ -70,10 +70,6 @@ class RightSidebarModel implements SidebarModel {
}
getCollapsed(): boolean {
// disable right sidebar in production
if (!this.globalModel.isDev) {
return true;
}
const clientData = this.globalModel.clientData.get();
const collapsed = clientData?.clientopts?.rightsidebar?.collapsed;
if (this.isDragging.get()) {

View File

@ -88,7 +88,7 @@ const PacketEOFStr = "EOF"
var TypeStrToFactory map[string]reflect.Type
const OpenAICmdInfoChatGreetingMessage = "Hello, may I help you with this command? \n(Ctrl-Space: open, ESC: close, Ctrl+L: clear chat buffer, Up/Down: select code blocks, Enter: to copy a selected code block to the command input)"
const OpenAICmdInfoChatGreetingMessage = "Hello, how may I help you with this command? \n(Cmd-Shift-Space: open/close, Ctrl+L: clear chat buffer, Up/Down: select code blocks, Enter: to copy a selected code block to the command input)"
func init() {
TypeStrToFactory = make(map[string]reflect.Type)