NL query: AI chat panel on the preview page - #52
Open
Ayobamiu wants to merge 2 commits into
Open
Conversation
- apiClient.nlQuery() -> POST /nlquery - /query workspace page: text box -> results table + interpreted-filter echo + CSV export Co-Authored-By: Claude Opus 4.8 <[email protected]>
Reusable conversational chat UI over the /nlquery/chat backend. - AiChatPanel: message list, scope-aware starter chips, composer, render_view detail table + CSV export, markdown-rendered assistant replies (react-markdown + remark-gfm). Loads history on open. - api client: NlChat* types + nlChatHistory()/nlChat(). - preview page: two entry points — footer button with dynamic copy per view (all records / a document type / all files / one file), and a "Ask AI" button in the record drawer next to Compare. Resizable via antd Splitter; when both Compare + AI are open the drawer squeezes into a 3-way [pdf · record · ai] split rather than excluding either. Gated on auth (the preview page is public; chat is authed + org-scoped). Verified live in the browser against prod data across all four contexts + the drawer squeeze. tsc clean (pre-existing Button.tsx error unrelated). Co-Authored-By: Claude Opus 4.8 <[email protected]>
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.
The web UI for natural-language chat over extracted data. Pairs with the backend PR in the
airepo (POST/GET /nlquery/chat).What's here
AiChatPanel(src/components/nlquery/AiChatPanel.tsx): reusable chat panel — message list, scope-aware starter-question chips, composer,render_viewdetail table with CSV export, and markdown-rendered assistant replies (react-markdown + remark-gfm, since the agent emits tables/headers). Loads conversation history on open.src/lib/api.ts):NlChatScope/View/Message/History/Turntypes +nlChatHistory()/nlChat().src/app/preview/[id]/page.tsx): two entry points —Splitter. When both Compare and AI are open, the drawer goes full-width and squeezes into a 3-way [PDF · record · AI] split rather than making them mutually exclusive.Also includes
The lean standalone
/querypage +apiClient.nlQuery()(one-shot NL query → table), from earlier in the effort.Verification
Driven live in the browser (logged-in, prod data) across all four preview contexts and the record-drawer Compare+AI squeeze: dynamic button copy, data-aware starters, grounded replies, render_view table + CSV, history persist/reload.
tscclean apart from a pre-existing unrelatedButton.tsxerror.🤖 Generated with Claude Code