docs(website): hint feature docs + cast (content for c84a640)
Completes the preceding empty-rename commit: the getting-help "Hints" section — F1 for a tier-3 teaching hint on the live input, `hint` to explain the most recent error — with the real rendered block and a cast showing both (the live-input hint via the demo-mode Ctrl-G→[F1] alias, since autocast can't send F1, then `hint` on an error). the-assistive-editor points at F1; CtrlG added to the cast generator's key map.
This commit is contained in:
@@ -266,6 +266,33 @@ export const casts = [
|
||||
{ key: 'CtrlC' }, // quit invisibly (Ctrl-C) — cast ends on the last content frame
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'hint',
|
||||
title: 'Ask for a hint — on the command you are typing, or on the last error',
|
||||
width: 90,
|
||||
// Taller: the tier-3 hint blocks (What / Example / Concept) plus the command
|
||||
// echoes need the room. The live-input hint is opened with Ctrl-G, which in
|
||||
// --demo mode aliases F1 and badges AS [F1] (ADR-0047 Amendment 1) — autocast
|
||||
// can't send F1 (an escape sequence), so this control byte stands in for it.
|
||||
height: 30,
|
||||
typeSpeed: '45ms',
|
||||
steps: [
|
||||
{ wait: 1000 },
|
||||
{ type: 'create table customers with pk id(serial)', after: 650 },
|
||||
{ type: 'add column to customers: email (text)', after: 850 },
|
||||
// Live-input hint: type a command but DON'T submit, then Ctrl-G (badged
|
||||
// [F1]) opens a teaching hint for the command being built.
|
||||
{ type: "insert into customers (email) values ('ada@example.io')", enter: false, after: 1500 },
|
||||
{ key: 'CtrlG', after: 3400 }, // [F1] badge + the insert hint block — hold to read
|
||||
{ key: 'Enter', after: 2000 }, // the buffer is intact → submit the insert
|
||||
// Error-recovery hint: a command that fails, then `hint` explains it.
|
||||
{ type: 'show data orders', after: 2200 }, // no such table → friendly error
|
||||
{ type: 'hint', enter: false, after: 1200 },
|
||||
{ key: 'Enter', after: 3400 }, // the error hint block — hold to read
|
||||
{ caption: 'A hint for what you are typing, or for the last error.', after: 3200 },
|
||||
{ key: 'CtrlC' }, // quit invisibly (Ctrl-C) — cast ends on the last content frame
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'quickstart',
|
||||
title: 'RDBMS Playground — first table to first query',
|
||||
|
||||
@@ -49,6 +49,11 @@ const NAMED_KEYS = {
|
||||
CtrlO: '^O',
|
||||
// Esc leaves navigation mode directly (back to the input field).
|
||||
Esc: '^[',
|
||||
// Ctrl-G: in demo mode the app aliases this to F1 (the contextual-hint key,
|
||||
// ADR-0053) and badges it AS [F1] (ADR-0047 Amendment 1). autocast can't emit
|
||||
// F1 (an escape sequence), but it can send this single control byte — so a
|
||||
// cast can show the live-input hint exactly as a real F1 press would.
|
||||
CtrlG: '^G',
|
||||
};
|
||||
|
||||
/** Build the autocast `keys:` list (one entry per line) for a cast's steps. */
|
||||
|
||||
Reference in New Issue
Block a user