Skip to content

Commit

Permalink
Merge branch 'main' into feature/auto-hide-tab-bar
Browse files Browse the repository at this point in the history
  • Loading branch information
rritik772 authored Dec 21, 2024
2 parents 7320420 + 53a64fc commit 2af5c02
Show file tree
Hide file tree
Showing 41 changed files with 699 additions and 250 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/merge-gatekeeper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
uses: upsidr/merge-gatekeeper@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ignored: Test Onboarding, Analyze (go), Analyze (javascript-typescript), License Compliance
ignored: Test Onboarding, Analyze (go), Analyze (javascript-typescript), License Compliance, CodeRabbit
2 changes: 1 addition & 1 deletion cmd/wsh/cmd/wshcmd-shell-unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ func shellCmdInner() string {
}
}
// none found
return "bin/bash\n"
return "/bin/bash\n"
}
9 changes: 8 additions & 1 deletion docs/docs/config.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ wsh editconfig
| term:localshellopts | string[] | set to pass additional parameters to the term:localshellpath (example: `["-NoLogo"]` for PowerShell will remove the copyright notice) |
| term:copyonselect | bool | set to false to disable terminal copy-on-select |
| term:scrollback | int | size of terminal scrollback buffer, max is 10000 |
| term:theme | string | preset name of terminal theme to apply by default (default is "default-dark") |
| term:transparency | float64 | set the background transparency of terminal theme (default 0.5, 0 = not transparent, 1.0 = fully transparent) |
| editor:minimapenabled | bool | set to false to disable editor minimap |
| editor:stickyscrollenabled | bool | enables monaco editor's stickyScroll feature (pinning headers of current context, e.g. class names, method names, etc.), defaults to false |
| editor:wordwrap | bool | set to true to enable word wrapping in the editor (defaults to false) |
Expand Down Expand Up @@ -75,9 +77,11 @@ wsh editconfig
| window:autohidetabbar | bool | show and hide the tab bar automatically when the mouse moves near the top of the window
| window:nativetitlebar | bool | set to use the OS-native title bar, rather than the overlay (Windows and Linux only, requires app restart) |
| window:disablehardwareacceleration | bool | set to disable Chromium hardware acceleration to resolve graphical bugs (requires app restart) |
| window:savelastwindow | bool | when `true`, the last window that is closed is preserved and is reopened the next time the app is launched (defaults to `true`) |
| window:confirmonclose | bool | when `true`, a prompt will ask a user to confirm that they want to close a window if it has an unsaved workspace with more than one tab (defaults to `true`) |
| telemetry:enabled | bool | set to enable/disable telemetry |

For reference this is the current default configuration (v0.9.3):
For reference, this is the current default configuration (v0.10.4):

```json
{
Expand All @@ -89,6 +93,7 @@ For reference this is the current default configuration (v0.9.3):
"autoupdate:installonquit": true,
"autoupdate:intervalms": 3600000,
"conn:askbeforewshinstall": true,
"conn:wshenabled": true,
"editor:minimapenabled": true,
"web:defaulturl": "https://github.com/wavetermdev/waveterm",
"web:defaultsearch": "https://www.google.com/search?q={query}",
Expand All @@ -99,6 +104,8 @@ For reference this is the current default configuration (v0.9.3):
"window:magnifiedblocksize": 0.9,
"window:magnifiedblockblurprimarypx": 10,
"window:magnifiedblockblursecondarypx": 2,
"window:confirmclose": true,
"window:savelastwindow": true,
"telemetry:enabled": true,
"term:copyonselect": true
}
Expand Down
8 changes: 8 additions & 0 deletions docs/docs/keybindings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ replace "Cmd" with "Alt" (note that "Ctrl" is "Ctrl" on both Mac, Windows, and L
| ---------------- | ------------- |
| <Kbd k="Cmd:l"/> | Clear AI Chat |

## Terminal Keybindings

| Key | Function |
| ----------------------- | -------------- |
| <Kbd k="Ctrl:Shift:c"/> | Copy |
| <Kbd k="Ctrl:Shift:v"/> | Paste |
| <Kbd k="Cmd:k"/> | Clear Terminal |

## Customizeable Systemwide Global Hotkey

Wave allows setting a custom global hotkey to focus your most recent window from anywhere in your computer. For more information on this, see [the config docs](./config#customizable-systemwide-global-hotkey).
Expand Down
30 changes: 30 additions & 0 deletions docs/docs/releasenotes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,36 @@ sidebar_position: 200

# Release Notes

### v0.10.4 &mdash; Dec 20, 2024

Quick update with bug fixes and new configuration options

- Added "window:confirmclose" and "window:savelastwindow" configuration options
- [bugfix] Fixed broken scroll bar in the AI widget
- [bugfix] Fixed default path for wsh shell detection (used in remote connections)
- Dependency updates

### v0.10.3 &mdash; Dec 19, 2024

Quick update to v0.10 with new features and bug fixes.

- Global hotkey support [docs](https://docs.waveterm.dev/config#customizable-systemwide-global-hotkey)
- Added configuration to override the font size for markdown, AI-chat, and preview editor [docs](https://docs.waveterm.dev/config)
- Added ability to set independent zoom level for the web view (right click block header)
- New `wsh wavepath` command to open the config directory, data directory, and log file
- [bugfix] Fixed crash when /etc/sshd_config contained an unsupported Match directive (most common on Fedora)
- [bugfix] Workspaces are now more consistent across windows, closes associated window when Workspaces are deleted
- [bugfix] Fixed zsh on WSL
- [bugfix] Fixed long-standing bug around control sequences sometimes showing up in terminal output when switching tabs
- Lots of new examples in the docs for shell overrides, presets, widgets, and connections
- Other bug fixes and UI updates

(note, v0.10.2 and v0.10.3's release notes have been merged together)

### v0.10.1 &mdash; Dec 12, 2024

Quick update to fix the workspace app menu actions. Also fixes workspace switching to always open a new window when invoked from a non-workspace window. This reduces the chance of losing a non-workspace window's tabs accidentally.

### v0.10.0 &mdash; Dec 11, 2024

Wave Terminal v0.10.0 introduces workspaces, making it easier to manage multiple work environments. We've added powerful new command execution capabilities with `wsh run`, allowing you to launch and control commands in dedicated blocks. This release also brings significant improvements to SSH with a new connections configuration system for managing your remote environments.
Expand Down
6 changes: 3 additions & 3 deletions docs/src/components/kbd.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ function convertKey(platform: Platform, key: string): [any, string, boolean] {
return ["⇧", "Shift", true];
}
if (key == "Escape") {
return ["Esc", null, false];
return ["Esc", "Escape", false];
}
return [key, null, false];
return [key.length > 1 ? key : key.toUpperCase(), key, false];
}

// Custom KBD component
Expand All @@ -50,7 +50,7 @@ const KbdInternal = ({ k }: { k: string }) => {
const keyElems = keys.map((key, i) => {
const [displayKey, title, symbol] = convertKey(platform, key);
return (
<kbd key={i} title={title} className={symbol ? "symbol" : null}>
<kbd key={i} title={title} aria-label={title} className={symbol ? "symbol" : null}>
{displayKey}
</kbd>
);
Expand Down
40 changes: 20 additions & 20 deletions emain/emain-window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,21 +229,26 @@ export class WaveBrowserWindow extends BaseWindow {
e.preventDefault();
fireAndForget(async () => {
const numWindows = waveWindowMap.size;
if (numWindows > 1) {
console.log("numWindows > 1", numWindows);
const workspace = await WorkspaceService.GetWorkspace(this.workspaceId);
console.log("workspace", workspace);
if (isNonEmptyUnsavedWorkspace(workspace)) {
console.log("workspace has no name, icon, and multiple tabs", workspace);
const choice = dialog.showMessageBoxSync(this, {
type: "question",
buttons: ["Cancel", "Close Window"],
title: "Confirm",
message: "Window has unsaved tabs, closing window will delete existing tabs.\n\nContinue?",
});
if (choice === 0) {
console.log("user cancelled close window", this.waveWindowId);
return;
const fullConfig = await FileService.GetFullConfig();
if (numWindows > 1 || !fullConfig.settings["window:savelastwindow"]) {
console.log("numWindows > 1 or user does not want last window saved", numWindows);
if (fullConfig.settings["window:confirmclose"]) {
console.log("confirmclose", this.waveWindowId);
const workspace = await WorkspaceService.GetWorkspace(this.workspaceId);
console.log("workspace", workspace);
if (isNonEmptyUnsavedWorkspace(workspace)) {
console.log("workspace has no name, icon, and multiple tabs", workspace);
const choice = dialog.showMessageBoxSync(this, {
type: "question",
buttons: ["Cancel", "Close Window"],
title: "Confirm",
message:
"Window has unsaved tabs, closing window will delete existing tabs.\n\nContinue?",
});
if (choice === 0) {
console.log("user cancelled close window", this.waveWindowId);
return;
}
}
}
console.log("deleteAllowed = true", this.waveWindowId);
Expand All @@ -270,11 +275,6 @@ export class WaveBrowserWindow extends BaseWindow {
this.destroy();
return;
}
const numWindows = waveWindowMap.size;
if (numWindows == 0) {
console.log("win no windows left", this.waveWindowId);
return;
}
if (this.deleteAllowed) {
console.log("win removing window from backend DB", this.waveWindowId);
fireAndForget(() => WindowService.CloseWindow(this.waveWindowId, true));
Expand Down
4 changes: 4 additions & 0 deletions frontend/app/element/markdown.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
overflow: hidden;
}

*:last-child {
margin-bottom: 0 !important;
}

.heading:not(.heading ~ .heading) {
margin-top: 0 !important;
}
Expand Down
6 changes: 3 additions & 3 deletions frontend/app/element/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
resolveSrcSet,
transformBlocks,
} from "@/app/element/markdown-util";
import { useAtomValueSafe } from "@/util/util";
import { boundNumber, useAtomValueSafe } from "@/util/util";
import { clsx } from "clsx";
import { Atom } from "jotai";
import { OverlayScrollbarsComponent, OverlayScrollbarsComponentRef } from "overlayscrollbars-react";
Expand Down Expand Up @@ -380,10 +380,10 @@ const Markdown = ({

const mergedStyle = { ...style };
if (fontSizeOverride != null) {
mergedStyle["--markdown-font-size"] = `${fontSizeOverride}px`;
mergedStyle["--markdown-font-size"] = `${boundNumber(fontSizeOverride, 6, 64)}px`;
}
if (fixedFontSizeOverride != null) {
mergedStyle["--markdown-fixed-font-size"] = `${fixedFontSizeOverride}px`;
mergedStyle["--markdown-fixed-font-size"] = `${boundNumber(fixedFontSizeOverride, 6, 64)}px`;
}
return (
<div className={clsx("markdown", className)} style={mergedStyle}>
Expand Down
43 changes: 43 additions & 0 deletions frontend/app/element/search.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
.search-container {
display: flex;
flex-direction: row;
background-color: var(--modal-bg-color);
border: 1px solid var(--accent-color);
border-radius: var(--modal-border-radius);
box-shadow: var(--modal-box-shadow);
color: var(--main-text-color);
padding: 5px 5px 5px 10px;
gap: 5px;
width: 50%;
max-width: 300px;
min-width: 200px;

input {
flex: 1 1 auto;
border: none;
font-size: 14px;
height: 100%;
padding: 0;
border-radius: 0;
}

.search-results {
font-size: 12px;
margin: auto 0;
color: var(--secondary-text-color);

&.hidden {
display: none;
}
}

.right-buttons {
display: flex;
gap: 5px;
padding-left: 5px;
border-left: 1px solid var(--modal-border-color);
button {
font-size: 12px;
}
}
}
127 changes: 127 additions & 0 deletions frontend/app/element/search.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
// Copyright 2024, Command Line Inc.
// SPDX-License-Identifier: Apache-2.0

import type { Meta, StoryObj } from "@storybook/react";
import { useSetAtom } from "jotai";
import { useEffect } from "react";
import { Popover } from "./popover";
import { Search, useSearch } from "./search";

const meta: Meta<typeof Search> = {
title: "Elements/Search",
component: Search,
args: {},
};

export default meta;
type Story = StoryObj<typeof Popover>;

export const DefaultSearch: Story = {
render: (args) => {
const props = useSearch();
const setIsOpen = useSetAtom(props.isOpenAtom);
useEffect(() => {
setIsOpen(true);
}, []);
return (
<div
className="viewbox"
ref={props.anchorRef as React.RefObject<HTMLDivElement>}
style={{
border: "2px solid black",
width: "100%",
height: "200px",
background: "var(--main-bg-color)",
}}
>
<Search {...args} {...props} />
</div>
);
},
args: {},
};

export const Results10: Story = {
render: (args) => {
const props = useSearch();
const setIsOpen = useSetAtom(props.isOpenAtom);
const setNumResults = useSetAtom(props.numResultsAtom);
useEffect(() => {
setIsOpen(true);
setNumResults(10);
}, []);
return (
<div
className="viewbox"
ref={props.anchorRef as React.RefObject<HTMLDivElement>}
style={{
border: "2px solid black",
width: "100%",
height: "200px",
background: "var(--main-bg-color)",
}}
>
<Search {...args} {...props} />
</div>
);
},
args: {},
};

export const InputAndResults10: Story = {
render: (args) => {
const props = useSearch();
const setIsOpen = useSetAtom(props.isOpenAtom);
const setNumResults = useSetAtom(props.numResultsAtom);
const setSearch = useSetAtom(props.searchAtom);
useEffect(() => {
setIsOpen(true);
setNumResults(10);
setSearch("search term");
}, []);
return (
<div
className="viewbox"
ref={props.anchorRef as React.RefObject<HTMLDivElement>}
style={{
border: "2px solid black",
width: "100%",
height: "200px",
background: "var(--main-bg-color)",
}}
>
<Search {...args} {...props} />
</div>
);
},
args: {},
};

export const LongInputAndResults10: Story = {
render: (args) => {
const props = useSearch();
const setIsOpen = useSetAtom(props.isOpenAtom);
const setNumResults = useSetAtom(props.numResultsAtom);
const setSearch = useSetAtom(props.searchAtom);
useEffect(() => {
setIsOpen(true);
setNumResults(10);
setSearch("search term ".repeat(10).trimEnd());
}, []);
return (
<div
className="viewbox"
ref={props.anchorRef as React.RefObject<HTMLDivElement>}
style={{
border: "2px solid black",
width: "100%",
height: "200px",
background: "var(--main-bg-color)",
}}
>
<Search {...args} {...props} />
</div>
);
},
args: {},
};
Loading

0 comments on commit 2af5c02

Please sign in to comment.