UnENVerse 0.84.0
Local-first desktop secrets manager — TypeScript frontend
Loading...
Searching...
No Matches
palette.ts File Reference

The command palette (Ctrl+Shift+P): type a few letters, press Enter, and the app navigates or acts. More...

Functions

function export scoreCommand (query:string, label:string)
 How well query matches label: -1 when its letters do not appear in order, otherwise higher is better.
function export paletteCommands ()

Variables

 import { clearAllFilters, switchPanel, triggerRender } from './state'
export interface Command
label __pad0__
hint __pad1__
 Shown dimmed beside the label: the shortcut, or where the command goes.
run __pad2__
let overlay
let shown
let active = 0
let all
let returnTo

Detailed Description

The command palette (Ctrl+Shift+P): type a few letters, press Enter, and the app navigates or acts.

It is a keyboard path to what the activity bar and header already do, not a second set of features: every command calls the function the matching button calls. The overlay is built on first use, so it adds nothing to the page until someone asks for it. Focus goes to the input on open and back to where it was on close; Up and Down move through the list, Enter runs the highlighted command, Escape closes.

Function Documentation

◆ scoreCommand()

function export scoreCommand ( query:string,
label:string )

How well query matches label: -1 when its letters do not appear in order, otherwise higher is better.

A match at the start of the label or of a word beats one in the middle, and a run of consecutive letters beats scattered ones.

◆ paletteCommands()

function export paletteCommands ( )

Variable Documentation

◆ import

import { clearAllFilters, switchPanel, triggerRender } from './state'

◆ Command

export interface Command
Initial value:
{
id: string

◆ __pad0__

label __pad0__

◆ __pad1__

hint __pad1__

Shown dimmed beside the label: the shortcut, or where the command goes.

◆ __pad2__

run __pad2__

◆ overlay

let overlay

◆ shown

let shown

◆ active

let active = 0

◆ all

let all

◆ returnTo

let returnTo