summaryrefslogtreecommitdiff
path: root/README.md
blob: b9d15eea4dedb23992fa1fec6b3ace07b109ce12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# panto-rsvp

Rapid serial presentation for assistant replies. It presents the latest assistant text one newline-delimited paragraph at a time, omitting fenced code; it does not change ordinary transcript rendering.

RSVP is an optional **focus mode**, not a comprehension or speed promise.

## Install

1. Add the rock to a layered `config.toml`:

   ```toml
   [extensions]
   rocks = ["panto-rsvp"]
   ```

   For a local checkout, use `paths = ["/path/to/panto-rsvp"]` instead; panto's own LuaRocks tree must already provide `luv` (it ships with panto).
2. Bind activation to Ctrl+S:

   ```toml
   [keys]
   "ctrl+s" = "/rsvp"
   ```

3. Restart panto. Run `/rsvp` or Ctrl+S while idle to open the focus view. **Playback does not start on activation**; press Ctrl+S again to start the next unread paragraph.

If `[extensions]` or `[keys]` already exists, add these entries to the existing tables rather than declaring them twice.

## Controls

- Ctrl+S: enter the focus view when idle; once open, start the next unread paragraph. Ignored during playback.
- Space: pause or resume. Resume gives the current word a fresh interval.
- `-` / `+`: adjust speed; changes apply to the next word interval and are saved to `ext.state` when changed.
- Esc: leave. An unfinished paragraph remains unread and restarts on the next activation.

The view opens idle, with stationary `|` markers above and below the focus column; no playback timer runs until the second Ctrl+S. The focus column is `floor(viewport width / 2) + 1`, fixed for idle and playback. Word length excludes ASCII and common Unicode punctuation (which remains displayed and counts toward visual offset): lengths 1 target character 1; 2–5 target 2; 6–9 target 3; 10–13 target 4; 14+ target 5. Punctuation-only tokens fall back to their first visible character. ANSI styling is ignored for counting and retained for display; combining marks do not add a character, and host display widths account for Unicode glyph widths and clipping. Unicode punctuation recognition and complex grapheme clusters are approximate, and rendering remains bounded in narrow viewports.

The word-length buckets follow the [Spritz-style rule documented by Stanford](https://nifty.stanford.edu/2015/posera-speed-reader/speed_reader.html); the [Spritz patent, Table I](https://patents.google.com/patent/US20140016867A1/en), excludes punctuation when counting word characters. This is an alignment heuristic, not a demonstrated comprehension benefit.

The current word stays above the input, with speed and paragraph progress. Text arriving while a paragraph is playing does not change that paragraph's word snapshot. Progress resets on session replacement and is not persisted.

## Settings

Optional settings live in `[rsvp]`:

```toml
[rsvp]
wpm = 250
wpm_step = 25
min_wpm = 50
```

| Setting | Default | Meaning |
| --- | ---: | --- |
| `wpm` | `250` | Fallback words per minute; values below `min_wpm` start at the lower bound. A saved `rsvp.wpm` value overrides this fallback when it is finite and positive. |
| `wpm_step` | `25` | Change per `-` or `+`. |
| `min_wpm` | `50` | Lowest speed; `-` stops here. |

The extension restores and saves speed through `ext.state.get("rsvp.wpm")` / `ext.state.set("rsvp.wpm", speed)`; it does not access state files directly. Missing or invalid saved values use the configured `wpm`; restored speeds are clamped to `min_wpm`. Read/write failures are shown in the focus view without stopping playback or discarding an in-memory speed change. All three configuration values must be finite positive numbers. Theme changes re-render the active paragraph using the current Markdown display style.

## Development

```sh
mise run check    # panto lua _selfcheck.lua
```