Compare commits

...

10 Commits

Author SHA1 Message Date
sawka 8af0b0b7ae some ideas for new plugin api 2024-02-15 09:03:23 -08:00
sawka fb7f055449 do not try to set ZDOTDIR in rcfile (ignore). remove spurious log messages 2024-02-14 18:21:23 -08:00
Mike Sawka 3e4bd458b3 global shortcut for wave (#287)
* working on easy global shortcut for wave

* globalshortcut setting working

* cmd for macos, alt for others

* re-remove types.ts (was added back during merge)

* rename DDItem to DropdownItem, put into custom.d.ts

* make some consts
2024-02-13 17:43:02 -08:00
Red J Adaya 18fe3f3296 import aliass and configuration updates (#291) 2024-02-12 22:47:51 -08:00
Evan Simkowitz 2839179ced Fix History view not honoring sidebar width (#292)
* Fix History view not honoring sidebar width

* update comment
2024-02-12 22:34:49 -08:00
Red J Adaya 532e65c8ab Add main screens to Cmd-P search (#288)
* declare types as global

* remove mobx types aliases

* put back model_old.ts

* remove types.ts

* add main screens to Cmd-P search

* make viewData optional

* minor hint fix

* address improvements suggested by evan

* more on let to const
2024-02-12 17:54:12 -08:00
Red J Adaya 85f22a0733 Declare types as global (#282)
* declare types as global

* remove mobx types aliases

* put back model_old.ts

* remove types.ts
2024-02-12 16:39:29 -08:00
sawka 94de0460b4 fix history layout (item height and table width) 2024-02-11 23:14:29 -03:00
sawka 71b09cb44e fix typescript errors in emain.ts 2024-02-11 17:23:40 -03:00
sawka 07abaa92fa fix types for GlobalModel / GlobalCommandRunner so references work 2024-02-11 15:34:31 -03:00
139 changed files with 1572 additions and 1700 deletions
+2 -5
View File
@@ -7,10 +7,9 @@ import * as mobx from "mobx";
import { boundMethod } from "autobind-decorator"; import { boundMethod } from "autobind-decorator";
import { If } from "tsx-control-statements/components"; import { If } from "tsx-control-statements/components";
import dayjs from "dayjs"; import dayjs from "dayjs";
import type { ContextMenuOpts } from "../types/types";
import localizedFormat from "dayjs/plugin/localizedFormat"; import localizedFormat from "dayjs/plugin/localizedFormat";
import { GlobalModel } from "../models"; import { GlobalModel } from "@/models";
import { isBlank } from "../util/util"; import { isBlank } from "@/util/util";
import { WorkspaceView } from "./workspace/workspaceview"; import { WorkspaceView } from "./workspace/workspaceview";
import { PluginsView } from "./pluginsview/pluginsview"; import { PluginsView } from "./pluginsview/pluginsview";
import { BookmarksView } from "./bookmarks/bookmarks"; import { BookmarksView } from "./bookmarks/bookmarks";
@@ -25,8 +24,6 @@ import "./app.less";
dayjs.extend(localizedFormat); dayjs.extend(localizedFormat);
type OV<V> = mobx.IObservableValue<V>;
@mobxReact.observer @mobxReact.observer
class App extends React.Component<{}, {}> { class App extends React.Component<{}, {}> {
dcWait: OV<boolean> = mobx.observable.box(false, { name: "dcWait" }); dcWait: OV<boolean> = mobx.observable.box(false, { name: "dcWait" });
+10
View File
@@ -47,3 +47,13 @@ export const TabIcons = [
export const VERSION = __WAVETERM_VERSION__; export const VERSION = __WAVETERM_VERSION__;
// @ts-ignore // @ts-ignore
export const BUILD = __WAVETERM_BUILD__; export const BUILD = __WAVETERM_BUILD__;
/**
* Levels for the screen status indicator
*/
export enum StatusIndicatorLevel {
None = 0,
Output = 1,
Success = 2,
Error = 3,
}
+1 -1
View File
@@ -1,4 +1,4 @@
@import "../../app/common/themes/themes.less"; @import "@/common/themes/themes.less";
.bookmarks-view { .bookmarks-view {
background-color: @background-session; background-color: @background-session;
+7 -8
View File
@@ -7,15 +7,14 @@ import * as mobx from "mobx";
import { boundMethod } from "autobind-decorator"; import { boundMethod } from "autobind-decorator";
import { If, For } from "tsx-control-statements/components"; import { If, For } from "tsx-control-statements/components";
import cn from "classnames"; import cn from "classnames";
import type { BookmarkType } from "../../types/types"; import { GlobalModel } from "@/models";
import { GlobalModel } from "../../models"; import { CmdStrCode, Markdown } from "@/common/elements";
import { CmdStrCode, Markdown } from "../common/elements";
import { ReactComponent as XmarkIcon } from "../assets/icons/line/xmark.svg"; import { ReactComponent as XmarkIcon } from "@/assets/icons/line/xmark.svg";
import { ReactComponent as CopyIcon } from "../assets/icons/favourites/copy.svg"; import { ReactComponent as CopyIcon } from "@/assets/icons/favourites/copy.svg";
import { ReactComponent as PenIcon } from "../assets/icons/favourites/pen.svg"; import { ReactComponent as PenIcon } from "@/assets/icons/favourites/pen.svg";
import { ReactComponent as TrashIcon } from "../assets/icons/favourites/trash.svg"; import { ReactComponent as TrashIcon } from "@/assets/icons/favourites/trash.svg";
import { ReactComponent as FavoritesIcon } from "../assets/icons/favourites.svg"; import { ReactComponent as FavoritesIcon } from "@/assets/icons/favourites.svg";
import "./bookmarks.less"; import "./bookmarks.less";
+1 -1
View File
@@ -1,4 +1,4 @@
@import "../../app/common/themes/themes.less"; @import "@/common/themes/themes.less";
.clientsettings-view { .clientsettings-view {
background-color: @background-session; background-color: @background-session;
+55 -23
View File
@@ -6,20 +6,19 @@ import * as mobxReact from "mobx-react";
import * as mobx from "mobx"; import * as mobx from "mobx";
import { boundMethod } from "autobind-decorator"; import { boundMethod } from "autobind-decorator";
import cn from "classnames"; import cn from "classnames";
import { GlobalModel, GlobalCommandRunner, RemotesModel } from "../../models"; import { GlobalModel, GlobalCommandRunner, RemotesModel } from "@/models";
import { Toggle, InlineSettingsTextEdit, SettingsError, Dropdown } from "../common/elements"; import { Toggle, InlineSettingsTextEdit, SettingsError, Dropdown } from "@/common/elements";
import * as types from "../../types/types"; import { commandRtnHandler, isBlank } from "@/util/util";
import { commandRtnHandler, isBlank } from "../../util/util"; import * as appconst from "@/app/appconst";
import * as appconst from "../appconst";
import "./clientsettings.less"; import "./clientsettings.less";
@mobxReact.observer @mobxReact.observer
class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hoveredItemId: string }> { class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hoveredItemId: string }> {
fontSizeDropdownActive: types.OV<boolean> = mobx.observable.box(false, { fontSizeDropdownActive: OV<boolean> = mobx.observable.box(false, {
name: "clientSettings-fontSizeDropdownActive", name: "clientSettings-fontSizeDropdownActive",
}); });
errorMessage: types.OV<string> = mobx.observable.box(null, { name: "ClientSettings-errorMessage" }); errorMessage: OV<string> = mobx.observable.box(null, { name: "ClientSettings-errorMessage" });
@boundMethod @boundMethod
dismissError(): void { dismissError(): void {
@@ -30,12 +29,12 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
@boundMethod @boundMethod
handleChangeFontSize(fontSize: string): void { handleChangeFontSize(fontSize: string): void {
let newFontSize = Number(fontSize); const newFontSize = Number(fontSize);
this.fontSizeDropdownActive.set(false); this.fontSizeDropdownActive.set(false);
if (GlobalModel.termFontSize.get() == newFontSize) { if (GlobalModel.termFontSize.get() == newFontSize) {
return; return;
} }
let prtn = GlobalCommandRunner.setTermFontSize(newFontSize, false); const prtn = GlobalCommandRunner.setTermFontSize(newFontSize, false);
commandRtnHandler(prtn, this.errorMessage); commandRtnHandler(prtn, this.errorMessage);
} }
@@ -48,7 +47,7 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
@boundMethod @boundMethod
handleChangeTelemetry(val: boolean): void { handleChangeTelemetry(val: boolean): void {
let prtn: Promise<types.CommandRtnType> = null; let prtn: Promise<CommandRtnType> = null;
if (val) { if (val) {
prtn = GlobalCommandRunner.telemetryOn(false); prtn = GlobalCommandRunner.telemetryOn(false);
} else { } else {
@@ -59,7 +58,7 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
@boundMethod @boundMethod
handleChangeReleaseCheck(val: boolean): void { handleChangeReleaseCheck(val: boolean): void {
let prtn: Promise<types.CommandRtnType> = null; let prtn: Promise<CommandRtnType> = null;
if (val) { if (val) {
prtn = GlobalCommandRunner.releaseCheckAutoOn(false); prtn = GlobalCommandRunner.releaseCheckAutoOn(false);
} else { } else {
@@ -68,29 +67,29 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
commandRtnHandler(prtn, this.errorMessage); commandRtnHandler(prtn, this.errorMessage);
} }
getFontSizes(): any { getFontSizes(): DropdownItem[] {
let availableFontSizes: { label: string; value: number }[] = []; const availableFontSizes: DropdownItem[] = [];
for (let s = appconst.MinFontSize; s <= appconst.MaxFontSize; s++) { for (let s = appconst.MinFontSize; s <= appconst.MaxFontSize; s++) {
availableFontSizes.push({ label: s + "px", value: s }); availableFontSizes.push({ label: s + "px", value: String(s) });
} }
return availableFontSizes; return availableFontSizes;
} }
@boundMethod @boundMethod
inlineUpdateOpenAIModel(newModel: string): void { inlineUpdateOpenAIModel(newModel: string): void {
let prtn = GlobalCommandRunner.setClientOpenAISettings({ model: newModel }); const prtn = GlobalCommandRunner.setClientOpenAISettings({ model: newModel });
commandRtnHandler(prtn, this.errorMessage); commandRtnHandler(prtn, this.errorMessage);
} }
@boundMethod @boundMethod
inlineUpdateOpenAIToken(newToken: string): void { inlineUpdateOpenAIToken(newToken: string): void {
let prtn = GlobalCommandRunner.setClientOpenAISettings({ apitoken: newToken }); const prtn = GlobalCommandRunner.setClientOpenAISettings({ apitoken: newToken });
commandRtnHandler(prtn, this.errorMessage); commandRtnHandler(prtn, this.errorMessage);
} }
@boundMethod @boundMethod
inlineUpdateOpenAIMaxTokens(newMaxTokensStr: string): void { inlineUpdateOpenAIMaxTokens(newMaxTokensStr: string): void {
let prtn = GlobalCommandRunner.setClientOpenAISettings({ maxtokens: newMaxTokensStr }); const prtn = GlobalCommandRunner.setClientOpenAISettings({ maxtokens: newMaxTokensStr });
commandRtnHandler(prtn, this.errorMessage); commandRtnHandler(prtn, this.errorMessage);
} }
@@ -106,19 +105,41 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
GlobalModel.clientSettingsViewModel.closeView(); GlobalModel.clientSettingsViewModel.closeView();
} }
@boundMethod
handleChangeShortcut(newShortcut: string): void {
const prtn = GlobalCommandRunner.setGlobalShortcut(newShortcut);
commandRtnHandler(prtn, this.errorMessage);
}
getFKeys(): DropdownItem[] {
const opts: DropdownItem[] = [];
opts.push({ label: "Disabled", value: "" });
const platform = GlobalModel.getPlatform();
for (let i = 1; i <= 12; i++) {
const shortcut = (platform == "darwin" ? "Cmd" : "Alt") + "+F" + String(i);
opts.push({ label: shortcut, value: shortcut });
}
return opts;
}
getCurrentShortcut(): string {
const clientData = GlobalModel.clientData.get();
return clientData?.clientopts?.globalshortcut ?? "";
}
render() { render() {
let isHidden = GlobalModel.activeMainView.get() != "clientsettings"; const isHidden = GlobalModel.activeMainView.get() != "clientsettings";
if (isHidden) { if (isHidden) {
return null; return null;
} }
let cdata: types.ClientDataType = GlobalModel.clientData.get(); const cdata: ClientDataType = GlobalModel.clientData.get();
let openAIOpts = cdata.openaiopts ?? {}; const openAIOpts = cdata.openaiopts ?? {};
let apiTokenStr = isBlank(openAIOpts.apitoken) ? "(not set)" : "********"; const apiTokenStr = isBlank(openAIOpts.apitoken) ? "(not set)" : "********";
let maxTokensStr = String( const maxTokensStr = String(
openAIOpts.maxtokens == null || openAIOpts.maxtokens == 0 ? 1000 : openAIOpts.maxtokens openAIOpts.maxtokens == null || openAIOpts.maxtokens == 0 ? 1000 : openAIOpts.maxtokens
); );
let curFontSize = GlobalModel.termFontSize.get(); const curFontSize = GlobalModel.termFontSize.get();
return ( return (
<div className={cn("view clientsettings-view")}> <div className={cn("view clientsettings-view")}>
@@ -208,6 +229,17 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
/> />
</div> </div>
</div> </div>
<div className="settings-field">
<div className="settings-label">Global Hotkey</div>
<div className="settings-input">
<Dropdown
className="hotkey-dropdown"
options={this.getFKeys()}
defaultValue={this.getCurrentShortcut()}
onChange={this.handleChangeShortcut}
/>
</div>
</div>
<SettingsError errorMessage={this.errorMessage} /> <SettingsError errorMessage={this.errorMessage} />
</div> </div>
</div> </div>
+1 -1
View File
@@ -1,4 +1,4 @@
@import "../../../app/common/themes/themes.less"; @import "@/common/themes/themes.less";
.wave-button { .wave-button {
background: none; background: none;
+1 -1
View File
@@ -1,4 +1,4 @@
@import "../../../app/common/themes/themes.less"; @import "@/common/themes/themes.less";
.checkbox { .checkbox {
display: flex; display: flex;
+1 -1
View File
@@ -1,4 +1,4 @@
@import "../../../app/common/themes/themes.less"; @import "@/common/themes/themes.less";
.cmdstr-code { .cmdstr-code {
position: relative; position: relative;
+2 -2
View File
@@ -6,8 +6,8 @@ import { boundMethod } from "autobind-decorator";
import cn from "classnames"; import cn from "classnames";
import { If } from "tsx-control-statements/components"; import { If } from "tsx-control-statements/components";
import { ReactComponent as CheckIcon } from "../../assets/icons/line/check.svg"; import { ReactComponent as CheckIcon } from "@/assets/icons/line/check.svg";
import { ReactComponent as CopyIcon } from "../../assets/icons/history/copy.svg"; import { ReactComponent as CopyIcon } from "@/assets/icons/history/copy.svg";
import "./cmdstrcode.less"; import "./cmdstrcode.less";
+1 -1
View File
@@ -1,4 +1,4 @@
@import "../../../app/common/themes/themes.less"; @import "@/common/themes/themes.less";
.wave-dropdown { .wave-dropdown {
position: relative; position: relative;
+1 -1
View File
@@ -17,7 +17,7 @@ interface DropdownDecorationProps {
interface DropdownProps { interface DropdownProps {
label?: string; label?: string;
options: { value: string; label: string }[]; options: DropdownItem[];
value?: string; value?: string;
className?: string; className?: string;
onChange: (value: string) => void; onChange: (value: string) => void;
@@ -1,4 +1,4 @@
@import "../../../app/common/themes/themes.less"; @import "@/common/themes/themes.less";
.inline-edit { .inline-edit {
.icon { .icon {
@@ -7,12 +7,10 @@ import * as mobx from "mobx";
import { boundMethod } from "autobind-decorator"; import { boundMethod } from "autobind-decorator";
import cn from "classnames"; import cn from "classnames";
import { If } from "tsx-control-statements/components"; import { If } from "tsx-control-statements/components";
import { checkKeyPressed, adaptFromReactOrNativeKeyEvent } from "../../../util/keyutil"; import { checkKeyPressed, adaptFromReactOrNativeKeyEvent } from "@/util/keyutil";
import "./inlinesettingstextedit.less"; import "./inlinesettingstextedit.less";
type OV<V> = mobx.IObservableValue<V>;
@mobxReact.observer @mobxReact.observer
class InlineSettingsTextEdit extends React.Component< class InlineSettingsTextEdit extends React.Component<
{ {
+1 -1
View File
@@ -1,4 +1,4 @@
@import "../../../app/common/themes/themes.less"; @import "@/common/themes/themes.less";
.wave-input-decoration { .wave-input-decoration {
display: flex; display: flex;
+1 -1
View File
@@ -1,4 +1,4 @@
@import "../../../app/common/themes/themes.less"; @import "@/common/themes/themes.less";
.markdown { .markdown {
color: @term-white; color: @term-white;
+1 -1
View File
@@ -6,7 +6,7 @@ import * as mobxReact from "mobx-react";
import ReactMarkdown from "react-markdown"; import ReactMarkdown from "react-markdown";
import remarkGfm from "remark-gfm"; import remarkGfm from "remark-gfm";
import cn from "classnames"; import cn from "classnames";
import { GlobalModel } from "../../../models"; import { GlobalModel } from "@/models";
import "./markdown.less"; import "./markdown.less";
+1 -1
View File
@@ -1,4 +1,4 @@
@import "../../../app/common/themes/themes.less"; @import "@/common/themes/themes.less";
.wave-modal-container { .wave-modal-container {
position: fixed; position: fixed;
-2
View File
@@ -10,8 +10,6 @@ import { IconButton } from "./iconbutton";
import "./modal.less"; import "./modal.less";
type OV<V> = mobx.IObservableValue<V>;
interface ModalHeaderProps { interface ModalHeaderProps {
onClose?: () => void; onClose?: () => void;
title: string; title: string;
+1 -1
View File
@@ -1,4 +1,4 @@
@import "../../../app/common/themes/themes.less"; @import "@/common/themes/themes.less";
.wave-password { .wave-password {
.wave-textfield-inner-eye { .wave-textfield-inner-eye {

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