Skip to content

feat: speak a placeholder for code blocks in normalize#45

Merged
StuBehan merged 1 commit into
mainfrom
feat/code-block-placeholder
Jul 17, 2026
Merged

feat: speak a placeholder for code blocks in normalize#45
StuBehan merged 1 commit into
mainfrom
feat/code-block-placeholder

Conversation

@StuBehan

Copy link
Copy Markdown
Collaborator

Summary

Fenced code blocks were dropped silently, so a spoken response with a code block jumps straight from the setup to the follow-up and sounds disjointed. Add a placeholder mode so a skipped block is announced instead (ChatGPT-style: "you can see the code in the chat history").

Changes

  • normalize_for_speech(..., code_blocks="placeholder", code_placeholder=...) and CLI --code-blocks {drop,placeholder} / --code-placeholder TEXT.
  • Each fenced block becomes a caller-supplied placeholder line; default stays drop so existing callers are unchanged.
  • The placeholder text is caller-supplied (neutral default "Code block.") — "chat history" wording belongs to the consumer, not stackvox.
  • Consecutive code blocks collapse to a single placeholder.

Testing

  • 5 new tests (placeholder substitution, consecutive-collapse, end-to-end, and drop-by-default unchanged).
  • ruff check + ruff format --check clean; mypy clean; pytest — 200 passed.

Mirrors the existing tables="drop"|"csv" knob. CHANGELOG.md untouched — release-please owns it.

@StuBehan
StuBehan force-pushed the feat/code-block-placeholder branch from 1052f72 to 55e73f4 Compare July 17, 2026 14:52
@StuBehan
StuBehan force-pushed the feat/code-block-placeholder branch from 55e73f4 to e2506df Compare July 17, 2026 19:00
@StuBehan
StuBehan merged commit 431ce5c into main Jul 17, 2026
10 checks passed
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