From 05e72f8b00de119a391455e971f172eef2ff3d38 Mon Sep 17 00:00:00 2001 From: Ayyub I Date: Wed, 1 Nov 2023 20:49:05 -0500 Subject: [PATCH 1/3] modified landing page per a changs recs: modified background color of rotating words suggested to user; removed get answer button --- packages/web/components/HomeBanner.tsx | 4 ++-- packages/web/components/NewQuery.tsx | 15 +++------------ 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/packages/web/components/HomeBanner.tsx b/packages/web/components/HomeBanner.tsx index d1a7aaeb..6edf01cd 100644 --- a/packages/web/components/HomeBanner.tsx +++ b/packages/web/components/HomeBanner.tsx @@ -20,9 +20,9 @@ export default function HomeBanner() {
-

What New Orleans City Council is doing

+

What New Orleans City Council is doing about

- about {word} + {word}?

diff --git a/packages/web/components/NewQuery.tsx b/packages/web/components/NewQuery.tsx index 62d36a0a..578145d0 100644 --- a/packages/web/components/NewQuery.tsx +++ b/packages/web/components/NewQuery.tsx @@ -143,7 +143,7 @@ export default function NewQuery() {
) => { setQuery(e.currentTarget.value); }} - > + />
-
From 24e25fd892f7d11c51fef0eb10a1d8e0a23d3ae8 Mon Sep 17 00:00:00 2001 From: Ayyub I Date: Wed, 1 Nov 2023 21:43:46 -0500 Subject: [PATCH 2/3] modification: show citations is now bold --- packages/web/components/BetaCard.tsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/web/components/BetaCard.tsx b/packages/web/components/BetaCard.tsx index 39726e20..3fbd8cb3 100644 --- a/packages/web/components/BetaCard.tsx +++ b/packages/web/components/BetaCard.tsx @@ -149,12 +149,13 @@ const BetaCard = ({ card }: { card: ICard }) => { {/* Citations Section */}
- + {showCitations && (
From 38a292dbdb0b397f77821afd1c6c182f410b1056 Mon Sep 17 00:00:00 2001 From: Ayyub I Date: Wed, 1 Nov 2023 22:03:30 -0500 Subject: [PATCH 3/3] modification: return/enter key should submit query on mobile devices --- packages/web/components/NewQuery.tsx | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/web/components/NewQuery.tsx b/packages/web/components/NewQuery.tsx index 578145d0..545bff34 100644 --- a/packages/web/components/NewQuery.tsx +++ b/packages/web/components/NewQuery.tsx @@ -125,8 +125,8 @@ export default function NewQuery() { } }; - const submitQuery = async (e: React.FormEvent) => { - e.preventDefault(); + const submitQuery = async (e?: React.FormEvent) => { + e?.preventDefault(); if (query.length <= 10) return; @@ -135,7 +135,7 @@ export default function NewQuery() { const newCard = await insertSupabaseCard(); const cardWResp = await sendQueryToFunction(newCard); addMyCard(cardWResp); - await updateQueryResponded(cardWResp, startedProcessingAt); + await updateQueryResponded(cardWResp, startedProcessingAt); }; return ( @@ -154,13 +154,17 @@ export default function NewQuery() { placeholder={`Ask ${APP_NAME} a question`} autoFocus disabled={isProcessing} - onChange={(e: React.FormEvent) => { - setQuery(e.currentTarget.value); + onChange={(e) => setQuery(e.currentTarget.value)} + onKeyDown={(e) => { + if (e.key === 'Enter') { + e.preventDefault(); + submitQuery(); + } }} />
- +
{card?.citations?.map((citation, index) => (