Commit e006048
##### Description of Change
Two small chat-UX affordances for the LIF Advisor:
**1. Quick-reply option buttons.** When the assistant offers choices,
the user can tap a button instead of typing. The agent marks suggested
replies by wrapping each in double angle brackets (`<<Yes>>`, `<<Tell me
more about credentials>>`); the frontend parses them out
(`extractOptions`), strips the markers from the displayed text, and
renders tappable buttons wired to the existing `sendMessage` path.
Buttons disable while the agent is typing / logging out.
**2. Markdown links as buttons.** Links in answers render as styled
external-link buttons (`target="_blank"`, `rel="noreferrer"`, lucide
`ExternalLink`) via a `react-markdown` `components.a` override, instead
of plain inline text.
**Prompt change (per scope decision):** the buttons only appear if the
agent emits the `<<...>>` markers, so this PR also extends the prompts
to produce them — a natural extension of behavior they already have:
- `continue_conversation.txt`: step 5 already asks for a yes/no
follow-up phrased as a suggested next step; added a step 6 to offer 2–4
quick-reply options wrapped in `<<...>>`.
- `load_profile.txt`: the opening message already suggests conversation
pathways; added an instruction to surface 2–4 as `<<...>>` starters.
The rendering is a safe no-op when no markers are present, so the
frontend degrades cleanly if the model omits them.
##### Implementation notes
- Files: `utils/helpers.ts` (`extractOptions`),
`components/MessageItem.tsx` (buttons + link override),
`components/MessageList.tsx` + `components/ChatInterface.tsx` (thread
`onOptionClick`/`disabled`), and the two prompt templates. Disjoint from
the open #972 / #974 PRs (no shared files) — no merge conflicts.
##### How to test
- Frontend: `npm ci && npx tsc --noEmit -p tsconfig.app.json` (changed
files clean) and `npm run build` (passes). Manually: when the agent ends
with `<<…>>` options, they render as buttons; clicking sends that text.
- The agent prompt change should be sanity-checked against the live LLM
(option phrasing/quantity) before/after merge — it's wording guidance,
not deterministic.
##### Related Issues
Closes #971
##### Type of Change
- [x] New feature (non-breaking change which adds functionality)
##### Project Area(s) Affected
- [x] frontends/
- [x] components/ (prompt templates)
---
##### Checklist
- [x] commit message follows commit guidelines (see
commitlint.config.mjs)
- [x] code passes formatting checks (prompts: cspell/pre-commit pass;
frontend: tsc + vite build)
- [x] pre-commit hooks have been run successfully (cspell, ty, pytest)
##### Testing
- [x] Manual testing performed (rendering)
- [ ] Automated tests — no frontend test runner in the repo;
`extractOptions` is a pure helper reviewed by hand. (Adding a frontend
test harness is tracked separately in #981's spirit.)
##### Additional Notes
Known pre-existing: `tsc --noEmit` reports two unused-import errors in
`App.tsx` (`useEffect`, `jwtDecode`) from the commented-out refresh
block on `main` — unrelated to this PR and already fixed by #972. The
advisor frontend has no `tsc`/lint CI gate today (filed as #981).
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent f97b640 commit e006048
11 files changed
Lines changed: 1387 additions & 47 deletions
File tree
- components/lif/langchain_agent/prompts
- frontends/lif_advisor_app
- src
- components
- hooks
- utils
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
0 commit comments