feat(ai-export): add intro, chart descriptions, and strategy link (#553)#570
Merged
Conversation
Expands the "Copy for AI assistant" export with three sections aimed at the AI reading it: - "## About this summary" intro: what the document is and how to use it (answer from the figures, show work, link or embed the charts). - "## Interactive charts" reframed to recommend linking/embedding, with a one-line "what it shows" description per chart (filing-age, indexed earnings, bend points, couple filing-age). - "## Find the optimal filing age": a pre-filled https://ssa.tools/strategy deep link plus a short description of the optimizer. Adds a wrapText helper so the interpolated prose wraps evenly (~76 cols) for the copy preview, and derives the /strategy base from the calculator baseUrl.
Deploying social-security-tools with
|
| Latest commit: |
1953392
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://18a406d9.social-security-tools.pages.dev |
| Branch Preview URL: | https://worktree-feat-553-ai-export-d0iv.social-security-tools.pages.dev |
- wrapText: collapse runs of whitespace (split on / +/) so it is robust to its own callers, and export it for direct unit testing (matching renderTable). Adds tests: wrap width, overlong word emitted whole, whitespace collapse, empty input. - Add coverage for the two new branchy helpers: the strategyBase non-/calculator baseUrl fallback, and the subjectName "this person" fallback (unnamed recipient must not emit an empty possessive or leak Self/Spouse sentinels). - Comment accuracy: "possessive-ready" -> a phrase callers suffix with "'s"; CHART_DESCRIPTIONS "One-line" -> short blurb (wrapped by wrapText at render).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expands the "Copy for AI assistant" markdown export with three additions aimed at the AI assistant reading the document, requested as a follow-up to the calculator button (#553).
## About this summaryintro — orients the AI: what the document is (a complete, self-contained benefit derivation), and how to use it (answer from the figures, show your work, link to or embed the charts, point to the strategy optimizer). Single and couple variants.## Interactive chartsreframed — the intro now recommends linking to or embedding the relevant chart directly in answers, and each chart gets a one-line "what it shows" description (filing-age, indexed earnings, bend points, couple filing-age).## Find the optimal filing age— a pre-filledhttps://ssa.tools/strategydeep link with a short description of the optimizer. The/strategybase is derived from the calculatorbaseUrl(sibling paths), and reuses the existing per-recipient/couple URL hash.Also adds a small
wrapTexthelper so the interpolated prose wraps evenly (~76 cols) — keeps the copy-preview readable regardless of name length.Testing
/strategyderivation). Prose assertions normalize whitespace so they aren't coupled to wrap positions.npm run qualityclean (Biome + svelte-check 0/0).Notes
No behavior change to the button/modal — this is purely the exported text. The builder remains clock-free and deterministic.