Compare commits

..

1 Commits

Author SHA1 Message Date
Evan Simkowitz 81d4b9d3af save work 2024-03-12 14:35:25 -07:00
131 changed files with 3130 additions and 5166 deletions
+1 -2
View File
@@ -41,7 +41,6 @@ jobs:
cd scripthaus;
go get ./...;
CGO_ENABLED=1 go build -o scripthaus cmd/main.go
echo $PWD >> $GITHUB_PATH
- uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
@@ -54,7 +53,7 @@ jobs:
- name: Install Yarn Dependencies
run: yarn --frozen-lockfile
- name: Build ${{ matrix.platform }}/${{ matrix.arch }}
run: scripthaus run ${{ matrix.scripthaus }}
run: ./scripthaus/scripthaus run ${{ matrix.scripthaus }}
env:
GOARCH: ${{ matrix.arch }}
CSC_LINK: ${{ matrix.platform == 'darwin' && secrets.PROD_MACOS_CERTIFICATE}}
+1 -32
View File
@@ -47,32 +47,6 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout Scripthaus (Go only)
if: matrix.language == 'go'
uses: actions/checkout@v4
with:
repository: scripthaus-dev/scripthaus
path: scripthaus
- name: Setup Go (Go only)
uses: actions/setup-go@v5
if: matrix.language == 'go'
with:
go-version: stable
cache-dependency-path: |
wavesrv/go.sum
waveshell/go.sum
scripthaus/go.sum
- name: Install Scripthaus (Go only)
if: matrix.language == 'go'
run: |
go work use ./scripthaus;
cd scripthaus;
go get ./...;
CGO_ENABLED=1 go build -o scripthaus cmd/main.go
echo $PWD >> $GITHUB_PATH
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
@@ -87,14 +61,9 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild (not Go)
if: matrix.language != 'go'
- name: Autobuild
uses: github/codeql-action/autobuild@v3
- name: Build (Go only)
if: matrix.language == 'go'
run: scripthaus run build-backend
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
+23
View File
@@ -0,0 +1,23 @@
name: Publish a new release
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get the version
id: get_version
run: |
VERSION=$(node -e 'console.log(require("./version.js"))')
echo "WAVETERM_VERSION=${VERSION}" >> "$GITHUB_OUTPUT"
- name: Copy staged artifacts to the release bucket
run: |
. ./buildres/publish-from-staging.sh
env:
AWS_ACCESS_KEY_ID: "${{ secrets.S3_USERID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.S3_SECRETKEY }}"
AWS_DEFAULT_REGION: us-west-2
- name: Publish to Ubuntu PPA
+6
View File
@@ -53,6 +53,12 @@ Install modules (we use yarn):
yarn
```
Electron also requires specific builds of node_modules to work (because Electron embeds a specific node.js version that might not match your development node.js version). We use a special electron command to cross-compile those modules:
```
scripthaus run electron-rebuild
```
## Running WebPack
We use webpack to build both the React and Electron App Wrapper code. They are both run together using:
+1 -1
View File
@@ -20,7 +20,7 @@ Wave isn't just another terminal emulator; it's a rethink on how terminals are b
- CodeEdit, to edit local and remote files with a VSCode-like inline editor
- AI Integration with ChatGPT (or ChatGPT compatible APIs) to help write commands and get answers inline
![WaveTerm Screenshot](./assets/wave-screenshot.png)
![WaveTerm Screenshot](./assets/wave-screenshot.jpeg)
## Installation
@@ -1,12 +1,7 @@
[
{
"command": "system:toggleDeveloperTools",
"keys": ["Cmd:Option:i"],
"info": "Opens the chrome developer tool menu"
},
{
"command": "system:hideWindow",
"keys": ["Cmd:m"]
"keys": ["Cmd:Option:i"]
},
{
"command": "generic:cancel",
@@ -16,62 +11,10 @@
"command": "generic:confirm",
"keys": ["Enter"]
},
{
"command": "generic:expandTextInput",
"keys": ["Shift:Enter", "Ctrl:Enter"]
},
{
"command": "generic:deleteItem",
"keys": ["Backspace", "Delete"]
},
{
"command": "generic:space",
"keys": ["Space"]
},
{
"command": "generic:tab",
"keys": ["Tab"]
},
{
"command": "generic:numpad-0",
"keys": ["0"]
},
{
"command": "generic:numpad-1",
"keys": ["1"]
},
{
"command": "generic:numpad-2",
"keys": ["2"]
},
{
"command": "generic:numpad-3",
"keys": ["3"]
},
{
"command": "generic:numpad-4",
"keys": ["4"]
},
{
"command": "generic:numpad-5",
"keys": ["5"]
},
{
"command": "generic:numpad-6",
"keys": ["6"]
},
{
"command": "generic:numpad-7",
"keys": ["7"]
},
{
"command": "generic:numpad-8",
"keys": ["8"]
},
{
"command": "generic:numpad-9",
"keys": ["9"]
},
{
"command": "generic:selectAbove",
"keys": ["ArrowUp"]
@@ -80,14 +23,6 @@
"command": "generic:selectBelow",
"keys": ["ArrowDown"]
},
{
"command": "generic:selectLeft",
"keys": ["ArrowLeft"]
},
{
"command": "generic:selectRight",
"keys": ["ArrowRight"]
},
{
"command": "generic:selectPageAbove",
"keys": ["PageUp"]
@@ -97,23 +32,13 @@
"keys": ["PageDown"]
},
{
"command": "app:openHistoryView",
"command": "app:openHistory",
"keys": ["Cmd:h"]
},
{
"command": "app:openTabSearchModal",
"keys": ["Cmd:p"]
},
{
"command": "app:openConnectionsView",
"keys": [],
"commandStr": "/mainview connections"
},
{
"command": "app:openSettingsView",
"keys": [],
"commandStr": "/mainview clientsettings"
},
{
"command": "app:newTab",
"keys": ["Cmd:t"]
@@ -128,8 +53,7 @@
},
{
"command": "app:restartCommand",
"keys": ["Cmd:r"],
"info": "Restarts the command running in the current selected line"
"keys": ["Cmd:r"]
},
{
"command": "app:restartLastCommand",
@@ -149,48 +73,39 @@
},
{
"command": "app:selectTab-1",
"keys": ["Cmd:1"],
"commandStr":"/screen 1"
"keys": ["Cmd:1"]
},
{
"command": "app:selectTab-2",
"keys": ["Cmd:2"],
"commandStr":"/screen 2"
"keys": ["Cmd:2"]
},
{
"command": "app:selectTab-3",
"keys": ["Cmd:3"],
"commandStr":"/screen 3"
"keys": ["Cmd:3"]
},
{
"command": "app:selectTab-4",
"keys": ["Cmd:4"],
"commandStr":"/screen 4"
"keys": ["Cmd:4"]
},
{
"command": "app:selectTab-5",
"keys": ["Cmd:5"],
"commandStr":"/screen 5"
"keys": ["Cmd:5"]
},
{
"command": "app:selectTab-6",
"keys": ["Cmd:6"],
"commandStr":"/screen 6"
"keys": ["Cmd:6"]
},
{
"command": "app:selectTab-7",
"keys": ["Cmd:7"],
"commandStr":"/screen 7"
"keys": ["Cmd:7"]
},
{
"command": "app:selectTab-8",
"keys": ["Cmd:8"],
"commandStr":"/screen 8"
"keys": ["Cmd:8"]
},
{
"command": "app:selectTab-9",
"keys": ["Cmd:9"],
"commandStr":"/screen 9"
"keys": ["Cmd:9"]
},
{
"command": "app:selectTabLeft",
@@ -202,48 +117,39 @@
},
{
"command": "app:selectWorkspace-1",
"keys": ["Cmd:Ctrl:1"],
"commandStr": "/session 1"
"keys": ["Cmd:Ctrl:1"]
},
{
"command": "app:selectWorkspace-2",
"keys": ["Cmd:Ctrl:2"],
"commandStr": "/session 2"
"keys": ["Cmd:Ctrl:2"]
},
{
"command": "app:selectWorkspace-3",
"keys": ["Cmd:Ctrl:3"],
"commandStr": "/session 3"
"keys": ["Cmd:Ctrl:3"]
},
{
"command": "app:selectWorkspace-4",
"keys": ["Cmd:Ctrl:4"],
"commandStr": "/session 4"
"keys": ["Cmd:Ctrl:4"]
},
{
"command": "app:selectWorkspace-5",
"keys": ["Cmd:Ctrl:5"],
"commandStr": "/session 5"
"keys": ["Cmd:Ctrl:5"]
},
{
"command": "app:selectWorkspace-6",
"keys": ["Cmd:Ctrl:6"],
"commandStr": "/session 6"
"keys": ["Cmd:Ctrl:6"]
},
{
"command": "app:selectWorkspace-7",
"keys": ["Cmd:Ctrl:7"],
"commandStr": "/session 7"
"keys": ["Cmd:Ctrl:7"]
},
{
"command": "app:selectWorkspace-8",
"keys": ["Cmd:Ctrl:8"],
"commandStr": "/session 8"
"keys": ["Cmd:Ctrl:8"]
},
{
"command": "app:selectWorkspace-9",
"keys": ["Cmd:Ctrl:9"],
"commandStr": "/session 9"
"keys": ["Cmd:Ctrl:9"]
},
{
"command": "app:toggleSidebar",
@@ -254,9 +160,8 @@
"keys": ["Cmd:d"]
},
{
"command": "app:openBookmarksView",
"keys": ["Cmd:b"],
"commandStr": "/bookmarks:show"
"command": "app:bookmarkActiveLine",
"keys": ["Cmd:b"]
},
{
"command": "bookmarks:edit",
@@ -300,8 +205,7 @@
},
{
"command": "cmdinput:openHistory",
"keys": ["Ctrl:r"],
"commandStr": "/history"
"keys": ["Ctrl:r"]
},
{
"command": "cmdinput:openAIChat",
Binary file not shown.

After

Width:  |  Height:  |  Size: 306 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 KiB

+1 -1
View File
@@ -6,7 +6,7 @@
},
"productName": "Wave",
"description": "An Open-Source, AI-Native, Terminal Built for Seamless Workflows",
"version": "0.7.1",
"version": "0.7.0",
"main": "dist/emain.js",
"license": "Apache-2.0",
"repository": {
Binary file not shown.
Binary file not shown.
+56 -20
View File
@@ -7,6 +7,16 @@
:root {
--fa-style-family: "Font Awesome 6 Sharp";
/* these variables are overridden by user settings */
/*
--termfontfamily: "Hack";
--termfontsize: 13px;
--termlineheight: 15px;
--termpad: 7px;
--termfontsize-sm: 11px;
--termlineheight-sm: 13px;
*/
/* base fonts */
--base-font: normal 15px / normal "Lato", sans-serif;
@@ -34,18 +44,16 @@
--floating-logo-width: 40px;
--floating-logo-height: var(--screentabs-height);
/* right sidebar triggers */
--floating-right-sidebar-triggers-width-darwin: 50px;
--floating-right-sidebar-triggers-width: 40px;
/* global colors */
--app-bg-color: black;
--app-accent-color: rgb(88, 193, 66);
--app-accent-bg-color: rgba(88, 193, 66, 0.25);
--app-accent-bg-color: rgba(88, 193, 66, 0.2);
--app-error-color: rgb(229, 77, 46);
--app-warning-color: rgb(224, 185, 86);
--app-success-color: rgb(78, 154, 6);
--app-text-color: rgb(211, 215, 207);
--app-text-primary-color: rgb(255, 255, 255);
--app-text-secondary-color: rgb(195, 200, 194);
--app-text-disabled-color: rgb(173, 173, 173);
--app-border-color: rgb(51, 51, 51);
--app-maincontent-bg-color: #333;
--app-panel-bg-color: rgba(21, 23, 21, 1);
@@ -54,16 +62,16 @@
--app-icon-hover-color: #fff;
--app-selected-mask-color: rgba(255, 255, 255, 0.06);
/* global status colors */
--app-error-color: rgb(229, 77, 46);
--app-warning-color: rgb(224, 185, 86);
--app-success-color: rgb(78, 154, 6);
--app-idle-color: var(--app-text-secondary-color);
/* icon colors */
/* just for macos */
--app-border-radius-darwin: 10px;
/* global generic colors */
--app-black: rgb(0, 0, 0);
/* scrollbar colors */
/* --scrollbar-background-color: rgba(21, 23, 21, 1); */
--scrollbar-background-color: var(--app-bg-color);
--scrollbar-thumb-color: rgba(255, 255, 255, 0.3);
--scrollbar-thumb-hover-color: rgba(255, 255, 255, 0.5);
@@ -104,9 +112,28 @@
--markdown-bg-color: rgb(35, 35, 35);
--markdown-outline-color: var(--form-element-primary-color);
/* status(remote) colors */
/* todo: all status colors must be unified */
--status-connected-color: var(--app-success-color);
--status-connecting-color: var(--app-warning-color);
--status-error-color: var(--app-error-color);
--status-disconnected-color: var(--app-text-secondary-color);
/* status indicator colors */
/* todo: all status colors must be unified */
--status-indicator-color: var(--app-text-color);
--status-indicator-error: var(--status-error-color);
--status-indicator-success: var(--status-connected-color);
/* status(version) colors */
/* todo: all status colors must be unified */
--status-outdated-color: var(--status-connecting-color);
--status-updated-color: var(--status-connected-color);
/* term status colors */
--term-error-color: var(--app-error-color);
--term-warning-color: var(--app-warning-color);
/* todo: all status colors must be unified */
--term-error-color: var(--status-error-color);
--term-warning-color: var(--status-connecting-color);
/* hotkey colors */
--hotkey-text-color: var(--app-text-secondary-color);
@@ -125,6 +152,7 @@
--line-text-color: rgb(211, 215, 207);
--line-svg-fill-color: rgb(150, 152, 150);
--line-svg-hover-fill-color: #eceeec;
--line-selected-border-color: rgb(193, 195, 193);
--line-separator-color: rgb(126, 126, 126);
--line-error-color: var(--app-error-color);
--line-warning-color: var(--app-warning-color);
@@ -147,6 +175,17 @@
--line-actions-active-color: rgba(255, 255, 255, 1);
--line-actions-bg-color: rgba(255, 255, 255, 0.15);
/* view colors */
/* todo: bookmarks is a view, colors must be unified with --view* colors */
--bookmarks-text-color: rgb(211, 215, 207);
--bookmarks-textarea-bg-color: rgb(0, 0, 0);
--bookmarks-disabled-text-color: rgb(173, 173, 173);
--bookmarks-control-hover-color: rgb(255, 255, 255);
/* view colors */
--view-error-color: var(--app-error-color);
--view-text-color: var(--app-text-color);
/* table colors */
--table-border-color: rgba(241, 246, 243, 0.15);
--table-thead-border-top-color: rgba(250, 250, 250, 0.1);
@@ -157,6 +196,9 @@
--table-tr-selected-bg-color: #222;
--table-tr-selected-hover-bg-color: #333;
/* session colors */
--session-bg-color: rgba(13, 13, 13, 0.85);
/* cmdinput colors */
--cmdinput-textarea-bg-color: #171717;
--cmdinput-text-error-color: var(--term-red);
@@ -177,13 +219,7 @@
--modal-bg-color: var(--app-bg-color);
--modal-header-bottom-border-color: rgba(241, 246, 243, 0.15);
--logo-button-hover-bg-color: var(--app-accent-bg-color);
--logo-button-hover-bg-color: #1e1e1e;
--xterm-viewport-border-color: rgba(241, 246, 243, 0.15);
--datepicker-cell-hover-bg-color: rgba(255, 255, 255, 0.06);
--datepicker-cell-other-text-color: rgba(255, 255, 255, 0.3);
--datepicker-header-fade-color: rgba(255, 255, 255, 0.4);
--datepicker-year-header-bg-color: rgba(255, 255, 255, 0.2); /* Light grey background */
--datepicker-year-header-border-color: rgba(241, 246, 243, 0.15); /* Light grey border */
}
+6 -10
View File
@@ -23,13 +23,15 @@
/* tab color */
--tab-white: rgb(0, 0, 0, 0.6);
--tab-mint: rgb(70, 235, 156);
/* button colors */
--button-text-color: rgb(50, 50, 50); /* Dark gray for light theme */
--button-primary-color: #fefefe;
--button-secondary-bg-color: rgba(200, 200, 200, 0.3); /* Semi-transparent light gray */
/* view colors */
--view-text-color: var(--app-text-color);
/* table colors */
--table-thead-border-top-color: rgba(0, 0, 0, 0.2);
--table-thead-border-bottom-color: rgba(0, 0, 0, 0.3);
@@ -68,16 +70,10 @@
--line-actions-inactive-color: rgba(0, 0, 0, 0.3);
--line-actions-active-color: rgba(0, 0, 0, 1);
/* toggle colors */
--toggle-thumb-color: var(--app-bg-color);
--logo-button-hover-bg-color: #f0f0f0;
--xterm-viewport-border-color: rgba(0, 0, 0, 0.3);
--datepicker-cell-hover-bg-color: #f0f0f0;
--datepicker-cell-other-text-color: rgba(0, 0, 0, 0.3);
--datepicker-header-fade-color: rgba(0, 0, 0, 0.4);
--datepicker-year-header-bg-color: #f5f5f5;
--datepicker-year-header-border-color: #dcdcdc;
/* toggle colors */
--toggle-thumb-color: var(--app-bg-color);
}
+1 -3
View File
@@ -3,7 +3,7 @@
:root {
/*
* term colors (16 + 6) form the base terminal theme
* term colors (16 + 2) form the base terminal theme
* for consistency these colors should be used by plugins/applications
*/
--term-black: #000000;
@@ -27,6 +27,4 @@
--term-cmdtext: #ffffff;
--term-foreground: #d3d7cf;
--term-background: #000000;
--term-selection-background: #ffffff60;
--term-cursor-accent: #000000;
}
-2
View File
@@ -6,6 +6,4 @@
--term-foreground: #000000;
--term-background: #fefefe;
--term-cmdtext: #000000;
--term-selection-background: #00000040;
--term-cursor-accent: #000000;
}
+4 -27
View File
@@ -101,7 +101,6 @@ body input.input {
font-size: 10px;
font-weight: 300;
line-height: 14px;
user-select: none;
}
.text-s1.icon {
@@ -303,25 +302,6 @@ a.a-block {
}
}
.right-sidebar-triggers {
position: absolute;
z-index: 25;
right: 0px;
display: flex;
flex-direction: row;
align-items: center;
pointer-events: none;
height: 38px;
padding: 0 5px;
.right-sidebar-trigger {
cursor: pointer;
user-select: none;
-webkit-app-region: no-drag;
pointer-events: all;
}
}
.copied-indicator {
position: absolute;
top: 0;
@@ -736,28 +716,28 @@ a.a-block {
.status-icon.status-connected {
path,
circle {
fill: var(--app-success-color);
fill: var(--status-connected-color);
}
}
.status-icon.status-connecting {
path,
circle {
fill: var(--app-warning-color);
fill: var(--status-connecting-color);
}
}
.status-icon.status-disconnected {
path,
circle {
fill: var(--app-idle-color);
fill: var(--status-disconnected-color);
}
}
.status-icon.status-error {
path,
circle {
fill: var(--app-error-color);
fill: var(--status-error-color);
}
}
@@ -820,7 +800,6 @@ a.a-block {
display: flex;
flex-direction: row;
align-items: center;
user-select: none;
.info-message {
margin-left: 5px;
}
@@ -869,7 +848,6 @@ a.a-block {
padding-left: 10px;
padding-right: 10px;
font-weight: bold;
user-select: none;
}
.tab-color-icon,
@@ -883,7 +861,6 @@ a.a-block {
display: inline-block;
margin-left: 1em;
min-width: 70px;
user-select: none;
}
.tab-color-select,
+11 -35
View File
@@ -16,12 +16,10 @@ import { BookmarksView } from "./bookmarks/bookmarks";
import { HistoryView } from "./history/history";
import { ConnectionsView } from "./connections/connections";
import { ClientSettingsView } from "./clientsettings/clientsettings";
import { MainSideBar } from "./sidebar/main";
import { RightSideBar } from "./sidebar/right";
import { DisconnectedModal, ClientStopModal } from "@/modals";
import { ModalsProvider } from "@/modals/provider";
import { Button } from "@/elements";
import { ErrorBoundary } from "@/common/error/errorboundary";
import { MainSideBar } from "./sidebar/sidebar";
import { DisconnectedModal, ClientStopModal } from "./common/modals";
import { ModalsProvider } from "./common/modals/provider";
import { ErrorBoundary } from "./common/error/errorboundary";
import cn from "classnames";
import "./app.less";
@@ -67,17 +65,9 @@ class App extends React.Component<{}, {}> {
}
@boundMethod
openMainSidebar() {
const mainSidebarModel = GlobalModel.mainSidebarModel;
const width = mainSidebarModel.getWidth(true);
mainSidebarModel.saveState(width, false);
}
@boundMethod
openRightSidebar() {
const rightSidebarModel = GlobalModel.rightSidebarModel;
const width = rightSidebarModel.getWidth(true);
rightSidebarModel.saveState(width, false);
openSidebar() {
const width = GlobalModel.mainSidebarModel.getWidth(true);
GlobalCommandRunner.clientSetSidebar(width, false);
}
render() {
@@ -120,36 +110,23 @@ class App extends React.Component<{}, {}> {
}
// used to force a full reload of the application
const renderVersion = GlobalModel.renderVersion.get();
const mainSidebarCollapsed = GlobalModel.mainSidebarModel.getCollapsed();
const rightSidebarCollapsed = GlobalModel.rightSidebarModel.getCollapsed();
const activeMainView = GlobalModel.activeMainView.get();
const sidebarCollapsed = GlobalModel.mainSidebarModel.getCollapsed();
const lightDarkClass = GlobalModel.isThemeDark() ? "is-dark" : "is-light";
return (
<div
key={"version-" + renderVersion}
id="main"
className={cn(
"platform-" + platform,
{ "mainsidebar-collapsed": mainSidebarCollapsed, "rightsidebar-collapsed": rightSidebarCollapsed },
lightDarkClass
)}
className={cn("platform-" + platform, { "sidebar-collapsed": sidebarCollapsed }, lightDarkClass)}
onContextMenu={this.handleContextMenu}
>
<If condition={mainSidebarCollapsed}>
<If condition={sidebarCollapsed}>
<div key="logo-button" className="logo-button-container">
<div className="logo-button-spacer" />
<div className="logo-button" onClick={this.openMainSidebar}>
<div className="logo-button" onClick={this.openSidebar}>
<img src="public/logos/wave-logo.png" alt="logo" />
</div>
</div>
</If>
<If condition={GlobalModel.isDev && rightSidebarCollapsed && activeMainView == "session"}>
<div className="right-sidebar-triggers">
<Button className="secondary ghost right-sidebar-trigger" onClick={this.openRightSidebar}>
<i className="fa-sharp fa-regular fa-lightbulb"></i>
</Button>
</div>
</If>
<div ref={this.mainContentRef} className="main-content">
<MainSideBar parentRef={this.mainContentRef} clientData={clientData} />
<ErrorBoundary>
@@ -160,7 +137,6 @@ class App extends React.Component<{}, {}> {
<ConnectionsView model={remotesModel} />
<ClientSettingsView model={remotesModel} />
</ErrorBoundary>
<RightSideBar parentRef={this.mainContentRef} clientData={clientData} />
</div>
<ModalsProvider />
</div>
+11 -7
View File
@@ -6,11 +6,11 @@
}
.bookmarks-list {
color: var(--app-text-color);
color: var(--bookmarks-text-color);
margin: 4px 10px 5px 5px;
.no-bookmarks {
color: var(--app-text-color);
color: var(--bookmarks-text-color);
padding: 30px 10px 35px 10px;
border-bottom: 1px solid white;
}
@@ -46,21 +46,21 @@
}
label {
color: var(--app-text-color);
color: var(--bookmarks-text-color);
margin-bottom: 4px;
}
textarea {
width: 80%;
min-width: 50%;
color: var(--app-text-color);
background-color: var(--form-element-bg-color);
color: var(--bookmarks-text-color);
background-color: var(--bookmarks-textarea-bg-color);
}
.bookmark-id-div {
display: none;
position: absolute;
color: var(--app-text-disabled-color);
color: var(--bookmarks-disabled-text-color);
right: 5px;
bottom: 2px;
font-size: 0.8em;
@@ -75,7 +75,7 @@
flex-direction: row;
visibility: hidden;
color: var(--app-text-color);
color: var(--bookmarks-text-color);
.bookmark-control:first-child {
margin-left: 0;
@@ -85,6 +85,10 @@
margin-left: 10px;
cursor: pointer;
padding: 2px;
&:hover {
color: var(--bookmarks-control-hover-color);
}
}
}
+1 -57
View File
@@ -22,59 +22,6 @@ type BookmarkProps = {
bookmark: BookmarkType;
};
class BookmarkKeybindings extends React.Component<{}, {}> {
@boundMethod
componentDidMount(): void {
let keybindManager = GlobalModel.keybindManager;
let bookmarksModel = GlobalModel.bookmarksModel;
keybindManager.registerKeybinding("mainview", "bookmarks", "generic:cancel", (waveEvent) => {
bookmarksModel.handleUserClose();
return true;
});
keybindManager.registerKeybinding("mainview", "bookmarks", "generic:deleteItem", (waveEvent) => {
bookmarksModel.handleUserDelete();
return true;
});
keybindManager.registerKeybinding("mainview", "bookmarks", "generic:selectAbove", (waveEvent) => {
bookmarksModel.handleUserNavigate(-1);
return true;
});
keybindManager.registerKeybinding("mainview", "bookmarks", "generic:selectBelow", (waveEvent) => {
bookmarksModel.handleUserNavigate(1);
return true;
});
keybindManager.registerKeybinding("mainview", "bookmarks", "generic:selectPageAbove", (waveEvent) => {
bookmarksModel.handleUserNavigate(-10);
return true;
});
keybindManager.registerKeybinding("mainview", "bookmarks", "generic:selectPageBelow", (waveEvent) => {
bookmarksModel.handleUserNavigate(10);
return true;
});
keybindManager.registerKeybinding("mainview", "bookmarks", "generic:confirm", (waveEvent) => {
bookmarksModel.handleUserConfirm();
return true;
});
keybindManager.registerKeybinding("mainview", "bookmarks", "bookmarks:edit", (waveEvent) => {
bookmarksModel.handleUserEdit();
return true;
});
keybindManager.registerKeybinding("mainview", "bookmarks", "bookmarks:copy", (waveEvent) => {
bookmarksModel.handleUserCopy();
return true;
});
}
@boundMethod
componentWillUnmount() {
GlobalModel.keybindManager.unregisterDomain("bookmarks");
}
render() {
return null;
}
}
@mobxReact.observer
class Bookmark extends React.Component<BookmarkProps, {}> {
@boundMethod
@@ -246,10 +193,7 @@ class BookmarksView extends React.Component<{}, {}> {
let bookmarks = GlobalModel.bookmarksModel.bookmarks;
let bookmark: BookmarkType = null;
return (
<MainView className="bookmarks-view" title="Bookmarks" onClose={this.handleClose}>
<If condition={!isHidden}>
<BookmarkKeybindings></BookmarkKeybindings>
</If>
<MainView viewName="bookmarks" title="Bookmarks" onClose={this.handleClose}>
<div className="bookmarks-list">
<For index="idx" each="bookmark" of={bookmarks}>
<Bookmark key={bookmark.bookmarkid} bookmark={bookmark} />
+3 -46
View File
@@ -5,7 +5,6 @@ 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 { GlobalModel, GlobalCommandRunner, RemotesModel, getApi } from "@/models";
import { Toggle, InlineSettingsTextEdit, SettingsError, Dropdown } from "@/common/elements";
import { commandRtnHandler, isBlank } from "@/util/util";
@@ -14,25 +13,6 @@ import * as appconst from "@/app/appconst";
import "./clientsettings.less";
import { MainView } from "../common/elements/mainview";
class ClientSettingsKeybindings extends React.Component<{}, {}> {
componentDidMount() {
let clientSettingsViewModel = GlobalModel.clientSettingsViewModel;
let keybindManager = GlobalModel.keybindManager;
keybindManager.registerKeybinding("mainview", "clientsettings", "generic:cancel", (waveEvent) => {
clientSettingsViewModel.closeView();
return true;
});
}
componentWillUnmount() {
GlobalModel.keybindManager.unregisterDomain("clientsettings");
}
render() {
return null;
}
}
@mobxReact.observer
class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hoveredItemId: string }> {
errorMessage: OV<string> = mobx.observable.box(null, { name: "ClientSettings-errorMessage" });
@@ -107,7 +87,6 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
const availableFontFamilies: DropdownItem[] = [];
availableFontFamilies.push({ label: "JetBrains Mono", value: "JetBrains Mono" });
availableFontFamilies.push({ label: "Hack", value: "Hack" });
availableFontFamilies.push({ label: "Fira Code", value: "Fira Code" });
return availableFontFamilies;
}
@@ -136,12 +115,6 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
commandRtnHandler(prtn, this.errorMessage);
}
@boundMethod
inlineUpdateOpenAIBaseURL(newBaseURL: string): void {
const prtn = GlobalCommandRunner.setClientOpenAISettings({ baseurl: newBaseURL });
commandRtnHandler(prtn, this.errorMessage);
}
@boundMethod
setErrorMessage(msg: string): void {
mobx.action(() => {
@@ -194,9 +167,6 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
return (
<MainView className="clientsettings-view" title="Client Settings" onClose={this.handleClose}>
<If condition={!isHidden}>
<ClientSettingsKeybindings></ClientSettingsKeybindings>
</If>
<div className="content">
<div className="settings-field">
<div className="settings-label">Term Font Size</div>
@@ -261,7 +231,7 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
</div>
</div>
<div className="settings-field">
<div className="settings-label">AI Token</div>
<div className="settings-label">OpenAI Token</div>
<div className="settings-input">
<InlineSettingsTextEdit
placeholder=""
@@ -274,20 +244,7 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
</div>
</div>
<div className="settings-field">
<div className="settings-label">AI Base URL</div>
<div className="settings-input">
<InlineSettingsTextEdit
placeholder=""
text={isBlank(openAIOpts.baseurl) ? "openai default" : openAIOpts.baseurl}
value={openAIOpts.baseurl ?? ""}
onChange={this.inlineUpdateOpenAIBaseURL}
maxLength={10}
showIcon={true}
/>
</div>
</div>
<div className="settings-field">
<div className="settings-label">AI Model</div>
<div className="settings-label">OpenAI Model</div>
<div className="settings-input">
<InlineSettingsTextEdit
placeholder="gpt-3.5-turbo"
@@ -300,7 +257,7 @@ class ClientSettingsView extends React.Component<{ model: RemotesModel }, { hove
</div>
</div>
<div className="settings-field">
<div className="settings-label">AI MaxTokens</div>
<div className="settings-label">OpenAI MaxTokens</div>
<div className="settings-input">
<InlineSettingsTextEdit
placeholder=""

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