50 lines
2.5 KiB
Markdown
50 lines
2.5 KiB
Markdown
# Spotlight Feature
|
||
|
||
**Purpose**: Global search overlay that lets users find any Kubernetes object, existing krates, namespaces, or collection categories, and open specific views.
|
||
|
||
**Trigger**:
|
||
- Click on empty canvas.
|
||
- Type any printable key when no input is focused (pre‑seeds query).
|
||
- `/` key opens an empty spotlight.
|
||
|
||
**Layout**:
|
||
- Full‑screen dark backdrop `rgba(7,9,13,.55)` with `backdrop‑filter: blur(2px)`.
|
||
- Centered panel (max 660 px, 93 % viewport width) with background `rgba(16,20,28,.97)`, border `1px solid rgba(140,165,200,.26)`, border‑radius `14px`.
|
||
- Input row (≈ 52 px high) containing:
|
||
- Search glyph `⌕` (accent color).
|
||
- Optional type‑filter pill.
|
||
- Text input (font‑size 18 px, IBM Plex Sans).
|
||
- Optional Tab‑ghost hint.
|
||
- Horizontal **type chips** row (scrollable on narrow screens) for all object kinds (`pods`, `svc`, `deploy`, `secret`, `cm`, `sts`, …).
|
||
- Results list (max‑height 48 vh, overflow‑auto) – each row shows:
|
||
- Shape glyph (type‑specific).
|
||
- Name.
|
||
- Subtext `type · ns/namespace`.
|
||
- CRD badge if applicable.
|
||
- Type badge.
|
||
- **View chips** appear on the selected result only: `⌥L logs · ⌥S shell · ⌥D describe · ⌥Y yaml`. Views are limited to object capabilities (e.g., logs & shell only for pods, deployments, daemonsets, statefulsets).
|
||
- Footer hint line.
|
||
|
||
**Fuzzy Search Algorithm** (used in the prototype):
|
||
- Score = character‑match score × 10 + type boost.
|
||
- Type boost values: crd 60, deployment 50, statefulset 48, service 46, daemonset 44, ingress 42, secret 24, configmap 22, pvc 18, pod 16.
|
||
- Character match: sequential chars, +3 for consecutive, +5 for word‑boundary start.
|
||
- Top 8 results displayed.
|
||
|
||
**Tab Quick‑Filter**:
|
||
- Typing a type alias (`pod`, `svc`, `deploy`, etc.) shows a ghost hint `⇥ Pods`.
|
||
- Press **Tab** to lock filter as a pill; Backspace removes it.
|
||
- Tab also cycles through recently used type filters (most‑recent first).
|
||
|
||
**Keyboard Shortcuts** (Alt/Option required):
|
||
- `Alt+L` = open **Logs** view for selected result.
|
||
- `Alt+S` = open **Shell** view.
|
||
- `Alt+D` = open **Describe** view.
|
||
- `Alt+Y` = open **YAML** view.
|
||
- `Enter` = open default view (logs for pods, describe for workloads, yaml for config resources) and close spotlight.
|
||
- `Esc` = close spotlight; if a krate was summoned it is placed on canvas.
|
||
- `↑/↓` = navigate results.
|
||
- `Tab` = apply/cycle type filter.
|
||
|
||
**Auto‑Close**: after 500 ms of keyboard idle the spotlight auto‑closes and the camera flies to the newly created krate.
|