Compare commits

...

53 Commits

Author SHA1 Message Date
Evan Simkowitz e5a168f34c making textareainput functional component 2024-04-08 15:48:05 -07:00
Evan Simkowitz cc547e526b save 2024-04-08 14:20:10 -07:00
Evan Simkowitz 1b1e6edaee Merge branch 'main' into evan/inshellisense 2024-04-08 13:47:17 -07:00
Evan Simkowitz 1f5309e097 undo text cursor on prompt area (#559) 2024-04-08 13:47:03 -07:00
Evan Simkowitz f4aeb92d32 Merge branch 'main' into evan/inshellisense 2024-04-08 13:16:01 -07:00
Evan Simkowitz af7cc866d3 Make cmdinput prompt smaller, properly handle select events to take priority over onclick (#558) 2024-04-08 13:15:33 -07:00
Evan Simkowitz b780d5b244 Merge branch 'main' into evan/inshellisense 2024-04-08 11:19:25 -07:00
Evan Simkowitz 37e56acf63 Cleanup unused variables in workspaceview (#557) 2024-04-08 10:17:26 -07:00
Mike Sawka 70088afdb5 daystr custom func (#555)
* working on daystr funcs

* daystr custom function
2024-04-05 22:42:22 -07:00
Evan Simkowitz 455790416d Clean up the input model's auxiliary view logic (#553)
* Clean up the input model's auxiliary view logic

* fix

* save work

* rename appconst

* fix keybindings

* remove debugs

* Add comments

* fix focus order

* givefocus whenever focus var is updated, don't update if nothign changes

* remove debug statements

* one more debug

* revert unnecessary newline

* remove cmdinput placeholder to allow for better window resizing
2024-04-05 17:39:27 -07:00
Cole Lashley eed234a131 added codeedit keybinding fix (#554) 2024-04-05 13:01:51 -07:00
Red J Adaya 5a6575a393 Copy button (#550)
* cop button

* cleanup

* fix wrong type

* updates to try to set the cmdinput position (as well as text).  fix button alignment, change checkmark to green (and extend), and remove the transition from parent component and move to copy (sawka)
2024-04-05 12:06:04 -07:00
Sylvie Crowe 84cea373a8 SSH Bugfixes Early April 2024 (#551)
* fix: add vix for missing known_hosts file

In a recent cleanup, I accidentally deleted this fix from before. This
adds it back.

* chore: clarify that the ssh should use private key
2024-04-05 10:54:12 -07:00
Mike Sawka 181e14f55c try to detect and return mimetype with stream file info (#552) 2024-04-05 10:52:04 -07:00
Evan Simkowitz d81a6ed480 Merge branch 'main' into evan/inshellisense 2024-04-05 10:49:22 -07:00
Evan Simkowitz d8393ae50b Merge branch 'main' into evan/inshellisense 2024-04-02 18:48:59 -07:00
Evan Simkowitz 79deb01ea4 save work 2024-04-02 18:48:38 -07:00
Evan Simkowitz 12f9a50686 beginning to add autocomplete to textareainput 2024-04-02 18:35:12 -07:00
Evan Simkowitz 239933be3e Got autocomplete working! 2024-04-02 18:14:49 -07:00
Evan Simkowitz 4692cf698b hook up runtime 2024-04-02 17:13:54 -07:00
Evan Simkowitz 907e87c217 expand cwd 2024-04-02 17:05:14 -07:00
Evan Simkowitz f97bb699a1 plumb timeout to waveshell 2024-04-02 16:57:34 -07:00
Evan Simkowitz 077545ed93 bad merrge 2024-04-02 15:50:46 -07:00
Evan Simkowitz 60d0f0e976 Merge branch 'main' into evan/inshellisense 2024-04-02 15:49:32 -07:00
Evan Simkowitz cd4671e5bb store pointer to syncs 2024-04-02 14:58:39 -07:00
Evan Simkowitz d8a714dd4a ensure only one downstream writer can read from the buffer 2024-04-02 14:28:15 -07:00
Evan Simkowitz e0fa1b2560 document UsePty 2024-04-02 14:19:46 -07:00
Evan Simkowitz 2dffcc9237 add UsePty to EphemeralRunOpts 2024-04-02 14:17:12 -07:00
Evan Simkowitz 70090b8684 add package comment 2024-04-02 14:08:10 -07:00
Evan Simkowitz 3f8952caf4 more naming changes 2024-04-02 14:06:51 -07:00
Evan Simkowitz 15a2486e94 delete unused package 2024-04-02 14:01:57 -07:00
Evan Simkowitz 38aa7016b8 comment 2024-04-02 14:01:03 -07:00
Evan Simkowitz cff353ca94 formatting 2024-04-02 13:59:59 -07:00
Evan Simkowitz 5b440ace65 Making EphemeralWriteCloser into a more generic BufferedPipe 2024-04-02 13:58:56 -07:00
Evan Simkowitz 87de0dbc44 revert waveshell changes 2024-04-01 22:17:44 -07:00
Evan Simkowitz 74839b8e1b env vars are now working 2024-04-01 22:12:58 -07:00
Evan Simkowitz 8a24953a88 fix stdout/stderr 2024-04-01 20:55:23 -07:00
Evan Simkowitz a95854514a Add separate paths for stdout and stderr writers 2024-04-01 20:51:26 -07:00
Evan Simkowitz 229fcf8cd4 got cwd override working 2024-04-01 18:27:18 -07:00
Evan Simkowitz 83542ddab8 clean up code 2024-04-01 17:42:03 -07:00
Evan Simkowitz b520242f04 fixing spaghetti 2024-04-01 17:12:51 -07:00
Evan Simkowitz bc73ed1b6c save debug statements 2024-04-01 16:04:42 -07:00
Evan Simkowitz c4647945a4 fix bad merge 2024-04-01 14:22:23 -07:00
Evan Simkowitz 3db40b1c63 Merge branch 'main' into evan/inshellisense 2024-04-01 14:22:17 -07:00
Evan Simkowitz f6d7c37915 save debugging 2024-03-29 16:54:29 -07:00
Evan Simkowitz a41e866b1f Command pipes thru, triggers infinite loop 2024-03-28 18:44:37 -07:00
Evan Simkowitz a772715ae4 Add EphemeralWriteCloser 2024-03-28 18:02:27 -07:00
Evan Simkowitz d32e2aae05 Merge branch 'main' into evan/inshellisense 2024-03-28 16:24:27 -07:00
Evan Simkowitz 3f9d52a7e4 save work 2024-03-26 16:04:37 -07:00
Evan Simkowitz a239a8d70e Merge branch 'main' into evan/inshellisense 2024-03-26 13:00:21 -07:00
Evan Simkowitz a1bddd971f save work 2024-03-25 17:43:02 -07:00
Evan Simkowitz 722318f57d save work, starting to add backend types 2024-03-25 10:54:27 -07:00
Evan Simkowitz 3b633328a1 initial 2024-03-22 16:01:08 -07:00
51 changed files with 2067 additions and 694 deletions
+3 -1
View File
@@ -23,6 +23,7 @@
"@table-nav/react": "^0.0.7",
"@tanstack/match-sorter-utils": "^8.8.4",
"@tanstack/react-table": "^8.10.3",
"@withfig/autocomplete": "^2.652.3",
"autobind-decorator": "^2.4.0",
"base64-js": "^1.5.1",
"classnames": "^2.3.1",
@@ -77,6 +78,7 @@
"@types/throttle-debounce": "^5.0.1",
"@types/uuid": "^9.0.7",
"@types/webpack-env": "^1.18.3",
"@withfig/autocomplete-types": "^1.30.0",
"babel-loader": "^9.1.3",
"babel-plugin-jsx-control-statements": "^4.1.2",
"copy-webpack-plugin": "^12.0.0",
@@ -105,4 +107,4 @@
"scripts": {
"postinstall": "electron-builder install-app-deps"
}
}
}
+4
View File
@@ -64,3 +64,7 @@ export enum StatusIndicatorLevel {
// matches packet.go
export const ErrorCode_InvalidCwd = "ERRCWD";
export const InputAuxView_History = "history";
export const InputAuxView_Info = "info";
export const InputAuxView_AIChat = "aichat";
+2 -2
View File
@@ -7,13 +7,13 @@ import * as mobx from "mobx";
import { boundMethod } from "autobind-decorator";
import { If } from "tsx-control-statements/components";
import { GlobalModel, GlobalCommandRunner, RemotesModel, getApi } from "@/models";
import { Toggle, InlineSettingsTextEdit, SettingsError, Dropdown } from "@/common/elements";
import { Toggle, InlineSettingsTextEdit, SettingsError, Dropdown, Button } from "@/common/elements";
import { commandRtnHandler, isBlank } from "@/util/util";
import { getTermThemes } from "@/util/themeutil";
import * as appconst from "@/app/appconst";
import "./clientsettings.less";
import { MainView } from "../common/elements/mainview";
import { MainView } from "@/common/elements/mainview";
class ClientSettingsKeybindings extends React.Component<{}, {}> {
componentDidMount() {
+6 -4
View File
@@ -6,7 +6,7 @@ import "./button.less";
interface ButtonProps {
children: React.ReactNode;
onClick?: () => void;
onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;
disabled?: boolean;
leftIcon?: React.ReactNode;
rightIcon?: React.ReactNode;
@@ -14,6 +14,7 @@ interface ButtonProps {
autoFocus?: boolean;
className?: string;
termInline?: boolean;
title?: string;
}
class Button extends React.Component<ButtonProps> {
@@ -23,14 +24,14 @@ class Button extends React.Component<ButtonProps> {
};
@boundMethod
handleClick() {
handleClick(e) {
if (this.props.onClick && !this.props.disabled) {
this.props.onClick();
this.props.onClick(e);
}
}
render() {
const { leftIcon, rightIcon, children, disabled, style, autoFocus, termInline, className } = this.props;
const { leftIcon, rightIcon, children, disabled, style, autoFocus, termInline, className, title } = this.props;
return (
<button
@@ -39,6 +40,7 @@ class Button extends React.Component<ButtonProps> {
disabled={disabled}
style={style}
autoFocus={autoFocus}
title={title}
>
{leftIcon && <span className="icon-left">{leftIcon}</span>}
{children}
+7
View File
@@ -0,0 +1,7 @@
.copy-button {
padding: 5px 5px;
.fa-check {
color: var(--app-success-color);
}
}
+51
View File
@@ -0,0 +1,51 @@
import * as React from "react";
import { Button } from "./button";
import { boundMethod } from "autobind-decorator";
import * as mobxReact from "mobx-react";
import * as mobx from "mobx";
import "./copybutton.less";
type CopyButtonProps = {
title: string;
onClick: (e: React.MouseEvent<HTMLButtonElement>) => void;
};
@mobxReact.observer
class CopyButton extends React.Component<CopyButtonProps, {}> {
isCopied: OV<boolean> = mobx.observable.box(false, { name: "isCopied" });
@boundMethod
handleOnClick(e: React.MouseEvent<HTMLButtonElement>) {
if (this.isCopied.get()) {
return;
}
mobx.action(() => {
this.isCopied.set(true);
})();
setTimeout(() => {
mobx.action(() => {
this.isCopied.set(false);
})();
}, 2000);
if (this.props.onClick) {
this.props.onClick(e);
}
}
render() {
const { title, onClick } = this.props;
const isCopied = this.isCopied.get();
return (
<Button onClick={this.handleOnClick} className="copy-button secondary ghost" title={title}>
{isCopied ? (
<i className="fa-sharp fa-solid fa-check"></i>
) : (
<i className="fa-sharp fa-solid fa-copy"></i>
)}
</Button>
);
}
}
export { CopyButton };
+1
View File
@@ -18,3 +18,4 @@ export { Toggle } from "./toggle";
export { Tooltip } from "./tooltip";
export { TabIcon } from "./tabicon";
export { DatePicker } from "./datepicker";
export { CopyButton } from "./copybutton";
+1 -1
View File
@@ -312,7 +312,7 @@ class CreateRemoteConnModal extends React.Component<{}, {}> {
endDecoration: (
<InputDecoration>
<Tooltip
message={`(Required) The path to your ssh key file.`}
message={`(Required) The path to your ssh private key file.`}
icon={<i className="fa-sharp fa-regular fa-circle-question" />}
>
<i className="fa-sharp fa-regular fa-circle-question" />
+1 -1
View File
@@ -338,7 +338,7 @@ class EditRemoteConnModal extends React.Component<{}, {}> {
endDecoration: (
<InputDecoration>
<Tooltip
message={`(Required) The path to your ssh key file.`}
message={`(Required) The path to your ssh private key file.`}
icon={<i className="fa-sharp fa-regular fa-circle-question" />}
>
<i className="fa-sharp fa-regular fa-circle-question" />
+4
View File
@@ -357,6 +357,10 @@
cursor: pointer;
}
.wave-button {
padding: 5px 5px;
}
visibility: hidden;
}
+7 -27
View File
@@ -14,7 +14,7 @@ import localizedFormat from "dayjs/plugin/localizedFormat";
import customParseFormat from "dayjs/plugin/customParseFormat";
import { Line } from "@/app/line/linecomps";
import { checkKeyPressed, adaptFromReactOrNativeKeyEvent } from "@/util/keyutil";
import { TextField, Dropdown, Button, DatePicker } from "@/elements";
import { TextField, Dropdown, Button, CopyButton } from "@/elements";
import { ReactComponent as ChevronLeftIcon } from "@/assets/icons/history/chevron-left.svg";
import { ReactComponent as ChevronRightIcon } from "@/assets/icons/history/chevron-right.svg";
@@ -22,8 +22,6 @@ import { ReactComponent as RightIcon } from "@/assets/icons/history/right.svg";
import { ReactComponent as SearchIcon } from "@/assets/icons/history/search.svg";
import { ReactComponent as TrashIcon } from "@/assets/icons/trash.svg";
import { ReactComponent as CheckedCheckbox } from "@/assets/icons/checked-checkbox.svg";
import { ReactComponent as CheckIcon } from "@/assets/icons/line/check.svg";
import { ReactComponent as CopyIcon } from "@/assets/icons/history/copy.svg";
import "./history.less";
import { MainView } from "../common/elements/mainview";
@@ -115,7 +113,6 @@ class HistoryCmdStr extends React.Component<
cmdstr: string;
onUse: () => void;
onCopy: () => void;
isCopied: boolean;
fontSize: "normal" | "large";
limitHeight: boolean;
},
@@ -138,24 +135,17 @@ class HistoryCmdStr extends React.Component<
}
render() {
const { isCopied, cmdstr, fontSize, limitHeight } = this.props;
const { cmdstr, fontSize, limitHeight } = this.props;
return (
<div className={cn("cmdstr-code", { "is-large": fontSize == "large" }, { "limit-height": limitHeight })}>
<If condition={isCopied}>
<div key="copied" className="copied-indicator">
<div>copied</div>
</div>
</If>
<div key="code" className="code-div">
<code>{cmdstr}</code>
</div>
<div key="copy" className="actions-block">
<div className="action-item" onClick={this.handleCopy} title="copy">
<CopyIcon className="icon" />
</div>
<div key="use" className="action-item" title="Use Command" onClick={this.handleUse}>
<CheckIcon className="icon" />
</div>
<CopyButton onClick={this.handleCopy} title="Copy" />
<Button className="secondary ghost" title="Use Command" onClick={this.handleUse}>
<i className="fa-sharp fa-solid fa-play"></i>
</Button>
</div>
</div>
);
@@ -190,7 +180,6 @@ class HistoryView extends React.Component<{}, {}> {
tableRszObs: ResizeObserver;
sessionDropdownActive: OV<boolean> = mobx.observable.box(false, { name: "sessionDropdownActive" });
remoteDropdownActive: OV<boolean> = mobx.observable.box(false, { name: "remoteDropdownActive" });
copiedItemId: OV<string> = mobx.observable.box(null, { name: "copiedItemId" });
@boundMethod
handleNext() {
@@ -377,14 +366,6 @@ class HistoryView extends React.Component<{}, {}> {
return;
}
navigator.clipboard.writeText(item.cmdstr);
mobx.action(() => {
this.copiedItemId.set(item.historyid);
})();
setTimeout(() => {
mobx.action(() => {
this.copiedItemId.set(null);
})();
}, 600);
}
@boundMethod
@@ -394,7 +375,7 @@ class HistoryView extends React.Component<{}, {}> {
}
mobx.action(() => {
GlobalModel.showSessionView();
GlobalModel.inputModel.setCurLine(item.cmdstr);
GlobalModel.inputModel.updateCmdLine({ str: item.cmdstr, pos: item.cmdstr.length });
setTimeout(() => GlobalModel.inputModel.giveFocus(), 50);
})();
}
@@ -569,7 +550,6 @@ class HistoryView extends React.Component<{}, {}> {
cmdstr={item.cmdstr}
onUse={() => this.handleUse(item)}
onCopy={() => this.handleCopy(item)}
isCopied={this.copiedItemId.get() == item.historyid}
fontSize="normal"
limitHeight={true}
/>
+4 -4
View File
@@ -27,7 +27,7 @@ class AIChatKeybindings extends React.Component<{ AIChatObject: AIChat }, {}> {
return true;
});
keybindManager.registerKeybinding("pane", "aichat", "generic:cancel", (waveEvent) => {
inputModel.closeAIAssistantChat(true);
inputModel.closeAuxView();
return true;
});
keybindManager.registerKeybinding("pane", "aichat", "aichat:clearHistory", (waveEvent) => {
@@ -70,7 +70,7 @@ class AIChat extends React.Component<{}, {}> {
componentDidMount() {
const inputModel = GlobalModel.inputModel;
if (this.chatWindowScrollRef != null && this.chatWindowScrollRef.current != null) {
if (this.chatWindowScrollRef?.current != null) {
this.chatWindowScrollRef.current.scrollTop = this.chatWindowScrollRef.current.scrollHeight;
}
if (this.textAreaRef.current != null) {
@@ -82,7 +82,7 @@ class AIChat extends React.Component<{}, {}> {
}
componentDidUpdate() {
if (this.chatWindowScrollRef != null && this.chatWindowScrollRef.current != null) {
if (this.chatWindowScrollRef?.current != null) {
this.chatWindowScrollRef.current.scrollTop = this.chatWindowScrollRef.current.scrollHeight;
}
}
@@ -252,7 +252,7 @@ class AIChat extends React.Component<{}, {}> {
<AuxiliaryCmdView
title="Wave AI"
className="cmd-aichat"
onClose={() => GlobalModel.inputModel.closeAIAssistantChat(true)}
onClose={() => GlobalModel.inputModel.closeAuxView()}
iconClass="fa-sharp fa-solid fa-sparkles"
>
<If condition={renderKeybindings}>
@@ -0,0 +1,28 @@
// Copyright 2024, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0
import { SuggestionBlob } from "@/autocomplete/runtime/model";
import { GlobalModel } from "@/models";
import cn from "classnames";
import { useMemo } from "react";
export const AutocompleteSuggestions = async (props: { curLine: string }) => {
const inputModel = GlobalModel.inputModel;
const suggestions = await useMemo(async () => await inputModel.getSuggestions(), [props.curLine]);
if (!suggestions) {
return null;
}
const items = suggestions.suggestions.map((s) => `${s.icon} ${s.name}`);
return (
<div className="autocomplete-suggestions">
{items.map((item, idx) => (
<div key={idx} className={cn("autocomplete-item")}>
{item}
</div>
))}
</div>
);
};
+1 -2
View File
@@ -4,12 +4,11 @@
max-height: max(300px, 40%);
display: flex;
flex-direction: column;
position: absolute;
bottom: 0;
width: 100%;
z-index: 100;
border-top: 2px solid var(--app-border-color);
background-color: var(--app-bg-color);
position: relative;
// Apply a border between the base cmdinput and any views shown above it
// TODO: use a generic selector for this
+27 -20
View File
@@ -5,7 +5,7 @@ import * as React from "react";
import * as mobxReact from "mobx-react";
import * as mobx from "mobx";
import { boundMethod } from "autobind-decorator";
import { If } from "tsx-control-statements/components";
import { Choose, If, When } from "tsx-control-statements/components";
import cn from "classnames";
import dayjs from "dayjs";
import localizedFormat from "dayjs/plugin/localizedFormat";
@@ -18,6 +18,7 @@ import { Prompt } from "@/common/prompt/prompt";
import { CenteredIcon, RotateIcon } from "@/common/icons/icons";
import { AIChat } from "./aichat";
import * as util from "@/util/util";
import * as appconst from "@/app/appconst";
import "./cmdinput.less";
@@ -61,7 +62,7 @@ class CmdInput extends React.Component<{}, {}> {
}
@boundMethod
baseCmdInputClick(e: React.MouseEvent): void {
baseCmdInputClick(e: React.SyntheticEvent): void {
if (this.promptRef.current != null) {
if (this.promptRef.current.contains(e.target)) {
return;
@@ -71,7 +72,7 @@ class CmdInput extends React.Component<{}, {}> {
e.stopPropagation();
return;
}
GlobalModel.inputModel.setHistoryFocus(false);
GlobalModel.inputModel.setAuxViewFocus(false);
GlobalModel.inputModel.giveFocus();
}
@@ -80,8 +81,8 @@ class CmdInput extends React.Component<{}, {}> {
e.preventDefault();
e.stopPropagation();
const inputModel = GlobalModel.inputModel;
if (inputModel.aIChatShow.get()) {
inputModel.closeAIAssistantChat(true);
if (inputModel.getActiveAuxView() === appconst.InputAuxView_AIChat) {
inputModel.closeAuxView();
} else {
inputModel.openAIAssistantChat();
}
@@ -93,7 +94,7 @@ class CmdInput extends React.Component<{}, {}> {
e.stopPropagation();
const inputModel = GlobalModel.inputModel;
if (inputModel.historyShow.get()) {
if (inputModel.getActiveAuxView() === appconst.InputAuxView_History) {
inputModel.resetHistory();
} else {
inputModel.openHistory();
@@ -155,9 +156,6 @@ class CmdInput extends React.Component<{}, {}> {
remote = GlobalModel.getRemote(rptr.remoteid);
}
feState = feState || {};
const infoShow = inputModel.infoShow.get();
const historyShow = !infoShow && inputModel.historyShow.get();
const aiChatShow = inputModel.aIChatShow.get();
const focusVal = inputModel.physicalInputFocused.get();
const inputMode: string = inputModel.inputMode.get();
const textAreaInputKey = screen == null ? "null" : screen.screenId;
@@ -170,7 +168,7 @@ class CmdInput extends React.Component<{}, {}> {
let shellInitMsg: string = null;
let hidePrompt = false;
const openView = inputModel.getOpenView();
const openView = inputModel.getActiveAuxView();
const hasOpenView = openView ? `has-${openView}` : null;
if (ri == null) {
let shellStr = "shell";
@@ -185,15 +183,19 @@ class CmdInput extends React.Component<{}, {}> {
}
return (
<div ref={this.cmdInputRef} className={cn("cmd-input", hasOpenView, { active: focusVal })}>
<If condition={historyShow}>
<div className="cmd-input-grow-spacer"></div>
<HistoryInfo />
</If>
<If condition={aiChatShow}>
<div className="cmd-input-grow-spacer"></div>
<AIChat />
</If>
<InfoMsg key="infomsg" />
<Choose>
<When condition={openView === appconst.InputAuxView_History}>
<div className="cmd-input-grow-spacer"></div>
<HistoryInfo />
</When>
<When condition={openView === appconst.InputAuxView_AIChat}>
<div className="cmd-input-grow-spacer"></div>
<AIChat />
</When>
<When condition={openView === appconst.InputAuxView_Info}>
<InfoMsg key="infomsg" />
</When>
</Choose>
<If condition={remote && remote.status != "connected"}>
<div className="remote-status-warning">
WARNING:&nbsp;
@@ -229,7 +231,12 @@ class CmdInput extends React.Component<{}, {}> {
</Button>
</div>
</If>
<div key="base-cmdinput" className="base-cmdinput" onClick={this.baseCmdInputClick}>
<div
key="base-cmdinput"
className="base-cmdinput"
onClick={this.baseCmdInputClick}
onSelect={this.baseCmdInputClick}
>
<div className="cmdinput-actions">
<If condition={numRunningLines > 0}>
<div
+4 -4
View File
@@ -167,14 +167,14 @@ class HistoryInfo extends React.Component<{}, {}> {
@boundMethod
handleClose() {
GlobalModel.inputModel.toggleInfoMsg();
GlobalModel.inputModel.closeAuxView();
}
@boundMethod
handleItemClick(hitem: HistoryItem) {
const inputModel = GlobalModel.inputModel;
const selItem = inputModel.getHistorySelectedItem();
inputModel.setHistoryFocus(true);
inputModel.setAuxViewFocus(false);
if (this.lastClickHNum == hitem.historynum && selItem != null && selItem.historynum == hitem.historynum) {
inputModel.grabSelectedHistoryItem();
return;
@@ -194,14 +194,14 @@ class HistoryInfo extends React.Component<{}, {}> {
@boundMethod
handleClickType() {
const inputModel = GlobalModel.inputModel;
inputModel.setHistoryFocus(true);
inputModel.setAuxViewFocus(true);
inputModel.toggleHistoryType();
}
@boundMethod
handleClickRemote() {
const inputModel = GlobalModel.inputModel;
inputModel.setHistoryFocus(true);
inputModel.setAuxViewFocus(true);
inputModel.toggleRemoteType();
}
+1 -1
View File
@@ -45,7 +45,7 @@ class InfoMsg extends React.Component<{}, {}> {
render() {
const inputModel = GlobalModel.inputModel;
const infoMsg: InfoType = inputModel.infoMsg.get();
const infoShow: boolean = inputModel.infoShow.get();
const infoShow = inputModel.getActiveAuxView() == appconst.InputAuxView_Info;
let line: string = null;
let istr: string = null;
let idx: number = 0;
File diff suppressed because it is too large Load Diff
+10 -17
View File
@@ -13,7 +13,6 @@ import { CmdInput } from "./cmdinput/cmdinput";
import { ScreenView } from "./screen/screenview";
import { ScreenTabs } from "./screen/tabs";
import { ErrorBoundary } from "@/common/error/errorboundary";
import * as textmeasure from "@/util/textmeasure";
import { boundMethod } from "autobind-decorator";
import type { Screen } from "@/models";
import { Button } from "@/elements";
@@ -34,7 +33,7 @@ Are you sure you want to delete this tab?
class SessionKeybindings extends React.Component<{}, {}> {
componentDidMount() {
let keybindManager = GlobalModel.keybindManager;
const keybindManager = GlobalModel.keybindManager;
keybindManager.registerKeybinding("mainview", "session", "app:toggleSidebar", (waveEvent) => {
GlobalModel.handleToggleSidebar();
return true;
@@ -96,7 +95,7 @@ class SessionKeybindings extends React.Component<{}, {}> {
@mobxReact.observer
class TabSettingsPulldownKeybindings extends React.Component<{}, {}> {
componentDidMount() {
let keybindManager = GlobalModel.keybindManager;
const keybindManager = GlobalModel.keybindManager;
keybindManager.registerKeybinding("pane", "tabsettings", "generic:cancel", (waveEvent) => {
GlobalModel.closeTabSettings();
return true;
@@ -127,13 +126,13 @@ class TabSettings extends React.Component<{ screen: Screen }, {}> {
GlobalModel.modalsModel.popModal();
return;
}
let message = ScreenDeleteMessage;
let alertRtn = GlobalModel.showAlert({ message: message, confirm: true, markdown: true });
const message = ScreenDeleteMessage;
const alertRtn = GlobalModel.showAlert({ message: message, confirm: true, markdown: true });
alertRtn.then((result) => {
if (!result) {
return;
}
let prtn = GlobalCommandRunner.screenDelete(screen.screenId, false);
const prtn = GlobalCommandRunner.screenDelete(screen.screenId, false);
util.commandRtnHandler(prtn, this.errorMessage);
GlobalModel.modalsModel.popModal();
});
@@ -151,8 +150,8 @@ class TabSettings extends React.Component<{ screen: Screen }, {}> {
}
render() {
let { screen } = this.props;
let rptr = screen.curRemote.get();
const { screen } = this.props;
const rptr = screen.curRemote.get();
const termThemes = getTermThemes(GlobalModel.termThemes);
const currTermTheme = GlobalModel.getTermTheme()[screen.screenId] ?? termThemes[0].label;
return (
@@ -271,18 +270,13 @@ class WorkspaceView extends React.Component<{}, {}> {
}
render() {
const model = GlobalModel;
const session = model.getActiveSession();
const session = GlobalModel.getActiveSession();
let activeScreen: Screen = null;
let sessionId: string = "none";
if (session != null) {
sessionId = session.sessionId;
activeScreen = session.getActiveScreen();
}
let cmdInputHeight = model.inputModel.cmdInputHeight.get();
if (cmdInputHeight == 0) {
cmdInputHeight = textmeasure.baseCmdInputHeight(GlobalModel.lineHeightEnv); // this is the base size of cmdInput (measured using devtools)
}
const isHidden = GlobalModel.activeMainView.get() != "session";
const mainSidebarModel = GlobalModel.mainSidebarModel;
@@ -303,9 +297,9 @@ class WorkspaceView extends React.Component<{}, {}> {
<ScreenTabs key={"tabs-" + sessionId} session={session} />
<If condition={activeScreen != null}>
<div key="pulldown" className={cn("tab-settings-pulldown", { closed: !showTabSettings })}>
<div className="close-icon" onClick={this.toggleTabSettings}>
<button className="close-icon" onClick={this.toggleTabSettings}>
<i className="fa-solid fa-sharp fa-xmark-large" />
</div>
</button>
<TabSettings key={activeScreen.screenId} screen={activeScreen} />
<If condition={showTabSettings && !isHidden}>
<TabSettingsPulldownKeybindings />
@@ -318,7 +312,6 @@ class WorkspaceView extends React.Component<{}, {}> {
session={session}
screen={activeScreen}
/>
<div className="cmdinput-height-placeholder" style={{ height: cmdInputHeight }}></div>
<If condition={activeScreen != null}>
<CmdInput key={"cmdinput-" + sessionId} />
</If>

Some files were not shown because too many files have changed in this diff Show More