From 4fccd712272cbcf1ef1715bae1cc2101abf7237a Mon Sep 17 00:00:00 2001 From: Mike Sawka Date: Tue, 10 Dec 2024 18:03:48 -0800 Subject: [PATCH] minor docs fixups (consistency) (#1480) --- cmd/packfiles/main-packfiles.go | 81 ++++++++++++++++++++++++++++++ docs/docs/config.mdx | 5 +- docs/docs/customwidgets.mdx | 2 +- docs/docs/features/_category_.json | 8 --- docs/docs/features/ai.mdx | 3 -- docs/docs/features/browser.mdx | 3 -- docs/docs/features/charts.mdx | 3 -- docs/docs/features/preview.mdx | 3 -- docs/docs/features/remotes.mdx | 3 -- frontend/app/tab/tabbar.tsx | 4 +- 10 files changed, 87 insertions(+), 28 deletions(-) create mode 100644 cmd/packfiles/main-packfiles.go delete mode 100644 docs/docs/features/_category_.json delete mode 100644 docs/docs/features/ai.mdx delete mode 100644 docs/docs/features/browser.mdx delete mode 100644 docs/docs/features/charts.mdx delete mode 100644 docs/docs/features/preview.mdx delete mode 100644 docs/docs/features/remotes.mdx diff --git a/cmd/packfiles/main-packfiles.go b/cmd/packfiles/main-packfiles.go new file mode 100644 index 000000000..771a613f0 --- /dev/null +++ b/cmd/packfiles/main-packfiles.go @@ -0,0 +1,81 @@ +package main + +import ( + "bufio" + "fmt" + "io" + "os" + "path/filepath" +) + +func main() { + // Ensure at least one argument is provided + if len(os.Args) < 2 { + fmt.Fprintln(os.Stderr, "Usage: go run main.go ...") + os.Exit(1) + } + + // Get the current working directory + cwd, err := os.Getwd() + if err != nil { + fmt.Fprintf(os.Stderr, "Error getting current working directory: %v\n", err) + os.Exit(1) + } + + for _, filePath := range os.Args[1:] { + if filePath == "" || filePath == "--" { + continue + } + // Convert file path to an absolute path + absPath, err := filepath.Abs(filePath) + if err != nil { + fmt.Fprintf(os.Stderr, "Error resolving absolute path for %q: %v\n", filePath, err) + continue + } + + finfo, err := os.Stat(absPath) + if err != nil { + fmt.Fprintf(os.Stderr, "Error getting file info for %q: %v\n", absPath, err) + continue + } + if finfo.IsDir() { + fmt.Fprintf(os.Stderr, "%q is a directory, skipping\n", absPath) + continue + } + + // Get the path relative to the current working directory + relPath, err := filepath.Rel(cwd, absPath) + if err != nil { + fmt.Fprintf(os.Stderr, "Error resolving relative path for %q: %v\n", absPath, err) + continue + } + + // Open the file + file, err := os.Open(absPath) + if err != nil { + fmt.Fprintf(os.Stderr, "Error opening file %q: %v\n", absPath, err) + continue + } + defer file.Close() + + // Print start delimiter with quoted relative path + fmt.Printf("@@@start file %q\n", relPath) + + // Copy file contents to stdout + reader := bufio.NewReader(file) + for { + line, err := reader.ReadString('\n') + fmt.Print(line) // Print each line + if err == io.EOF { + break + } + if err != nil { + fmt.Fprintf(os.Stderr, "Error reading file %q: %v\n", relPath, err) + break + } + } + + // Print end delimiter with quoted relative path + fmt.Printf("@@@end file %q\n", relPath) + } +} diff --git a/docs/docs/config.mdx b/docs/docs/config.mdx index 4815e6452..2c6f341ef 100644 --- a/docs/docs/config.mdx +++ b/docs/docs/config.mdx @@ -28,7 +28,7 @@ wsh editconfig | ai:preset | string | the default AI preset to use | | ai:baseurl | string | Set the AI Base Url (must be OpenAI compatible) | | ai:apitoken | string | your AI api token | -| ai:apitype | string | defaults to "open_ai", but can also set to "azure" (forspecial Azure AI handling) or "anthropic" | +| ai:apitype | string | defaults to "open_ai", but can also set to "azure" (forspecial Azure AI handling), "anthropic", or "perplexity" | | ai:name | string | string to display in the Wave AI block header | | ai:model | string | model name to pass to API | | ai:apiversion | string | for Azure AI only (when apitype is "azure", this will default to "2023-05-15") | @@ -44,7 +44,7 @@ wsh editconfig | term:copyonselect | bool | set to false to disable terminal copy-on-select | | term:scrollback | int | size of terminal scrollback buffer, max is 10000 | | editor:minimapenabled | bool | set to false to disable editor minimap | -| editor:stickscrollenabled | bool | | +| 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) | | web:openlinksinternally | bool | set to false to open web links in external browser | | web:defaulturl | string | default web page to open in the web widget when no url is provided (homepage) | @@ -66,6 +66,7 @@ wsh editconfig | window:magnifiedblocksize | float64 | change the size of a magnified block as a percentage of the dimensions of its parent layout (must be between 0 and 1, defaults to 0.9) | | window:magnifiedblockblurprimarypx | int | change the blur in CSS pixels that is applied directly behind a magnified block (see [backdrop-filter](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter) for more info on how this gets applied) | | window:magnifiedblockblursecondarypx | int | change the blur in CSS pixels that is applied to the visible portions of non-magnified blocks when a block is magnified (see [backdrop-filter](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter) for more info on how this gets applied) | +| window:maxtabcachesize | int | number of tabs to cache. when tabs are cached, switching between them is very fast. (defaults to 10) | | window:showmenubar | bool | set to use the OS-native menu bar (Windows and Linux only, requires app restart) | | 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) | diff --git a/docs/docs/customwidgets.mdx b/docs/docs/customwidgets.mdx index b04bd1491..ca61fdb0f 100644 --- a/docs/docs/customwidgets.mdx +++ b/docs/docs/customwidgets.mdx @@ -52,7 +52,7 @@ This `WidgetConfigType` is shared between all types of widgets. That is to say, **Font Awesome Icons** -[Font Awesome](https://fontawesome.com/search) provides a ton of useful icons that you can use as a widget icon in your app. At it's simplest, you can just provide the icon name and it will be used. For example, the string `"house"`, will provide an icon containing a house. We also allow you to apply a few different styles to your icon by modifying the name as follows: +[Font Awesome](https://fontawesome.com/search) provides a ton of useful icons that you can use as a widget icon in your app. At its simplest, you can just provide the icon name and it will be used. For example, the string `"house"`, will provide an icon containing a house. We also allow you to apply a few different styles to your icon by modifying the name as follows: | format | description | | ------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | diff --git a/docs/docs/features/_category_.json b/docs/docs/features/_category_.json deleted file mode 100644 index 1c03549e7..000000000 --- a/docs/docs/features/_category_.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "label": "Features", - "position": 2, - "link": { - "type": "generated-index", - "description": "Overview of Wave Terminal Features" - } -} diff --git a/docs/docs/features/ai.mdx b/docs/docs/features/ai.mdx deleted file mode 100644 index 97aa9aef1..000000000 --- a/docs/docs/features/ai.mdx +++ /dev/null @@ -1,3 +0,0 @@ -# Wave AI - -TODO: Add content diff --git a/docs/docs/features/browser.mdx b/docs/docs/features/browser.mdx deleted file mode 100644 index 1a2ac34a1..000000000 --- a/docs/docs/features/browser.mdx +++ /dev/null @@ -1,3 +0,0 @@ -# Inline Web Browser - -TODO: Add content diff --git a/docs/docs/features/charts.mdx b/docs/docs/features/charts.mdx deleted file mode 100644 index 49453cf0d..000000000 --- a/docs/docs/features/charts.mdx +++ /dev/null @@ -1,3 +0,0 @@ -# Data Visualization - -TODO: Add content diff --git a/docs/docs/features/preview.mdx b/docs/docs/features/preview.mdx deleted file mode 100644 index 34726de8f..000000000 --- a/docs/docs/features/preview.mdx +++ /dev/null @@ -1,3 +0,0 @@ -# Preview - -TODO: Add content diff --git a/docs/docs/features/remotes.mdx b/docs/docs/features/remotes.mdx deleted file mode 100644 index 29d5d7930..000000000 --- a/docs/docs/features/remotes.mdx +++ /dev/null @@ -1,3 +0,0 @@ -# Remote Connections - -TODO: Add content diff --git a/frontend/app/tab/tabbar.tsx b/frontend/app/tab/tabbar.tsx index 3c99660e5..d632b0fcb 100644 --- a/frontend/app/tab/tabbar.tsx +++ b/frontend/app/tab/tabbar.tsx @@ -5,7 +5,7 @@ import { Button } from "@/app/element/button"; import { modalsModel } from "@/app/store/modalmodel"; import { WindowDrag } from "@/element/windowdrag"; import { deleteLayoutModelForTab } from "@/layout/index"; -import { atoms, createTab, getApi, globalStore, PLATFORM, setActiveTab } from "@/store/global"; +import { atoms, createTab, getApi, globalStore, isDev, PLATFORM, setActiveTab } from "@/store/global"; import { fireAndForget } from "@/util/util"; import { useAtomValue } from "jotai"; import { OverlayScrollbars } from "overlayscrollbars"; @@ -637,7 +637,7 @@ const TabBar = memo(({ workspace }: TabBarProps) => { } const tabsWrapperWidth = tabIds.length * tabWidthRef.current; - const devLabel = false ? ( + const devLabel = isDev() ? (