From 677b5adaf9638eb2a90ef4e2db25bd6c7b7ce5fa Mon Sep 17 00:00:00 2001
From: JoshiCodes <55353244+JoshiCodes@users.noreply.github.com>
Date: Fri, 27 Nov 2026 21:54:04 +0100
Subject: [PATCH] Design pass: fewer boxes, one emphasis signal, type glyphs in
the JSON form
- Welcome screen: the mark as a peephole and actions as plain lines
instead of a card grid and key chips
- Title bar: search as a small button, documentation (F1) next to it;
help entries in the command palette
- The vertical cyan rule marks what needs attention (redirect URI,
inactive environment, banners) instead of nested framed boxes
- JSON form: fixed key column so types and values line up at any depth,
type glyphs in the code view's colours, row actions float on hover
- Crisper corners; Send carries the mark; Saved instead of a disabled
Save button
- Open tabs are restored after a restart again
---
src/App.svelte | 12 +-
src/app.css | 2 +-
src/lib/help.ts | 7 ++
src/lib/json/JsonForm.svelte | 113 +++++++++--------
src/lib/state/workspace.svelte.ts | 6 +-
src/lib/ui/Icon.svelte | 3 +-
src/lib/views/Titlebar.svelte | 30 +++--
src/lib/views/Welcome.svelte | 116 +++++++++++-------
src/lib/views/auth/OAuthConfig.svelte | 2 +-
src/lib/views/request/RequestView.svelte | 4 +-
src/lib/views/request/UrlBar.svelte | 7 +-
src/lib/views/response/ResponsePane.svelte | 2 +-
.../views/settings/CollectionSettings.svelte | 4 +-
src/lib/views/settings/EnvironmentView.svelte | 6 +-
src/lib/views/settings/FolderView.svelte | 4 +-
15 files changed, 196 insertions(+), 122 deletions(-)
create mode 100644 src/lib/help.ts
diff --git a/src/App.svelte b/src/App.svelte
index f2ad86e..78ae5cb 100644
--- a/src/App.svelte
+++ b/src/App.svelte
@@ -19,6 +19,7 @@
import { sendTab } from '$lib/send.svelte';
import type { TreeNode } from '$lib/types';
import { onDeepLink } from '$lib/deeplink';
+ import { openDocs } from '$lib/help';
let ready = $state(false);
@@ -51,6 +52,11 @@
function onKey(e: KeyboardEvent) {
const mod = e.ctrlKey || e.metaKey;
+ if (e.key === 'F1') {
+ e.preventDefault();
+ openDocs();
+ return;
+ }
if (!mod) {
if (e.key === 'F2' || e.key === 'Escape') return;
return;
@@ -130,7 +136,11 @@
{ id: 'a:import', label: 'Import from Postman, Bruno, Insomnia, OpenAPI or cURL…', group: 'Actions', onselect: () => dialogs.importer() },
{ id: 'a:layout', label: 'Toggle response below / beside', group: 'Actions', onselect: () => ws.setLayout(ws.layout === 'columns' ? 'rows' : 'columns') },
{ id: 'a:mask', label: ws.maskSecrets ? 'Show secrets' : 'Mask secrets', group: 'Actions', onselect: () => ws.setMask(!ws.maskSecrets) },
- { id: 'a:settings', label: 'Settings', group: 'Actions', onselect: () => ws.openSpecial('settings', null, null, 'Settings') }
+ { id: 'a:settings', label: 'Settings', group: 'Actions', onselect: () => ws.openSpecial('settings', null, null, 'Settings') },
+ { id: 'a:docs', label: 'Documentation', group: 'Help', hint: 'F1', keywords: ['help', 'docs', 'manual'], onselect: () => openDocs() },
+ { id: 'a:docs-oauth', label: 'Documentation: OAuth 2.0 and OpenID Connect', group: 'Help', onselect: () => openDocs('oauth-2-0-and-openid-connect') },
+ { id: 'a:docs-format', label: 'Documentation: collection format', group: 'Help', onselect: () => openDocs('collection-format') },
+ { id: 'a:docs-keys', label: 'Documentation: keyboard shortcuts', group: 'Help', onselect: () => openDocs('keyboard-shortcuts') }
);
if (ws.focusCol) {
const col = ws.focusCol;
diff --git a/src/app.css b/src/app.css
index 5798101..2f31d5d 100644
--- a/src/app.css
+++ b/src/app.css
@@ -45,7 +45,7 @@
--ck-warning: #9a5b00;
--ck-font-sans: 'Space Grotesk', system-ui, sans-serif;
--ck-font-mono: 'JetBrains Mono', ui-monospace, monospace;
- --ck-radius-scale: 0.75;
+ --ck-radius-scale: 0.5;
}
.dark,
diff --git a/src/lib/help.ts b/src/lib/help.ts
new file mode 100644
index 0000000..985388a
--- /dev/null
+++ b/src/lib/help.ts
@@ -0,0 +1,7 @@
+import { openUrl } from '@tauri-apps/plugin-opener';
+
+
+
+export function openDocs(page = 'introduction') {
+ openUrl(`https://docs.joshicodes.de/b/knock/${page}`).catch(() => {});
+}
diff --git a/src/lib/json/JsonForm.svelte b/src/lib/json/JsonForm.svelte
index 22c7338..e60e40a 100644
--- a/src/lib/json/JsonForm.svelte
+++ b/src/lib/json/JsonForm.svelte
@@ -1,5 +1,5 @@
@@ -221,8 +233,7 @@
role="treeitem"
aria-selected="false"
tabindex="-1"
- class="group relative flex min-h-[30px] items-center gap-1 pr-2 hover:bg-hover/40 {dropTarget?.id === n.id ? (dropTarget.after ? 'shadow-[inset_0_-2px_0_var(--knock-cyan)]' : 'shadow-[inset_0_2px_0_var(--knock-cyan)]') : ''}"
- style:padding-left="{6 + r.depth * 18}px"
+ class="group relative flex min-h-[30px] items-center gap-1.5 pr-2 hover:bg-hover/40 {dropTarget?.id === n.id ? (dropTarget.after ? 'shadow-[inset_0_-2px_0_var(--knock-cyan)]' : 'shadow-[inset_0_2px_0_var(--knock-cyan)]') : ''}"
use:focusKey={n.id}
oncontextmenu={() => (menuRow = r)}
ondragover={(e) => {
@@ -235,41 +246,40 @@
e.preventDefault();
onDrop(r);
}}
- >
- {#if r.parent}
- (drag = r)}
- ondragend={() => {
- drag = null;
- dropTarget = null;
- }}>