Skip to content

enhance(config, typewriter)!: Switch DelayDuration to humantime format#645

Merged
JeanMertz merged 1 commit into
mainfrom
prr216
May 16, 2026
Merged

enhance(config, typewriter)!: Switch DelayDuration to humantime format#645
JeanMertz merged 1 commit into
mainfrom
prr216

Conversation

@JeanMertz
Copy link
Copy Markdown
Collaborator

The previous custom duration format ("3" for 3 ms, "5m" for 5 ms,
"1u" for 1 µs) was non-standard and undiscoverable. This replaces it
with [humantime]-compatible strings ("3ms", "500us", "1s",
"0s") across the entire TypewriterConfig.

Default values in #[setting(...)] annotations are updated accordingly:
text_delay from "3""3ms", code_delay from "500u"
"500us", and max_latency from "0""0s".

Custom Serialize/Deserialize implementations replace the derived
ones so that values round-trip as humantime strings. A backwards-compat
visit_map path accepts the old {secs, nanos} shape that stored
conversations may still carry, so existing data keeps loading without a
migration.

The Schematic impl is now handwritten to expose a descriptive string
type in the generated schema. Display and FromStr are also
implemented, both delegating to humantime.

The default persona config is updated to set typewriter.max_latency = "200ms" using the new format.

BREAKING CHANGE: Typewriter delay format changed

Any jp config file that sets text_delay, code_delay, or
max_latency using the old shorthand ("3", "5m", "1u") will fail
to parse. Update those values to humantime strings, e.g.:

text_delay  = "3ms"
code_delay  = "500us"
max_latency = "200ms"

@JeanMertz JeanMertz force-pushed the prr216 branch 2 times, most recently from 8698dc4 to ed5f9aa Compare May 16, 2026 08:14
…ormat

The previous custom duration format (`"3"` for 3 ms, `"5m"` for 5 ms,
`"1u"` for 1 µs) was non-standard and undiscoverable. This replaces it
with [`humantime`]-compatible strings (`"3ms"`, `"500us"`, `"1s"`,
`"0s"`) across the entire `TypewriterConfig`.

Default values in `#[setting(...)]` annotations are updated accordingly:
`text_delay` from `"3"` → `"3ms"`, `code_delay` from `"500u"` →
`"500us"`, and `max_latency` from `"0"` → `"0s"`.

Custom `Serialize`/`Deserialize` implementations replace the derived
ones so that values round-trip as humantime strings. A backwards-compat
`visit_map` path accepts the old `{secs, nanos}` shape that stored
conversations may still carry, so existing data keeps loading without a
migration.

The `Schematic` impl is now handwritten to expose a descriptive string
type in the generated schema. `Display` and `FromStr` are also
implemented, both delegating to `humantime`.

The default persona config is updated to set `typewriter.max_latency =
"200ms"` using the new format.

BREAKING CHANGE: Typewriter delay format changed

Any `jp` config file that sets `text_delay`, `code_delay`, or
`max_latency` using the old shorthand (`"3"`, `"5m"`, `"1u"`) will fail
to parse. Update those values to humantime strings, e.g.:

    text_delay  = "3ms"
    code_delay  = "500us"
    max_latency = "200ms"

Signed-off-by: Jean Mertz <git@jeanmertz.com>
@JeanMertz JeanMertz merged commit 11b4195 into main May 16, 2026
14 checks passed
@JeanMertz JeanMertz deleted the prr216 branch May 16, 2026 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant