Update editor, workspace, Git services, appearance, and project guides

This commit is contained in:
Knotty Wyvern
2026-10-11 09:41:16 -07:00
parent a8b1defb9d
commit 909894b9c8
153 changed files with 7967 additions and 775 deletions
+43 -28
View File
@@ -1,20 +1,22 @@
<script lang="ts">
import PluginManager from "$lib/plugins/PluginManager.svelte";
import AppearanceSettings from "$lib/theme/AppearanceSettings.svelte";
import BrowserSlot from "$lib/plugins/BrowserSlot.svelte";
import PluginSettings from "$lib/plugins/PluginSettings.svelte";
import { installedPlugins, pluginTools } from "$lib/plugins/external";
import { pluginHost } from "$lib/plugins/registry";
import { onMount, untrack } from "svelte";
import { onMount, untrack, type Snippet } from "svelte";
import Icon from "$lib/ui/Icon.svelte";
import IconButton, { type IconName } from "$lib/ui/IconButton.svelte";
import { DEFAULT_SETTINGS, MIN_AUTOSAVE_SECONDS, MAX_AUTOSAVE_SECONDS, validAutosaveSeconds, type AppSettings } from "$lib/workspace/settings";
import { version, license } from "../../../package.json";
let { settings, help = false, standalone = false, windowError = "", onSave, onClose }: {
let { settings, help = false, standalone = false, windowError = "", windowControls, onSave, onClose }: {
settings: AppSettings;
help?: boolean;
standalone?: boolean;
windowError?: string;
windowControls?: Snippet;
onSave: (value: AppSettings) => void;
onClose: () => void;
} = $props();
@@ -22,6 +24,7 @@
const sections: { id: Section; label: string; icon: IconName; keywords: string }[] = [
{ id: "about", label: "Help and about", icon: "help", keywords: "help about version shortcuts keyboard guide" },
{ id: "general", label: "General", icon: "settings", keywords: "auto-save autosave save interval seconds files" },
{ id: "appearance", label: "Appearance", icon: "sun", keywords: "theme colors light dark GPT Claude Terminal Sakura" },
{ id: "plugins", label: "Plug-ins", icon: "puzzle", keywords: "plugins extensions community" },
];
let section = $state<Section>(untrack(() => help ? "about" : "general"));
@@ -76,9 +79,13 @@
</script>
<dialog bind:this={dialog} class:help class:standalone aria-labelledby="settings-title" onkeydown={trapFocus} oncancel={event => { if (event.target === dialog) { event.preventDefault(); onClose(); } }}>
<header>
<h1 id="settings-title">{help ? "Help and about" : "Settings"}</h1>
<IconButton icon="close" label={help ? "Close help" : "Close settings"} onclick={onClose} />
<header class:window-header={!!windowControls} data-tauri-drag-region={windowControls ? true : undefined}>
<h1 id="settings-title" data-tauri-drag-region={windowControls ? true : undefined}>{help ? "Help and about" : "Settings"}</h1>
{#if windowControls}
{@render windowControls()}
{:else}
<IconButton icon="close" label={help ? "Close help" : "Close settings"} onclick={onClose} />
{/if}
</header>
<div class="body">
{#if !help}
@@ -104,6 +111,10 @@
<p class="intro">Choose how RuneStone saves your work.</p>
<h3>Files</h3>
<div class="card">
<div class="setting-row">
<div><label for="show-internal-folder">Show .runestone folder</label><p id="internal-folder-description">Show workspace settings and plugin data in the file tree.</p></div>
<input id="show-internal-folder" class="switch" type="checkbox" role="switch" aria-describedby="internal-folder-description" checked={settings.showInternalFolder} onchange={event => apply({ ...settings, showInternalFolder: event.currentTarget.checked })} />
</div>
<div class="setting-row">
<div><label for="autosave-enabled">Auto-save</label><p id="autosave-description">Save changed notes and scripts, including background tabs.</p></div>
<input id="autosave-enabled" class="switch" type="checkbox" role="switch" aria-describedby="autosave-description" checked={settings.autosaveEnabled} onchange={event => { apply({ ...settings, autosaveEnabled: event.currentTarget.checked }); event.currentTarget.checked = settings.autosaveEnabled; }} />
@@ -117,6 +128,8 @@
<div class="section-footer"><button class="text-button" onclick={() => { seconds = DEFAULT_SETTINGS.autosaveSeconds; apply({ ...DEFAULT_SETTINGS }); }}>Restore defaults</button><span>Default: every 5 seconds</span></div>
{#if error}<p class="error" role="alert">{error}</p>{/if}
<p class="saved" role="status">{message}</p>
{:else if selected.id === "appearance"}
<AppearanceSettings />
{:else if selected.id === "plugins"}
<PluginManager />
{:else if selected.id === "browser"}
@@ -141,40 +154,42 @@
dialog::backdrop { background: #0008; }
dialog.standalone { width: 100vw; height: 100dvh; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
dialog.help { width: min(650px, calc(100vw - 32px)); }
header { height: 48px; padding: 0 14px 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--rs-border); background: var(--rs-bg-elevated); }
h1 { font-size: 14px; font-weight: 600; margin: 0; }
.body { display: flex; height: calc(100% - 48px); }
aside { width: 220px; flex-shrink: 0; padding: 18px 12px; background: var(--rs-bg-elevated); border-right: 1px solid var(--rs-border); display: flex; flex-direction: column; overflow: auto; }
.search { display: flex; gap: 7px; align-items: center; background: var(--rs-bg-active); border: 1px solid var(--rs-border); border-radius: var(--rs-control-radius); padding: 8px; color: var(--rs-text-dim); }
header { height: var(--rs-titlebar-height); padding: 0 4px 0 12px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--rs-border); background: var(--rs-bg-elevated); }
header.window-header { padding-right: 0; user-select: none; }
h1 { font-size: 13px; font-weight: 600; margin: 0; }
.body { display: flex; height: calc(100% - var(--rs-titlebar-height)); min-height: 0; }
aside { width: 220px; flex-shrink: 0; padding: 12px 8px; background: var(--rs-bg-elevated); border-right: 1px solid var(--rs-border); display: flex; flex-direction: column; overflow: auto; }
.search { display: flex; gap: var(--rs-settings-gap); align-items: center; min-height: var(--rs-settings-control-height); background: var(--rs-bg-active); border: 1px solid var(--rs-border); border-radius: var(--rs-control-radius); padding: 4px 8px; color: var(--rs-text-dim); }
.search:focus-within { outline: 2px solid var(--rs-accent); }
.search input { width: 100%; min-width: 0; border: 0; padding: 0; outline: none; background: transparent; color: var(--rs-text); }
.nav-heading { margin: 24px 10px 8px; font-size: 11px; color: var(--rs-text-dim); }
nav { display: flex; flex-direction: column; gap: 4px; }
nav button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; border-radius: var(--rs-control-radius); background: transparent; text-align: left; }
.nav-heading { margin: 16px 8px 6px; font-size: 11px; color: var(--rs-text-dim); }
nav { display: flex; flex-direction: column; gap: 2px; }
nav button { display: flex; align-items: center; gap: var(--rs-settings-gap); width: 100%; min-height: var(--rs-settings-control-height); padding: 5px 8px; border: 0; border-radius: var(--rs-control-radius); background: transparent; text-align: left; }
nav button:hover { background: var(--rs-bg-active); }
nav button.active { background: var(--rs-item-selection-bg); box-shadow: inset 0 0 0 var(--rs-item-selection-width) var(--rs-item-selection-border); border-radius: var(--rs-item-selection-radius); }
.scope { margin: auto 10px 0; padding-top: 24px; color: var(--rs-text-dim); font-size: 12px; }
.content { padding: 30px 32px; flex: 1; min-width: 0; overflow-y: auto; }
h2 { margin: 0; font-size: 23px; font-weight: 600; color: var(--rs-text-strong); }
h3 { margin: 28px 0 12px; font-size: 14px; font-weight: 600; }
p { color: var(--rs-text-dim); line-height: 1.6; }
.intro { margin: 7px 0 24px; }
.card { padding: 0 20px; background: var(--rs-bg-elevated); border: 1px solid var(--rs-border); border-radius: 10px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 0; }
.content { padding: 20px 24px; flex: 1; min-width: 0; min-height: 0; overflow-y: auto; }
h2 { margin: 0; font-size: var(--rs-settings-heading-size); font-weight: 600; color: var(--rs-text-strong); }
h3 { margin: var(--rs-settings-section-gap) 0 8px; font-size: 13px; font-weight: 600; }
p { color: var(--rs-text-dim); line-height: 1.45; }
.intro { margin: 6px 0 var(--rs-settings-section-gap); }
.card { padding: 0 12px; background: var(--rs-bg-elevated); border: 1px solid var(--rs-border); border-radius: var(--rs-control-radius); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: var(--rs-settings-row-padding) 0; }
.setting-row > div:first-child { min-width: 0; }
.setting-row + .setting-row { border-top: 1px solid var(--rs-border); }
.setting-row label { font-weight: 500; }
.setting-row p { margin: 5px 0 0; font-size: 12px; }
.setting-row p { margin: 3px 0 0; font-size: var(--rs-settings-description-size); }
.switch { appearance: none; width: 38px; height: 22px; flex: 0 0 38px; margin: 0; border-radius: 20px; background: var(--rs-bg-active); border: 1px solid var(--rs-text-dim); cursor: pointer; }
.switch::before { content: ""; display: block; width: 16px; height: 16px; margin: 2px; background: var(--rs-text); border-radius: 50%; transition: transform .12s; }
.switch:checked { background: var(--rs-accent); border-color: var(--rs-accent); }
.switch:checked::before { transform: translateX(16px); background: var(--rs-bg); }
.interval { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; font-size: 11px; color: var(--rs-text-dim); }
.interval input { width: 84px; padding: 9px; border: 1px solid var(--rs-border); border-radius: var(--rs-control-radius); background: var(--rs-bg); color: var(--rs-text); font-size: 14px; }
.interval input { width: 72px; min-height: var(--rs-settings-control-height); padding: 4px 6px; border: 1px solid var(--rs-border); border-radius: var(--rs-control-radius); background: var(--rs-bg); color: var(--rs-text); font-size: 13px; }
.interval input:disabled { opacity: .45; }
.note, .section-footer, .about-note { font-size: 12px; }
.note { margin: 16px 0 24px; }
.note { margin: 10px 0 var(--rs-settings-section-gap); }
.section-footer { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; color: var(--rs-text-dim); }
.text-button { border: 1px solid var(--rs-border); border-radius: var(--rs-control-radius); background: var(--rs-bg-elevated); padding: 8px 12px; color: var(--rs-text); }
.text-button { min-height: var(--rs-settings-control-height); border: 1px solid var(--rs-border); border-radius: var(--rs-control-radius); background: var(--rs-bg-elevated); padding: 4px 8px; color: var(--rs-text); }
.text-button:hover { background: var(--rs-bg-active); }
.saved { font-size: 12px; color: var(--rs-ok); min-height: 20px; }
.error { color: var(--rs-error); }
@@ -193,11 +208,11 @@
.about-note { text-align: center; margin: 20px 0 0; }
@media (max-width: 660px) {
.body { flex-direction: column; }
aside { width: 100%; padding: 12px; border-right: 0; border-bottom: 1px solid var(--rs-border); flex-shrink: 0; }
nav { flex-direction: row; margin-top: 10px; }
nav button { width: auto; flex: 1; padding: 8px; gap: 6px; }
aside { width: 100%; max-height: 40%; padding: 8px; border-right: 0; border-bottom: 1px solid var(--rs-border); flex-shrink: 0; }
nav { flex-direction: row; flex-wrap: wrap; margin-top: 6px; }
nav button { width: auto; flex: 1 1 auto; padding: 5px 8px; gap: 6px; }
.nav-heading, .scope { display: none; }
.content { padding: 24px 18px; }
.content { padding: 16px 12px; }
.setting-row { gap: 14px; }
}
</style>