mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-02 18:39:05 +01:00
enable right sidebar (#663)
This commit is contained in:
parent
652250ac3c
commit
1234919229
@ -334,7 +334,7 @@
|
|||||||
"keys": ["Cmd:p"]
|
"keys": ["Cmd:p"]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "rightsidebar:open",
|
"command": "rightsidebar:toggle",
|
||||||
"keys": ["Cmd:Shift:Space"]
|
"keys": ["Cmd:Shift:Space"]
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -160,7 +160,7 @@ class App extends React.Component<{}, {}> {
|
|||||||
</div>
|
</div>
|
||||||
</If>
|
</If>
|
||||||
<If condition={rightSidebarCollapsed && activeMainView == "session"}>
|
<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
|
<Button
|
||||||
className="secondary ghost right-sidebar-trigger"
|
className="secondary ghost right-sidebar-trigger"
|
||||||
onClick={this.openRightSidebar}
|
onClick={this.openRightSidebar}
|
||||||
|
@ -57,21 +57,17 @@ class SidebarKeyBindings extends React.Component<{ component: RightSideBar; isOp
|
|||||||
componentDidMount(): void {
|
componentDidMount(): void {
|
||||||
const { component } = this.props;
|
const { component } = this.props;
|
||||||
const keybindManager = GlobalModel.keybindManager;
|
const keybindManager = GlobalModel.keybindManager;
|
||||||
keybindManager.registerKeybinding("pane", "rightsidebar", "rightsidebar:open", (waveEvent) => {
|
keybindManager.registerKeybinding("pane", "rightsidebar", "rightsidebar:toggle", (waveEvent) => {
|
||||||
return component.onOpen();
|
if (this.props.isOpen) {
|
||||||
|
return component.onClose();
|
||||||
|
} else {
|
||||||
|
return component.onOpen();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(): void {
|
componentDidUpdate(): void {
|
||||||
if (this.props.isOpen) {
|
// remove for now (needs to take into account right sidebar focus so it doesn't conflict with other ESC keybindings)
|
||||||
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");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount(): void {
|
componentWillUnmount(): void {
|
||||||
|
@ -250,7 +250,7 @@ class CmdInput extends React.Component<{}, {}> {
|
|||||||
</If>
|
</If>
|
||||||
<div
|
<div
|
||||||
key="aichat"
|
key="aichat"
|
||||||
title="Wave AI (Ctrl-Space)"
|
title="Wave AI (Cmd-Shift-Space)"
|
||||||
className="cmdinput-icon"
|
className="cmdinput-icon"
|
||||||
onClick={this.clickAIChatAction}
|
onClick={this.clickAIChatAction}
|
||||||
>
|
>
|
||||||
|
@ -70,10 +70,6 @@ class RightSidebarModel implements SidebarModel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getCollapsed(): boolean {
|
getCollapsed(): boolean {
|
||||||
// disable right sidebar in production
|
|
||||||
if (!this.globalModel.isDev) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
const clientData = this.globalModel.clientData.get();
|
const clientData = this.globalModel.clientData.get();
|
||||||
const collapsed = clientData?.clientopts?.rightsidebar?.collapsed;
|
const collapsed = clientData?.clientopts?.rightsidebar?.collapsed;
|
||||||
if (this.isDragging.get()) {
|
if (this.isDragging.get()) {
|
||||||
|
@ -88,7 +88,7 @@ const PacketEOFStr = "EOF"
|
|||||||
|
|
||||||
var TypeStrToFactory map[string]reflect.Type
|
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() {
|
func init() {
|
||||||
TypeStrToFactory = make(map[string]reflect.Type)
|
TypeStrToFactory = make(map[string]reflect.Type)
|
||||||
|
Loading…
Reference in New Issue
Block a user