feat(menu): #140 — Ask opens a web chat, provider is in-flake state
All checks were successful
Check / eval (push) Successful in 3m57s
All checks were successful
Check / eval (push) Successful in 3m57s
Bernardo: "opening claude-code is too disruptive". SUPER+CTRL+A spent a terminal, an npm fetch and a REPL on "what's the syntax for…" — the prompt was the right surface, the destination was not. The query is now URL-encoded into the provider's web chat and handed to xdg-open. settings.ask.provider (claude|chatgpt|gemini|grok, default claude) with a Preferences row, read from state at RUN TIME so switching needs no rebuild, and any unknown/absent value falls back rather than opening nothing. He asked for chatgpt + grok alongside claude/gemini, and for the CLI to go: claude-code is deleted and pkgs.nodejs leaves with it (carried only for that npx). Keybind is "Ask AI" now the destination is the user's. The failure mode is the design point: prefill is undocumented on all four vendors, each can drop `?q=` unilaterally, and it fails SILENTLY — you land in an empty chat having already typed the question. So the query is also copied to the clipboard (a vendor breaking change costs one paste, not the question), and the URLs sit in one attrset so the repair is one line. Verified against the generated script: bash -n clean; every bad state value (unset/null/garbage) falls back to claude; a hostile query encodes correctly (& → %26, ? → %3F, # → %23, $(whoami) neutralised, café → caf%C3%A9). NOT verified on purpose: whether each vendor fills the box or auto-submits — that means posting into Bernardo's own accounts. Sweep: ROADMAP's shipped-modules line described the npx REPL; nix-ld's comment cited claude-code as its example; both fixed. Menu row + keybind renamed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -460,36 +460,6 @@ high-ROI, etc.) live in the journal + ROADMAP — not here.*
|
||||
|
||||
### Product / day-2
|
||||
|
||||
### 140. Ask Claude should hand off to a web chat, not open a coding agent
|
||||
|
||||
Bernardo 2026-07-16: "opening claude-code is too disruptive" — he would prefer
|
||||
the query go to a **web interface** (Gemini or Claude) instead. Today
|
||||
SUPER+CTRL+A → `nomarchy-menu ask` (`modules/home/rofi.nix:899–905`) takes the
|
||||
free-text line and does `${cfg.terminal} -e npx --yes @anthropic-ai/claude-code@latest "$q"`:
|
||||
a terminal window, an npm fetch on first run, and a REPL that stays open — a
|
||||
coding agent answering "what's the syntax for…". The prompt surface is right;
|
||||
the destination is wrong for the question the surface invites.
|
||||
|
||||
Cheap version: URL-encode `$q` and `xdg-open` a prefill URL
|
||||
(`https://claude.ai/new?q=…`, `https://gemini.google.com/app?q=…`), landing in
|
||||
the default browser (Chromium, per Decisions). That is a handful of lines and
|
||||
deletes the `npx`/network/REPL cost — plus `pkgs.nodejs`, carried in
|
||||
`home.packages` (`:1685`) **only** for this feature, so the closure shrinks
|
||||
with it. To settle before building:
|
||||
- **Which destination, and is it a choice?** Bernardo named Claude *or*
|
||||
Gemini. A `settings.ask.provider` key keeps it in-flake and menu-writable
|
||||
(the convention) and stops us hardcoding a vendor into a vendor-neutral
|
||||
distro; a fixed default is cheaper. Prefill-URL support is per-vendor and
|
||||
can be changed by them unilaterally — worth verifying each still prefills,
|
||||
since a silently-ignored `?q=` degrades to "opens a blank chat", which is
|
||||
survivable but should be a known cost, not a surprise.
|
||||
- **Keep the CLI at all?** A second row (Ask ▸ web / Ask ▸ agent) preserves
|
||||
today's behaviour for whoever wants it; deleting it is the simpler surface
|
||||
and the one the complaint argues for. Bernardo's call.
|
||||
- Renaming: "Ask Claude" is the keybind desc (`keybinds.nix:57`) and shows in
|
||||
the generated cheatsheet — if the destination becomes configurable, the
|
||||
label should stop naming one vendor.
|
||||
|
||||
### 134. `unstable.<pkg>` in the downstream — a newer app without a second flake
|
||||
|
||||
Bernardo 2026-07-15, wanting a newer LM Studio (pinned 0.4.15-2 vs unstable
|
||||
|
||||
Reference in New Issue
Block a user