Skip to content

feat(chat): show nine welcome questions and move the logo to the header (AMUL-72) - #166

Merged
KDwevedi merged 1 commit into
OpenAgriNet:amul-devfrom
vrajshah24:feat/amul-72-dev
Sep 8, 2026
Merged

feat(chat): show nine welcome questions and move the logo to the header (AMUL-72)#166
KDwevedi merged 1 commit into
OpenAgriNet:amul-devfrom
vrajshah24:feat/amul-72-dev

Conversation

@vrajshah24

Copy link
Copy Markdown

Implements the AMUL-72 change request. Same change as #165 (which targets amul-prod); this is the amul-dev copy, cherry-picked onto this branch because amul-prod and amul-dev have diverged.

Content

  • Removes the tomato-only APMC question (fixedQuestion).
  • Adds the four questions from the change request: monthly earnings, milk union / Gujarat / India scheme details, multi-commodity APMC prices, and mandali bonus calculation.

The welcome list is now 2 pinned → FAQ card → those four → 3 random, i.e. nine questions plus the FAQ card (QUICK_ACTION_COUNT 5 → 10). fixedQuestion becomes fixedQuestions (array); ids stay unique across both the static and template branches.

The icon keyword map is reordered so the money and scheme rows match before the broad પશુ/દૂધ cow keywords that the new questions also contain — otherwise the schemes card would have drawn 🐮, and the new cards would have picked a random emoji.

Layout

Per the annotated mock, the pulsating logo and the red "Amul AI" wordmark move out of the welcome panel and into the sticky header. The doctor persona keeps its plain-text title. The greeting and the cards use a tighter type scale below the sm breakpoint; desktop is unchanged.

Difference from #165

One conflict, in welcome-panel.tsx: amul-prod marks the FAQ-opener card with a Send icon (AMUL-62), amul-dev does not. Resolved in favour of this branch — the card keeps no send icon here, and the Send import stays absent. Everything else is identical to #165.

Verification

Layout measured over the Chrome DevTools Protocol at real mobile viewports (throwaway harness rendering the real ChatHeader / WelcomePanel / ChatInput):

viewport before after
360×640 2 of 5 10 of 10
375×667 10 of 10
390×780 5 of 5 10 of 10
412×915 10 of 10
320×568 6 of 10

320×568 (iPhone SE 1st gen) is the one size that does not reach nine.

eslint (0 errors) and vitest (28 passed) pass. tsc -b and vite build could not be completed locally: html2pdf.js is declared in package.json but absent from node_modules, and npm install cannot resolve it here (the repo is on bun). This fails identically on clean origin/amul-dev, in html-document-artifact.tsx, a file this PR does not touch — please confirm CI is green.

Reviewer notes

  • The Hindi and English wording of the four new questions is a translation of the Gujarati supplied in the change request — worth a native check.
  • The document spelled the schemes question યોજનનોની; corrected to યોજનાઓની. Stray spaces before commas and question marks were normalised. Wording is otherwise verbatim.
  • ગયા મહિના અને ચાલુ મહિના... આવક અને કપાત is still in the random pool and overlaps the new earnings question, so both can occasionally appear together. Left in place — the change request did not ask to remove it.
  • The four new questions were not added to the FAQ drawer; the change request only covered the welcome screen.

🤖 Generated with Claude Code

https://claude.ai/code/session_017nqpBEd3wDnLv5mqkmQpJv

…er (AMUL-72)

Per the change request, the welcome screen drops the tomato-only APMC
question and gains four: monthly earnings, milk union / Gujarat / India
scheme details, multi-commodity APMC prices, and mandali bonus
calculation. The list is now 2 pinned -> FAQ card -> those four ->
3 random, so nine questions plus the FAQ card.

To fit them on a phone, the pulsating logo and the "Amul AI" wordmark
move out of the welcome panel and into the sticky header (the doctor
persona keeps its plain-text title), and the greeting and cards use a
tighter type scale below the sm breakpoint. Desktop is unchanged.

`fixedQuestion` becomes `fixedQuestions` (array). The icon keyword map
is reordered so the money and scheme rows match before the broad
"પશુ"/"દૂધ" cow keywords that the new questions also contain.

Measured over CDP at real mobile viewports: all ten rows are fully
visible at 360x640, 375x667, 390x780 and 412x915 (was 2 of 5 at
360x640). 320x568 fits six.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017nqpBEd3wDnLv5mqkmQpJv

@KDwevedi KDwevedi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving — the FE work is clean and honestly documented. Verified locally on the merge head: tsc -b clean, vitest 28/28, eslint src 0 errors (only the pre-existing no-unused-vars warnings on untouched files), vite build OK. Id sequencing after the fixedQuestionfixedQuestions change is still unique (1–2 pinned, 3 FAQ, 4–7 fixed, 8–10 random) and randomCount (10 − 2 − 1 − 4 = 3) is right.

Merging to dev so it can be exercised, but the following need to be settled before this is promoted to prod.

1. The schemes card is not answerable by the current backend

"…દૂધ સંઘ, ગુજરાત સરકાર અને ભારત સરકારની બધી યોજનાઓની વિગતવાર માહિતી આપો" asks for three tiers, and no tier is reliably served today:

  • Union tierprepare_get_union_scheme_data hides the tool unless the farmer resolves to banas/kutch/sumul/surendranagar. ~98% of cached farmer records have an empty unionName, and dudhsagar dominates the rest, so for most farmers the tool is not even in the schema.
  • Central tierget_vistaar_scheme_info is registered on both envs (ENABLE_NETWORK=true), but it's one scheme_code per call from a closed 15-code Literal, none of which is animal husbandry (પશુપાલન). Measured on the #221 dev re-run: across all 39 get_union_scheme_data calls resolve_scheme_code returned None every time, and 0 of 16 open-ended "what schemes can I get" answers mentioned a single central scheme. The BV BPP has no generic scheme search, so no free-text phrasing reaches it.
  • Gujarat state tier — no tool at all; only iKhedut PDFs via search_documents, which is the known mojibake → invented-₹-amount path.

There's also a routing trap: the "for a central scheme use get_vistaar_scheme_info" redirect lives inside get_union_scheme_data's docstring, which prepare deletes from the schema in exactly the unsupported-union case where the model most needs it. And on the signed-out path the 08-12 run caught the model stating "1.80 લાખ" for a dairy scheme with no tool output behind it.

The question itself is a good demand signal — it matches the ~31 withheld scheme attempts/day we already measure. But pinning it puts a one-tap fabrication risk on the landing screen for every farmer. Please exercise this card on dev across signed-in (banas + dudhsagar) and signed-out, and let's look at the answers before #165 goes to prod.

2. English earnings card draws a random emoji

KEYWORD_ICON_MAP has earning/income, but the en string is "How much have I earned in total…" — no substring match, and nothing else in that sentence hits any rule, so pickIconForQuestion falls through to randomPick and the icon changes on every render. gu (કમાણી) and hi (कमाई) are fine. One-word fix: add earned to the wheat keyword list.

3. Three of the four new cards resolve to wheat = 💰

Earnings, APMC prices and bonus all match the wheat row, so the list shows three identical money bags. Distinct icons were the point of the map reorder — worth splitting a money vs market row.

4. mr.json loses fixedQuestion with no replacement

Marathi isn't in this repo's config.json languages so there's no Amul impact, but LanguageProvider falls back to English per key, so any bh-*/Vistaar build that enables mr will render these four cards in English. Either add an mr array or note it as intentional.

5. No test covers buildQuickActions

The 28 passing tests are smoke/persona/markdown. This logic just went from one fixed question to N with three interacting counts; I checked id uniqueness and randomCount by hand, but nothing guards a regression. A small unit test over buildQuickActions with a stub t would be cheap.

Also noting for the promotion, not this PR: #164 (feat/split-faq-landing-cards) reworks the same landing cards on amul-dev and will conflict; and #157 (the Send-icon backmerge) is still open, which is why this branch's diff differs slightly from #165's.

Author-disclosed and fine by me: 320×568 fits only 6 of 10; the gu earnings question overlaps a random-pool question so both can co-occur; the four new questions aren't in the FAQ drawer.

@KDwevedi
KDwevedi merged commit fd93880 into OpenAgriNet:amul-dev Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants