Skip to content

Commit

Permalink
enable right sidebar (#663)
Browse files Browse the repository at this point in the history
  • Loading branch information
sawka authored May 29, 2024
1 parent 652250a commit 1234919
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion assets/default-keybindings.json
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@
"keys": ["Cmd:p"]
},
{
"command": "rightsidebar:open",
"command": "rightsidebar:toggle",
"keys": ["Cmd:Shift:Space"]
}
]
2 changes: 1 addition & 1 deletion src/app/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
18 changes: 7 additions & 11 deletions src/app/sidebar/right.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/app/workspace/cmdinput/cmdinput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
>
Expand Down
4 changes: 0 additions & 4 deletions src/models/rightsidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
2 changes: 1 addition & 1 deletion waveshell/pkg/packet/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1234919

Please sign in to comment.