fix(frontend): surface AI provider-required state and field-level validation errors (#177, #180) - #213
Merged
parthrohit22 merged 1 commit intoJul 27, 2026
Conversation
…idation errors - AIWorkspacePage now shows a prominent 'No AI provider configured' notice (links to Settings) instead of only a weak footer hint, so the surface is not misleading when it cannot run (issue Second-Origin#177). - errors.ts getErrorMessage/getErrorDetail now surface field-level validation details from 422 bodies instead of collapsing to the generic 'Request validation failed' message (issue Second-Origin#180). - useAIWorkspace fetches /ai/config to expose providerConfigured; the workspace error box renders structured field errors. - Test + lint green; build passes. Note: Second-Origin#177's literal 'reads legacy context' claim was already corrected in the UI copy (it now states sealed-snapshot structural facts); this PR adds the missing explicit provider-required state.
parthrohit22
force-pushed
the
fix/177-180-frontend-honesty
branch
from
July 27, 2026 12:40
4b9343d to
dc9fce9
Compare
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
Two frontend honesty/UX fixes in the AI Workspace surface: (1) when no AI provider is configured, the page now shows a prominent notice linking to Settings instead of only a weak footer hint, so the Preview surface is not misleading about being inert (#177); (2) validation errors from the API are no longer collapsed into a generic "Request validation failed" string — field-level
detailsfrom 422 responses are surfaced to the user (#180).Linked issue
Related to #177 (AI Workspace inert state) and #180 (validation error collapse). Closes #177 and #180.
Roadmap alignment
build:frontendsucceeds; the error box now rendersgetErrorDetail(...).detailswhen present.What changed
apps/frontend/src/shared/services/api/errors.ts:getErrorMessageand newgetErrorDetailextract field-leveldetailsfrom 422 bodies (FastAPIloc/msgshape) and append them instead of collapsing.apps/frontend/src/shared/services/api/index.ts: exportgetErrorDetail.apps/frontend/src/features/ai/hooks/useAIWorkspace.ts: fetch/ai/configon mount to exposeproviderConfigured.apps/frontend/src/app/pages/AIWorkspacePage.tsx: prominent amber "No AI provider configured → Settings" notice; error box renders structured field errors.apps/frontend/src/features/ai/hooks/useAIWorkspace.test.tsx: mockgetConfigfor the new mount effect.Acceptance criteria completed
Testing performed
Screenshots
Not applicable (logic/state change; no new visual assets). The provider-required notice reuses existing
PreviewBanner-compatible styling.Security and data considerations
None (client-side error presentation only; no secrets, no new API surface).
Dependencies and blocked work
None.
Scope changes or remaining work
#177's literal "reads legacy context" claim was already corrected in prior UI copy (it states sealed-snapshot structural facts). This PR adds the missing explicit provider-required state. No scope added beyond #177/#180.
Contributor checklist
devupstream/devCloses) is used only because the issue is fully resolved