diff --git a/apps/tauri/src/App.vue b/apps/tauri/src/App.vue index 507ae65c..0af557ed 100644 --- a/apps/tauri/src/App.vue +++ b/apps/tauri/src/App.vue @@ -8,6 +8,7 @@ import { useShellStatusStore } from "./stores/shellStatus"; import { useConnectionsStore } from "./stores/connections"; import { useShellNavStore } from "./stores/shellNav"; import { usePreferencesStore } from "./stores/preferences"; +import { useFoldersStore } from "./stores/folders"; import { initTheme } from "./theme/queryaTheme"; import { provideQueryaMotion } from "./motion"; import { buildCoreCommands, type AppCommand } from "./commands/registry"; @@ -23,10 +24,12 @@ import CommandPalette from "./ui/CommandPalette.vue"; import QuickSwitcher from "./ui/QuickSwitcher.vue"; import WelcomeTourDialog from "./ui/WelcomeTourDialog.vue"; import AboutDialog from "./ui/AboutDialog.vue"; +import NewFolderDialog from "./ui/NewFolderDialog.vue"; const shell = useShellStore(); const status = useShellStatusStore(); const connections = useConnectionsStore(); +const folders = useFoldersStore(); const nav = useShellNavStore(); usePreferencesStore(); // hydrate prefs + --q-ui-scale on boot const { surface } = storeToRefs(nav); @@ -36,6 +39,7 @@ const paletteOpen = ref(false); const switcherOpen = ref(false); const tourOpen = ref(false); const aboutOpen = ref(false); +const newFolderOpen = ref(false); provideQueryaMotion(); @@ -69,10 +73,22 @@ function onNewConnection() { } function onNewFolder() { - status.setQueryMetrics({ - message: "New folder — LocalDb folders land next", - busy: false, - }); + newFolderOpen.value = true; +} + +function onCreateFolder(name: string) { + try { + folders.create(name); + status.setQueryMetrics({ + message: `Folder “${name}” created`, + busy: false, + }); + } catch (err) { + status.setQueryMetrics({ + message: err instanceof Error ? err.message : String(err), + busy: false, + }); + } } function onLaunchDemo() { @@ -226,6 +242,11 @@ onUnmounted(() => { @open-preferences="onOpenPreferences" /> + diff --git a/apps/tauri/src/stores/connections.ts b/apps/tauri/src/stores/connections.ts index aca66b54..f467d5f4 100644 --- a/apps/tauri/src/stores/connections.ts +++ b/apps/tauri/src/stores/connections.ts @@ -6,6 +6,7 @@ import { formatConnectionError, } from "../api/connection"; import { DEMO_CONNECTION } from "../mock/demoCatalog"; +import { useFoldersStore } from "./folders"; import { useShellNavStore } from "./shellNav"; import { useShellStatusStore } from "./shellStatus"; @@ -16,6 +17,8 @@ export type LiveConnection = { path: string; /** Offline UI demo — no Rust session. */ mock?: boolean; + /** Optional SERVERS folder id. */ + folderId?: string | null; }; function fileName(path: string): string { @@ -42,14 +45,18 @@ export const useConnectionsStore = defineStore("connections", () => { function launchDemo() { const nav = useShellNavStore(); const status = useShellStatusStore(); + const folders = useFoldersStore(); + const samples = folders.ensureDemoFolder(); const conn: LiveConnection = { id: DEMO_CONNECTION.id, driver: "sqlite", name: DEMO_CONNECTION.name, path: DEMO_CONNECTION.path, mock: true, + folderId: samples.id, }; upsert(conn); + folders.setExpanded(samples.id, true); nav.setExpanded(conn.id, true); nav.selectConnection(conn.id); status.setConnection(conn.name, "Demo (offline)"); @@ -60,7 +67,7 @@ export const useConnectionsStore = defineStore("connections", () => { return conn; } - async function connectSqlite(path: string) { + async function connectSqlite(path: string, folderId?: string | null) { const status = useShellStatusStore(); const nav = useShellNavStore(); status.setQueryMetrics({ @@ -74,6 +81,7 @@ export const useConnectionsStore = defineStore("connections", () => { driver: "sqlite", name: fileName(path), path, + folderId: folderId ?? null, }; upsert(conn); nav.setExpanded(id, true); @@ -127,6 +135,19 @@ export const useConnectionsStore = defineStore("connections", () => { }); } + function moveToFolder(connectionId: string, folderId: string | null) { + const conn = items.value.find((c) => c.id === connectionId); + if (!conn) return; + conn.folderId = folderId; + } + + /** Detach all connections from a folder (Flutter: folder delete keeps connections). */ + function detachFolder(folderId: string) { + for (const c of items.value) { + if (c.folderId === folderId) c.folderId = null; + } + } + return { items, byId, @@ -134,5 +155,7 @@ export const useConnectionsStore = defineStore("connections", () => { connectSqlite, disconnect, select, + moveToFolder, + detachFolder, }; }); diff --git a/apps/tauri/src/stores/folders.ts b/apps/tauri/src/stores/folders.ts new file mode 100644 index 00000000..a74d8bff --- /dev/null +++ b/apps/tauri/src/stores/folders.ts @@ -0,0 +1,110 @@ +import { defineStore } from "pinia"; +import { computed, reactive, watch } from "vue"; + +const STORAGE_KEY = "querya.folders.v1"; + +export type ConnectionFolder = { + id: string; + name: string; + /** Expanded in the SERVERS tree. */ + expanded: boolean; +}; + +type Stored = { folders: { id: string; name: string }[] }; + +function load(): ConnectionFolder[] { + try { + const raw = localStorage.getItem(STORAGE_KEY); + if (!raw) return []; + const parsed = JSON.parse(raw) as Stored; + return (parsed.folders ?? []).map((f) => ({ + id: f.id, + name: f.name, + expanded: true, + })); + } catch { + return []; + } +} + +function newId(): string { + return `folder-${crypto.randomUUID()}`; +} + +/** In-memory folders for the SERVERS tree (LocalDb persistence later). */ +export const useFoldersStore = defineStore("folders", () => { + const folders = reactive(load()); + + watch( + folders, + () => { + const payload: Stored = { + folders: folders.map(({ id, name }) => ({ id, name })), + }; + localStorage.setItem(STORAGE_KEY, JSON.stringify(payload)); + }, + { deep: true }, + ); + + const byId = computed(() => { + const map = new Map(); + for (const f of folders) map.set(f.id, f); + return map; + }); + + function create(name: string): ConnectionFolder { + const trimmed = name.trim(); + if (!trimmed) throw new Error("Folder name is empty"); + if (folders.some((f) => f.name.toLowerCase() === trimmed.toLowerCase())) { + throw new Error(`Folder "${trimmed}" already exists`); + } + const folder: ConnectionFolder = { + id: newId(), + name: trimmed, + expanded: true, + }; + folders.push(folder); + return folder; + } + + function remove(id: string) { + const i = folders.findIndex((f) => f.id === id); + if (i >= 0) folders.splice(i, 1); + } + + function rename(id: string, name: string) { + const f = folders.find((x) => x.id === id); + if (!f) return; + const trimmed = name.trim(); + if (!trimmed) return; + f.name = trimmed; + } + + function toggleExpanded(id: string) { + const f = folders.find((x) => x.id === id); + if (f) f.expanded = !f.expanded; + } + + function setExpanded(id: string, expanded: boolean) { + const f = folders.find((x) => x.id === id); + if (f) f.expanded = expanded; + } + + /** Seed a sample folder once for Demo UX if none exist. */ + function ensureDemoFolder(): ConnectionFolder { + const existing = folders.find((f) => f.name === "Samples"); + if (existing) return existing; + return create("Samples"); + } + + return { + folders, + byId, + create, + remove, + rename, + toggleExpanded, + setExpanded, + ensureDemoFolder, + }; +}); diff --git a/apps/tauri/src/stores/objectTree.ts b/apps/tauri/src/stores/objectTree.ts index 52f18581..09d97d6e 100644 --- a/apps/tauri/src/stores/objectTree.ts +++ b/apps/tauri/src/stores/objectTree.ts @@ -1,5 +1,5 @@ import { defineStore } from "pinia"; -import { computed, ref, watch } from "vue"; +import { computed, reactive, watch } from "vue"; import { dbListChildren, formatConnectionError, @@ -16,6 +16,24 @@ export type TreeUiNode = SqlObjectNode & { error: string | null; }; +type ConnTreeState = { + roots: TreeUiNode[]; + loading: boolean; + error: string | null; + filter: string; + loaded: boolean; +}; + +function emptyState(): ConnTreeState { + return { + roots: [], + loading: false, + error: null, + filter: "", + loaded: false, + }; +} + function toUi(nodes: SqlObjectNode[]): TreeUiNode[] { return nodes.map((n) => ({ ...n, @@ -56,12 +74,27 @@ export function filterTree(nodes: TreeUiNode[], q: string): TreeUiNode[] { return out; } +function relationsOf(roots: TreeUiNode[]): TreeUiNode[] { + const out: TreeUiNode[] = []; + for (const root of roots) { + for (const child of root.children ?? []) { + if (child.kind === "table" || child.kind === "view") out.push(child); + } + } + return out; +} + +/** + * Per-connection object tree cache so multiple SERVERS rows can stay expanded + * (Flutter `_expandedConnections` behavior). + */ export const useObjectTreeStore = defineStore("objectTree", () => { - const connectionId = ref(null); - const roots = ref([]); - const loading = ref(false); - const error = ref(null); - const filter = ref(""); + const byConnection = reactive>({}); + + function stateOf(connId: string): ConnTreeState { + if (!byConnection[connId]) byConnection[connId] = emptyState(); + return byConnection[connId]!; + } function isMock(id: string): boolean { return Boolean(useConnectionsStore().byId.get(id)?.mock); @@ -75,28 +108,6 @@ export const useObjectTreeStore = defineStore("objectTree", () => { return dbListChildren(connId, parentId); } - async function loadFor(id: string | null) { - connectionId.value = id; - roots.value = []; - error.value = null; - filter.value = ""; - if (!id) return; - - loading.value = true; - try { - roots.value = toUi(await fetchChildren(id, null)); - // SQLite / Demo: single `main` schema — expand so tables show immediately. - const [only] = roots.value; - if (roots.value.length === 1 && only?.expandable) { - await expandNode(id, only); - } - } catch (err) { - error.value = formatConnectionError(err); - } finally { - loading.value = false; - } - } - async function expandNode(connId: string, node: TreeUiNode) { node.expanded = true; if (node.children) return; @@ -112,51 +123,114 @@ export const useObjectTreeStore = defineStore("objectTree", () => { } } - async function toggleExpand(nodeId: string) { - const id = connectionId.value; - const node = findNode(roots.value, nodeId); - if (!id || !node || !node.expandable) return; + async function ensureLoaded(connId: string, force = false) { + const st = stateOf(connId); + if (st.loaded && !force) return; + st.loading = true; + st.error = null; + try { + st.roots = toUi(await fetchChildren(connId, null)); + const [only] = st.roots; + if (st.roots.length === 1 && only?.expandable) { + await expandNode(connId, only); + } + st.loaded = true; + } catch (err) { + st.error = formatConnectionError(err); + st.roots = []; + st.loaded = false; + } finally { + st.loading = false; + } + } + + async function loadFor(id: string | null, force = false) { + if (!id) return; + await ensureLoaded(id, force); + } + async function toggleExpand(connId: string, nodeId: string) { + const st = stateOf(connId); + const node = findNode(st.roots, nodeId); + if (!node || !node.expandable) return; if (node.expanded) { node.expanded = false; return; } - await expandNode(id, node); + await expandNode(connId, node); } - /** Flat tables/views under loaded schema children (for ConnectionHome quick list). */ - const relations = computed(() => { - const out: TreeUiNode[] = []; - for (const root of roots.value) { - for (const child of root.children ?? []) { - if (child.kind === "table" || child.kind === "view") out.push(child); - } - } - return out; - }); + function setFilter(connId: string, value: string) { + stateOf(connId).filter = value; + } + + function drop(connId: string) { + delete byConnection[connId]; + } - function refresh() { - return loadFor(connectionId.value); + function refresh(connId: string) { + return ensureLoaded(connId, true); } const nav = useShellNavStore(); + + /** Selected connection — for ConnectionHome / QuickSwitcher. */ + const connectionId = computed(() => nav.selectedConnectionId); + const roots = computed(() => { + const id = nav.selectedConnectionId; + return id ? stateOf(id).roots : []; + }); + const loading = computed(() => { + const id = nav.selectedConnectionId; + return id ? stateOf(id).loading : false; + }); + const error = computed(() => { + const id = nav.selectedConnectionId; + return id ? stateOf(id).error : null; + }); + const filter = computed({ + get: () => { + const id = nav.selectedConnectionId; + return id ? stateOf(id).filter : ""; + }, + set: (v: string) => { + const id = nav.selectedConnectionId; + if (id) setFilter(id, v); + }, + }); + const relations = computed(() => relationsOf(roots.value)); + watch( () => nav.selectedConnectionId, (id) => { - void loadFor(id); + if (id) void ensureLoaded(id); + }, + { immediate: true }, + ); + + watch( + () => nav.expandedConnectionIds.slice(), + (ids) => { + for (const id of ids) void ensureLoaded(id); }, { immediate: true }, ); return { + byConnection, connectionId, roots, relations, loading, error, filter, + stateOf, + ensureLoaded, loadFor, toggleExpand, + setFilter, + drop, refresh, + relationsOf, }; }); diff --git a/apps/tauri/src/ui/ConnectionsPanel.vue b/apps/tauri/src/ui/ConnectionsPanel.vue index 2091f04a..16ebdd41 100644 --- a/apps/tauri/src/ui/ConnectionsPanel.vue +++ b/apps/tauri/src/ui/ConnectionsPanel.vue @@ -2,7 +2,11 @@ import { computed, onUnmounted, ref } from "vue"; import { storeToRefs } from "pinia"; import { useShellStore } from "../stores/shell"; -import { useConnectionsStore } from "../stores/connections"; +import { + useConnectionsStore, + type LiveConnection, +} from "../stores/connections"; +import { useFoldersStore } from "../stores/folders"; import { useShellNavStore } from "../stores/shellNav"; import { filterTree, @@ -21,27 +25,28 @@ const emit = defineEmits<{ const shell = useShellStore(); const connections = useConnectionsStore(); +const foldersStore = useFoldersStore(); const nav = useShellNavStore(); const tree = useObjectTreeStore(); const { items } = storeToRefs(connections); +const { folders } = storeToRefs(foldersStore); const { selectedConnectionId, expandedConnectionIds, selectedObject } = storeToRefs(nav); -const { roots, filter: objectFilter, loading, error } = storeToRefs(tree); const motion = useQueryaMotion(); const filter = ref(""); const dragging = ref(false); -const ctx = ref({ open: false, x: 0, y: 0 }); -const ctxItems: CtxItem[] = [ - { - id: "create", - label: "Create", - children: [ - { id: "new-connection", label: "New Connection" }, - { id: "new-folder", label: "New Folder" }, - ], - }, -]; +type CtxTarget = + | { type: "panel" } + | { type: "folder"; folderId: string } + | { type: "connection"; connectionId: string }; + +const ctx = ref<{ open: boolean; x: number; y: number; target: CtxTarget }>({ + open: false, + x: 0, + y: 0, + target: { type: "panel" }, +}); const filteredConnections = computed(() => { const q = filter.value.trim().toLowerCase(); @@ -52,10 +57,61 @@ const filteredConnections = computed(() => { ); }); -const filteredRoots = computed(() => - filterTree(roots.value, objectFilter.value.trim().toLowerCase()), +const rootConnections = computed(() => + filteredConnections.value.filter((c) => !c.folderId), ); +const folderRows = computed(() => { + const q = filter.value.trim().toLowerCase(); + return folders.value + .map((f) => { + const children = filteredConnections.value.filter( + (c) => c.folderId === f.id, + ); + const nameHit = !q || f.name.toLowerCase().includes(q); + if (!nameHit && !children.length) return null; + return { folder: f, children, forceOpen: Boolean(q) && children.length > 0 }; + }) + .filter((row): row is NonNullable => row != null); +}); + +const ctxItems = computed(() => { + const t = ctx.value.target; + if (t.type === "folder") { + return [ + { id: "new-connection", label: "New Connection" }, + { id: "remove-folder", label: "Remove folder" }, + ]; + } + if (t.type === "connection") { + const moveKids: CtxItem[] = [ + { id: "move-root", label: "No folder" }, + ...folders.value.map((f) => ({ + id: `move:${f.id}`, + label: f.name, + })), + ]; + return [ + { id: "disconnect", label: "Disconnect" }, + { + id: "move", + label: "Move to folder", + children: moveKids, + }, + ]; + } + return [ + { + id: "create", + label: "Create", + children: [ + { id: "new-connection", label: "New Connection" }, + { id: "new-folder", label: "New Folder" }, + ], + }, + ]; +}); + const panelStyle = computed(() => ({ width: shell.sidebarOpen ? `${shell.sidebarWidth}px` : "0px", transitionProperty: dragging.value ? "none" : "width", @@ -89,14 +145,19 @@ function onConnClick(id: string) { function onConnExpand(id: string, e: MouseEvent) { e.stopPropagation(); nav.toggleExpanded(id); - connections.select(id); + void tree.ensureLoaded(id); } -function onRelationClick(node: TreeUiNode) { - const id = selectedConnectionId.value; - if (!id || (node.kind !== "table" && node.kind !== "view")) return; +function onFolderExpand(id: string, e: MouseEvent) { + e.stopPropagation(); + foldersStore.toggleExpanded(id); +} + +function onRelationClick(connectionId: string, node: TreeUiNode) { + if (node.kind !== "table" && node.kind !== "view") return; + connections.select(connectionId); nav.selectObject({ - connectionId: id, + connectionId, name: node.name, kind: node.kind, objectId: node.id, @@ -104,22 +165,53 @@ function onRelationClick(node: TreeUiNode) { }); } -function onNodeChevron(node: TreeUiNode, e: MouseEvent) { +function onNodeChevron(connectionId: string, node: TreeUiNode, e: MouseEvent) { + e.stopPropagation(); + void tree.toggleExpand(connectionId, node.id); +} + +function openCtx(e: MouseEvent, target: CtxTarget) { + e.preventDefault(); e.stopPropagation(); - void tree.toggleExpand(node.id); + ctx.value = { open: true, x: e.clientX, y: e.clientY, target }; } function onPanelContext(e: MouseEvent) { - // Only empty fill / panel chrome — not rows (they get their own menus later). const t = e.target as HTMLElement | null; - if (t?.closest(".conn-row, .node-row, .cols, input, button")) return; - e.preventDefault(); - ctx.value = { open: true, x: e.clientX, y: e.clientY }; + if (t?.closest(".conn-row, .folder-row, .node-row, .cols, input, button")) + return; + openCtx(e, { type: "panel" }); } function onCtxSelect(id: string) { + const t = ctx.value.target; if (id === "new-connection") emit("newConnection"); else if (id === "new-folder") emit("newFolder"); + else if (id === "remove-folder" && t.type === "folder") { + connections.detachFolder(t.folderId); + foldersStore.remove(t.folderId); + } else if (id === "disconnect" && t.type === "connection") { + void connections.disconnect(t.connectionId); + tree.drop(t.connectionId); + } else if (id === "move-root" && t.type === "connection") { + connections.moveToFolder(t.connectionId, null); + } else if (id.startsWith("move:") && t.type === "connection") { + connections.moveToFolder(t.connectionId, id.slice(5)); + } +} + +function treeState(connId: string) { + return tree.stateOf(connId); +} + +function filteredRootsFor(connId: string) { + const st = tree.stateOf(connId); + return filterTree(st.roots, st.filter.trim().toLowerCase()); +} + +function driverGlyph(c: LiveConnection): string { + if (c.mock) return "◈"; + return "▤"; } onUnmounted(() => { @@ -152,17 +244,142 @@ onUnmounted(() => { - + {{ filter ? `No connections match "${filter}"` : "No connections yet" }} - + + + + + + {{ row.folder.expanded || row.forceOpen ? "▾" : "▸" }} + + ▣ + {{ row.folder.name }} + {{ row.children.length }} + + + + + + + {{ expandedConnectionIds.includes(c.id) ? "▾" : "▸" }} + + + {{ + driverGlyph(c) + }} + {{ c.name }} + + {{ c.driver + }} · demo + + + + × + + + + + + OBJECTS + + ↻ + + + + Loading… + + {{ treeState(c.id).error }} + + + onNodeChevron(c.id, n, e)" + @select-relation="(n) => onRelationClick(c.id, n)" + /> + + + + + + + - + { class="conn-main" @click="onConnClick(c.id)" > + {{ + driverGlyph(c) + }} {{ c.name }} {{ c.driver }} · demo @@ -194,14 +419,17 @@ onUnmounted(() => { type="button" class="conn-x" :aria-label="`Remove ${c.name}`" - @click.stop="connections.disconnect(c.id)" + @click.stop=" + connections.disconnect(c.id); + tree.drop(c.id); + " > × @@ -211,28 +439,36 @@ onUnmounted(() => { type="button" class="refresh" aria-label="Refresh" - @click="tree.refresh()" + @click="tree.refresh(c.id)" > ↻ - Loading… - {{ error }} - + Loading… + + {{ treeState(c.id).error }} + + onNodeChevron(c.id, n, e)" + @select-relation="(n) => onRelationClick(c.id, n)" /> @@ -288,20 +524,17 @@ onUnmounted(() => { .servers-label, .tree-label { - font-family: var(--q-font-mono); - font-size: 11px; - font-weight: 600; - letter-spacing: 0.85px; + font-size: 10px; + font-weight: 700; + letter-spacing: 0.06em; color: var(--q-muted-foreground); } -.count { - font-size: 11px; +.count, +.count-sm { + font-size: 10px; color: var(--q-muted-foreground); - background: var(--q-accent); - border-radius: 999px; - padding: 0 6px; - line-height: 18px; + font-variant-numeric: tabular-nums; } .filter-row { @@ -310,9 +543,9 @@ onUnmounted(() => { .filter { width: 100%; - height: var(--q-control-h-sm); - border: 1px solid var(--q-border); - border-radius: var(--q-radius-control); + height: 28px; + border-radius: 6px; + border: 1px solid color-mix(in srgb, var(--q-border) 70%, transparent); background: var(--q-surface); color: var(--q-foreground); padding: 0 8px; @@ -320,102 +553,115 @@ onUnmounted(() => { font-size: 12px; } -.filter:focus { - outline: 2px solid color-mix(in srgb, var(--q-primary) 45%, transparent); - outline-offset: 0; -} - .body { flex: 1; - padding: 4px 8px 16px; + min-height: 0; overflow: auto; + padding: 0 6px 12px; } .empty-title { - margin: 12px 4px 0; - font-size: 13px; - font-weight: 500; - color: var(--q-muted-foreground); -} - -.hint { - margin: 6px 4px 0; + margin: 16px 8px; font-size: 12px; color: var(--q-muted-foreground); - line-height: 1.4; } -.hint.err, -.col.err { - color: var(--q-danger, #c44); -} - -.list { +.list, +.folder-kids, +.nodes { list-style: none; margin: 0; padding: 0; } +.folder-row, .conn-row { display: flex; align-items: center; gap: 2px; border-radius: var(--q-radius-control); + padding-right: 2px; } +.folder-row:hover, .conn.active > .conn-row { - background: color-mix(in srgb, var(--q-primary) 16%, transparent); + background: color-mix(in srgb, var(--q-primary) 10%, transparent); +} + +.folder-ico { + font-size: 12px; + line-height: 1; +} + +.folder-name { + flex: 1; + font-size: 12px; + font-weight: 600; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } .chev { + width: 18px; + flex: 0 0 18px; appearance: none; border: 0; background: transparent; - width: 1.25rem; - height: 1.5rem; color: var(--q-muted-foreground); cursor: pointer; font-size: 10px; - flex-shrink: 0; -} - -.chev.sm { - width: 1rem; + line-height: 1; + padding: 0; } -.conn-main, -.node-main { +.conn-main { + flex: 1; + min-width: 0; + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 1px; appearance: none; border: 0; background: transparent; - flex: 1; - min-width: 0; - text-align: left; - padding: 6px 6px; - cursor: pointer; color: var(--q-foreground); font: inherit; - font-size: 12px; + text-align: left; + padding: 5px 6px; border-radius: var(--q-radius-control); + cursor: pointer; + position: relative; } -.conn-main:hover, -.node-main:hover { +.conn-main .glyph { + position: absolute; + left: 6px; + top: 8px; + font-size: 10px; + color: var(--q-muted-foreground); +} + +.conn-main .conn-name, +.conn-main .conn-meta { + padding-left: 16px; +} + +.conn-main:hover { background: var(--q-accent); } -.conn-name, -.name { +.conn-name { display: block; + width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; + font-size: 12px; } -.conn-meta, -.kind, -.type { +.conn-meta { display: block; font-size: 10px; color: var(--q-muted-foreground); @@ -440,11 +686,16 @@ onUnmounted(() => { color: var(--q-foreground); } +.folder-kids { + margin: 0 0 4px 6px; + padding-left: 4px; + border-left: 1px solid color-mix(in srgb, var(--q-border) 45%, transparent); +} + .tree { margin: 2px 0 8px 6px; padding: 6px 0 4px 6px; - border-left: 1px solid - color-mix(in srgb, var(--q-border) 55%, transparent); + border-left: 1px solid color-mix(in srgb, var(--q-border) 55%, transparent); } .tree-header { @@ -454,45 +705,21 @@ onUnmounted(() => { margin-bottom: 4px; } -.nodes, -.cols { - list-style: none; - margin: 6px 0 0; - padding: 0; -} - -.node-row { - display: flex; - align-items: center; - border-radius: var(--q-radius-control); -} - -.node-row.selected { - background: color-mix(in srgb, var(--q-primary) 14%, transparent); -} - -.cols { - padding: 0 0 4px 1rem; +.tree .filter { + margin-bottom: 4px; } -.col { - display: flex; - justify-content: space-between; - gap: 8px; - padding: 2px 6px; +.hint { + margin: 6px 4px; font-size: 11px; -} - -.col.muted { color: var(--q-muted-foreground); } -.pk { - margin-left: 4px; - font-size: 9px; - font-weight: 700; - color: var(--q-primary); - font-family: var(--q-font-mono); +.hint.err { + color: var(--q-destructive); } +.nodes { + margin: 4px 0 0; +} diff --git a/apps/tauri/src/ui/NewFolderDialog.vue b/apps/tauri/src/ui/NewFolderDialog.vue new file mode 100644 index 00000000..c2165965 --- /dev/null +++ b/apps/tauri/src/ui/NewFolderDialog.vue @@ -0,0 +1,156 @@ + + + + + + New folder + Group connections in the SERVERS tree. + + Name + + + {{ error }} + + + + + +
+
{{ filter ? `No connections match "${filter}"` : "No connections yet" }}
Loading…
+ {{ treeState(c.id).error }} +
{{ error }}
Group connections in the SERVERS tree.