Answer page tidy-up: amber line under a shorter notice, square chips, plain rows

Merged
BI
1mo ago
+318-98

User description

Summary

Before: When the model could not write an answer, a grey sentence sat above the question. The limitations chip read "Source-only · 3 limitations" next to a rounded support chip of a different size. "How this answer was built" was a small triangle link above the question, the library block was a heavy tray with its count hidden on phones, and the overseas notice ran to two lines.

After: The question comes first. A provider failure shows as a centred amber "AI summary unavailable" line directly under a one-line, centred overseas notice ("Sent to OpenAI overseas. Don't include patient details."). The limitations chip reads "Source-only", and both chips share one square shape and size. "How this answer was built" and "Also in your library · N" are plain rows under the actions.

Only provider failures move to the amber line. Every other degraded reason says something about the evidence (conflict, reduced retrieval, coverage gap), so it keeps its full sentence above the answer. The full provider reason stays as screen-reader text. The limitations count stays in the chip's accessible name and in the sheet, and it is still shown when there is no "Source-only" or "Review due" prefix. "How this answer was built" still appears only when an answer took an unusual route. The progress section and its "Answer ready." live region stay where they are.

How: There is a new AnswerSummaryUnavailableNotice and an answerSummaryUnavailableReason helper in answer-provider-notice.tsx. They are shared by the surface, which hides its top sentence, and the dashboard, which shows the line. AnswerBuildDetails was split out of AnswerProgress. The visible chip text drops a trailing count. src/lib/rag/rag-fallback-reason.ts is imported only and is not edited.

Owner decision recorded in docs/decisions/2026-10-17-answer-page-tidy-up.md. This builds on the mockup the owner approved in the project thread.

Verification

  • Checks run: tsc (typecheck config) exit 0. eslint on the changed files exit 0. npm run test:focused came back 446 passed, with the one failure fixed and then passing (answer-clipboard-product-path.dom.test.tsx 15 passed). The full verify:cheap was still running at push time.
  • Browser specs updated, not run locally: tests/ui-smoke.spec.ts (count now pinned on the aria-label) and tests/answer-progress-ui-smoke.spec.ts (disclosure now under answer-build-details). CI runs them when the PR is marked ready.

Risk and rollout

  • Risk: Low. The change is display only, with no retrieval, database or provider change. The overseas privacy notice wording changed at the owner's request.
  • Rollback: Revert the PR.
  • Provider or production effects: None.

Notes

  • This is separate from #3601 (source carousel). The home-page copy of the notice is shared and gets the new wording, but it is not centred there.

Generated by Claude Code

Summary by cubic

Tidies up the Answer page: a provider failure now shows as a centred amber "AI summary unavailable" line under a shortened overseas notice, the limitation and support chips share one square shape, and "How this answer was built" and "Also in your library" became plain rows under the answer actions.

Only provider failures move to the amber line, and only when at least one source is confirmed. A retrieval deadline confirms no evidence, so it keeps its full sentence above the answer, which now says source evidence could not be confirmed instead of promising verified passages. The full provider reason stays as screen-reader text. The build disclosure now lives inside the answer surface, fed by the progress history captured synchronously before the final payload returns, so a later failed request cannot replace it. The overseas notice under an answer reads "Sent to OpenAI overseas. Don't include patient details."; the line no longer shows on the Answer home at all.

Migration

  • Display-only change: no data, retrieval, or provider effects; revert to roll back.

Summary by CodeRabbit

  • New Features
    • Added an answer-level “How this answer was built” disclosure for answers that took an unusual route.
    • Added a clear notice when an AI summary is unavailable, including the reason where relevant.
  • Updates
    • Shortened the overseas provider notice and refined answer status chips, limitation counts, and the library row’s layout.
    • Kept answer progress and completion messaging distinct from the answer-build details.

CodeAnt-AI Description

Clarify answer warnings and simplify the answer page

What Changed

  • Provider-generation failures now show an amber “AI summary unavailable” line below the overseas notice, keeping the question from being pushed down. Evidence-related warnings remain above the answer.
  • Retrieval timeouts with no confirmed sources now explain that evidence could not be confirmed, rather than implying verified passages are available.
  • The overseas notice is shorter; answer-building details and library links appear in simpler rows, with the library count visible on phones.
  • Support and limitations chips now share a square shape and size. Limitation counts are omitted from visible chip text when a status prefix is present, but remain available to screen readers.

Impact

✅ Less warning text above the question
✅ Clearer retrieval-timeout guidance
✅ Visible library counts on phones

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.