From 312a460107f98ba0e2f164f314afab5a11f903bf Mon Sep 17 00:00:00 2001 From: Yvonne Yao Date: Sat, 29 Aug 2026 12:52:49 +1000 Subject: [PATCH 1/2] feat: clarify selected StayLong intake examples --- frontend/src/App.css | 3 +++ frontend/src/App.test.tsx | 13 +++++++++++++ frontend/src/App.tsx | 31 ++++++++++++++++++++++++++++++- 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/frontend/src/App.css b/frontend/src/App.css index 65ce4a7..db911e9 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -48,6 +48,9 @@ h1 { max-width: 650px; margin-bottom: 16px; font-size: clamp(2.15rem, 3.5vw, 2.5 .example-option { min-height: 48px; border: 2px solid color-mix(in srgb, var(--moss) 45%, transparent); border-radius: 999px; padding: 10px 17px; color: var(--moss); background: color-mix(in srgb, var(--paper) 70%, transparent); cursor: pointer; font-weight: 750; transition: border-color 160ms ease, background 160ms ease, transform 160ms ease; } .example-option:hover { border-color: var(--terracotta); transform: translateY(-1px); } .example-option[aria-pressed="true"] { border-color: var(--moss); color: var(--sand); background: var(--moss); } +.selected-example { margin: 16px 0; border-radius: 18px; padding: 14px 16px; color: var(--moss); background: color-mix(in srgb, var(--sand) 72%, transparent); } +.selected-example p { margin: 0; line-height: 1.45; } +.selected-example p:first-child { margin-bottom: 4px; font-weight: 800; } .input-group { margin-bottom: 12px; } textarea, input { display: block; width: 100%; border: 2px solid color-mix(in srgb, var(--moss) 40%, transparent); border-radius: 17px; padding: 15px 17px; color: var(--moss); background: var(--paper); line-height: 1.55; } textarea { min-height: 100px; resize: vertical; } diff --git a/frontend/src/App.test.tsx b/frontend/src/App.test.tsx index 2d0d4ff..04b11f0 100644 --- a/frontend/src/App.test.tsx +++ b/frontend/src/App.test.tsx @@ -99,6 +99,19 @@ describe('StayLong Continuous Home Path', () => { expect(screen.getByText('If anyone is in immediate danger, call 000.')).toBeVisible() }) + it('turns a chosen example into an editable starting point', async () => { + const user = userEvent.setup() + render() + + await user.click(screen.getByRole('button', { name: 'Night-time bathroom' })) + + expect(screen.getByText('You chose: Night-time bathroom')).toBeVisible() + expect(screen.getByText('We’ve added a starting point below — change the words so they sound like you.')).toBeVisible() + expect(screen.getByRole('textbox', { name: 'Describe what is becoming difficult' })).toHaveValue( + 'I’m finding it harder to reach the bathroom safely at night. The hallway is dark and there are no rails near the toilet.', + ) + }) + it('shows an assessment pack and user-controlled action before approval', async () => { const user = userEvent.setup() const fetchMock = stubWorkflowFetches() diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index caf450c..80cb7d1 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -31,6 +31,7 @@ function App() { useEffect(() => { document.title = 'StayLong | Independent living, coordinated' }, []) const step = view === 'intake' ? 2 : view === 'plan' ? workflow?.stage === 'follow_through' ? 4 : 3 : 1 const actions = workflow?.proposed_actions.length ? workflow.proposed_actions : workflow?.proposed_action ? [workflow.proposed_action] : [] + const selectedExample = examples.find(([, summary]) => summary === concern)?.[0] const publicMode = import.meta.env.VITE_STAYLONG_API_MODE === 'public-sandbox' async function request(path: string, body?: object) { const url = publicMode ? `${apiBaseUrl}/v1/public${path.slice('/v1'.length)}` : `${apiBaseUrl}${path}` @@ -62,7 +63,35 @@ function App() { setMessage(result ? '' : 'This action is waiting for you.') } catch (error) { setMessage(error instanceof Error ? error.message : 'Something went wrong.') } finally { setBusy(false) } } - return
Skip to main content
StayLong

Independent living, coordinated

Step {step} of 4

{view === 'concern' &&

Start with what you notice

What would make home easier today?

Choose an example or describe what is becoming difficult in your own words.

{examples.map(([label, summary]) => )}