From 1db67b1048c36d453f628ebd0c12b57947ce8a1a Mon Sep 17 00:00:00 2001 From: SimpleTest Date: Wed, 22 Jul 2026 17:20:30 +0300 Subject: [PATCH] fix: align accessible UI and browser coverage --- e2e/tests/activity-moderation.spec.ts | 26 ++++++++++++------- e2e/tests/localization.spec.ts | 8 ++++-- e2e/tests/public.spec.ts | 4 +-- .../components/core_components.ex | 8 +++--- .../content_removal_html/index.html.heex | 2 +- .../content_removal_html/new.html.heex | 4 +-- .../content_removal_html/show.html.heex | 4 +-- .../take_it_down.html.heex | 2 +- .../controllers/page_html/home.html.heex | 2 +- .../support_html/delete_account.html.heex | 2 +- .../controllers/support_html/index.html.heex | 2 +- .../controllers/support_html/new.html.heex | 4 +-- .../controllers/support_html/show.html.heex | 4 +-- .../user_registration_html/new.html.heex | 2 +- .../user_session_html/new.html.heex | 2 +- .../user_settings_html/edit.html.heex | 2 +- .../live/activity_live/index.ex | 2 +- .../live/category_proposal_live.ex | 2 +- .../live/leaderboard_live.ex | 2 +- lib/who_need_help_web/live/moderation_live.ex | 2 +- lib/who_need_help_web/live/profile_live.ex | 10 +++---- .../live/public_profile_live.ex | 10 +++---- .../live/request_live/index.ex | 2 +- .../live/request_live/show.ex | 4 +-- .../live/support_operations_live.ex | 6 ++--- 25 files changed, 65 insertions(+), 53 deletions(-) diff --git a/e2e/tests/activity-moderation.spec.ts b/e2e/tests/activity-moderation.spec.ts index 846ede1..bdd4141 100644 --- a/e2e/tests/activity-moderation.spec.ts +++ b/e2e/tests/activity-moderation.spec.ts @@ -63,12 +63,16 @@ test("activity approval, privacy controls, reporting, and moderation work end to .getByLabel("Plan and expectations") .fill("Meet at a public café for an hour of safe conversation."); - const startsAt = new Date(Date.now() + 4 * 60 * 60 * 1000).toISOString().slice(0, 16); - const joinDeadline = new Date(Date.now() + 2 * 60 * 60 * 1000) - .toISOString() - .slice(0, 16); - await organizer.page.getByLabel("Starts at (UTC)").fill(startsAt); - await organizer.page.getByLabel("Join requests close (UTC)").fill(joinDeadline); + const startsAt = new Date(Date.now() + 4 * 60 * 60 * 1000).toISOString(); + const joinDeadline = new Date(Date.now() + 2 * 60 * 60 * 1000).toISOString(); + const startsAtPicker = organizer.page.getByRole("group", { name: "Starts at" }); + const joinDeadlinePicker = organizer.page.getByRole("group", { + name: "Join requests close", + }); + await startsAtPicker.getByLabel("Date").fill(startsAt.slice(0, 10)); + await startsAtPicker.getByLabel("Time").fill(startsAt.slice(11, 16)); + await joinDeadlinePicker.getByLabel("Date").fill(joinDeadline.slice(0, 10)); + await joinDeadlinePicker.getByLabel("Time").fill(joinDeadline.slice(11, 16)); await organizer.page.getByLabel("Total group capacity").fill("3"); await organizer.page .getByLabel("Approximate public meeting area") @@ -173,9 +177,13 @@ test("activity approval, privacy controls, reporting, and moderation work end to await expect(socialSection.getByText("No social links added.")).toBeVisible(); await gotoLiveView(participant.page, "/requests/new"); - await expect(participant.page.getByLabel("Location visibility")).toHaveValue( - "exact_for_active_match", - ); + const requestVisibility = participant.page.getByRole("group", { + name: "What should people see?", + }); + await expect( + requestVisibility.getByRole("radio", { name: /Approximate area/ }), + ).toBeChecked(); + await expect(participant.page.getByText("After a helper accepts")).toBeVisible(); const adminEmail = process.env.E2E_ADMIN_EMAIL ?? "e2e-admin@example.invalid"; const admin = diff --git a/e2e/tests/localization.spec.ts b/e2e/tests/localization.spec.ts index 340568e..da071a8 100644 --- a/e2e/tests/localization.spec.ts +++ b/e2e/tests/localization.spec.ts @@ -12,14 +12,18 @@ test("public language selection persists across pages", async ({ browser }) => { await page.goto("/?locale=ru"); await expect(page.locator("html")).toHaveAttribute("lang", "ru"); - await expect(page.getByRole("heading", { name: "Помощь может быть ближе, чем кажется." })).toBeVisible(); + await expect( + page.getByRole("heading", { name: "Нужна помощь рядом? Обратитесь к сообществу." }), + ).toBeVisible(); await page.goto("/safety"); await expect(page.getByRole("heading", { name: "Правила безопасности" })).toBeVisible(); await page.goto("/?locale=uk"); await expect(page.locator("html")).toHaveAttribute("lang", "uk"); - await expect(page.getByRole("heading", { name: "Допомога може бути ближче, ніж здається." })).toBeVisible(); + await expect( + page.getByRole("heading", { name: "Потрібна допомога поруч? Зверніться до спільноти." }), + ).toBeVisible(); await context.close(); }); diff --git a/e2e/tests/public.spec.ts b/e2e/tests/public.spec.ts index 1ddbc31..953dfd2 100644 --- a/e2e/tests/public.spec.ts +++ b/e2e/tests/public.spec.ts @@ -8,11 +8,11 @@ test("public safety pages load and private discovery requires authentication", a await page.goto("/"); await expect( - page.getByRole("heading", { name: "Help can be closer than you think." }), + page.getByRole("heading", { name: "Need help nearby? Ask the community." }), ).toBeVisible(); await expect(page.getByText("Not an emergency or medical service.")).toBeVisible(); - await page.getByRole("link", { name: "Safety rules" }).click(); + await page.getByRole("link", { name: "Safety rules", exact: true }).click(); await expect(page.getByRole("heading", { name: "Safety rules" })).toBeVisible(); await expect(page.getByRole("heading", { name: "Medicine requests" })).toBeVisible(); diff --git a/lib/who_need_help_web/components/core_components.ex b/lib/who_need_help_web/components/core_components.ex index f5f19cf..5daf386 100644 --- a/lib/who_need_help_web/components/core_components.ex +++ b/lib/who_need_help_web/components/core_components.ex @@ -399,8 +399,8 @@ defmodule WhoNeedHelpWeb.CoreComponents do |> assign(:errors, Enum.map(errors, &translate_error(&1))) ~H""" -
- {@label} +
+ {@label}
-

+

{gettext("Your time zone:")}

<.error :for={msg <- @errors}>{msg} - + """ end diff --git a/lib/who_need_help_web/controllers/content_removal_html/index.html.heex b/lib/who_need_help_web/controllers/content_removal_html/index.html.heex index 68f5d2b..e0b7bcb 100644 --- a/lib/who_need_help_web/controllers/content_removal_html/index.html.heex +++ b/lib/who_need_help_web/controllers/content_removal_html/index.html.heex @@ -31,7 +31,7 @@ ]}> {status_label(notice.status)} - {category_label(notice.category)} + {category_label(notice.category)}

{notice.explanation}

diff --git a/lib/who_need_help_web/controllers/content_removal_html/new.html.heex b/lib/who_need_help_web/controllers/content_removal_html/new.html.heex index ca7ca3f..f0a9c7d 100644 --- a/lib/who_need_help_web/controllers/content_removal_html/new.html.heex +++ b/lib/who_need_help_web/controllers/content_removal_html/new.html.heex @@ -46,7 +46,7 @@ value={@contact_email || @form[:contact_email].value} readonly={not is_nil(@contact_email)} /> -

+

{gettext("Status updates go to the email address of your signed-in account.")}

<.input @@ -99,7 +99,7 @@ ) } /> -

+

{gettext( "Identity and contact fields may be omitted for reports of sexual material involving a minor. Do not include or upload the material itself." )} diff --git a/lib/who_need_help_web/controllers/content_removal_html/show.html.heex b/lib/who_need_help_web/controllers/content_removal_html/show.html.heex index e064157..9a8aea5 100644 --- a/lib/who_need_help_web/controllers/content_removal_html/show.html.heex +++ b/lib/who_need_help_web/controllers/content_removal_html/show.html.heex @@ -18,7 +18,7 @@

{gettext("Content-removal notice")}

-

{category_label(@notice.category)}

+

{category_label(@notice.category)}

{gettext("Reported locations")}

-

+

{gettext( "Keep this status link private. The submitter identity is not shown publicly or automatically disclosed to the person who posted the reported content." )} diff --git a/lib/who_need_help_web/controllers/content_removal_html/take_it_down.html.heex b/lib/who_need_help_web/controllers/content_removal_html/take_it_down.html.heex index 3ff6207..d852ced 100644 --- a/lib/who_need_help_web/controllers/content_removal_html/take_it_down.html.heex +++ b/lib/who_need_help_web/controllers/content_removal_html/take_it_down.html.heex @@ -43,7 +43,7 @@ readonly={not is_nil(@contact_email)} required /> -

+

{gettext("Status updates go to the email address of your signed-in account.")}

<.input diff --git a/lib/who_need_help_web/controllers/page_html/home.html.heex b/lib/who_need_help_web/controllers/page_html/home.html.heex index f296356..7d795a7 100644 --- a/lib/who_need_help_web/controllers/page_html/home.html.heex +++ b/lib/who_need_help_web/controllers/page_html/home.html.heex @@ -78,7 +78,7 @@
{gettext("Approximate area")}
-
+
{gettext("Exact address after matching")}
diff --git a/lib/who_need_help_web/controllers/support_html/delete_account.html.heex b/lib/who_need_help_web/controllers/support_html/delete_account.html.heex index 456b752..9483189 100644 --- a/lib/who_need_help_web/controllers/support_html/delete_account.html.heex +++ b/lib/who_need_help_web/controllers/support_html/delete_account.html.heex @@ -28,7 +28,7 @@ readonly={not is_nil(@contact_email)} required /> -

+

{gettext("This request is linked to your signed-in account and its email address.")}

<.input diff --git a/lib/who_need_help_web/controllers/support_html/index.html.heex b/lib/who_need_help_web/controllers/support_html/index.html.heex index 47fa890..97a4888 100644 --- a/lib/who_need_help_web/controllers/support_html/index.html.heex +++ b/lib/who_need_help_web/controllers/support_html/index.html.heex @@ -17,7 +17,7 @@
{request.reference} {status_label(request.status)} - {kind_label(request.kind)} + {kind_label(request.kind)}

{request.subject}

diff --git a/lib/who_need_help_web/controllers/support_html/new.html.heex b/lib/who_need_help_web/controllers/support_html/new.html.heex index 11598e4..81eb734 100644 --- a/lib/who_need_help_web/controllers/support_html/new.html.heex +++ b/lib/who_need_help_web/controllers/support_html/new.html.heex @@ -48,7 +48,7 @@ readonly={not is_nil(@contact_email)} required /> -

+

{gettext( "This request is linked to your signed-in account. Replies go to its email address." )} @@ -60,7 +60,7 @@ label={gettext("Describe the problem")} required /> -

+

{gettext( "Do not include passwords, payment card details, access codes, prescriptions, or unnecessary medical information." )} diff --git a/lib/who_need_help_web/controllers/support_html/show.html.heex b/lib/who_need_help_web/controllers/support_html/show.html.heex index bc93185..52d774f 100644 --- a/lib/who_need_help_web/controllers/support_html/show.html.heex +++ b/lib/who_need_help_web/controllers/support_html/show.html.heex @@ -5,7 +5,7 @@ {status_label(@request.status)}

{@request.subject}

-

{kind_label(@request.kind)}

+

{kind_label(@request.kind)}

{@request.details}

@@ -16,7 +16,7 @@

{gettext("Support response")}

{@request.resolution_note}

-

+

{gettext( "Keep this status link private. A copy is sent to the contact email when email delivery is configured." )} diff --git a/lib/who_need_help_web/controllers/user_registration_html/new.html.heex b/lib/who_need_help_web/controllers/user_registration_html/new.html.heex index 1f6f794..0944516 100644 --- a/lib/who_need_help_web/controllers/user_registration_html/new.html.heex +++ b/lib/who_need_help_web/controllers/user_registration_html/new.html.heex @@ -56,7 +56,7 @@ label={gettext("Sign up with Google")} disabled={!@google_auth_enabled} /> -

+

{gettext("Google sign-in will be available after the operator configures it.")}

diff --git a/lib/who_need_help_web/controllers/user_session_html/new.html.heex b/lib/who_need_help_web/controllers/user_session_html/new.html.heex index 64a428d..61c279d 100644 --- a/lib/who_need_help_web/controllers/user_session_html/new.html.heex +++ b/lib/who_need_help_web/controllers/user_session_html/new.html.heex @@ -79,7 +79,7 @@ label={gettext("Continue with Google")} disabled={!@google_auth_enabled} /> -

+

{gettext("Google sign-in will be available after the operator configures it.")}

diff --git a/lib/who_need_help_web/controllers/user_settings_html/edit.html.heex b/lib/who_need_help_web/controllers/user_settings_html/edit.html.heex index de5521c..8b3868d 100644 --- a/lib/who_need_help_web/controllers/user_settings_html/edit.html.heex +++ b/lib/who_need_help_web/controllers/user_settings_html/edit.html.heex @@ -49,7 +49,7 @@ label={gettext("Connect Google account")} disabled={!@google_auth_enabled} /> -

+

{gettext("Google sign-in will be available after the operator configures it.")}

diff --git a/lib/who_need_help_web/live/activity_live/index.ex b/lib/who_need_help_web/live/activity_live/index.ex index 9da9f8f..3fadd05 100644 --- a/lib/who_need_help_web/live/activity_live/index.ex +++ b/lib/who_need_help_web/live/activity_live/index.ex @@ -254,7 +254,7 @@ defmodule WhoNeedHelpWeb.ActivityLive.Index do
<.icon name="hero-chevron-right" class="mt-2 size-5 shrink-0" /> -
+
📍 {activity.location_label} 🕒 {Calendar.strftime(activity.starts_at, "%d.%m.%Y, %H:%M UTC")} diff --git a/lib/who_need_help_web/live/category_proposal_live.ex b/lib/who_need_help_web/live/category_proposal_live.ex index af18fdd..8ddc347 100644 --- a/lib/who_need_help_web/live/category_proposal_live.ex +++ b/lib/who_need_help_web/live/category_proposal_live.ex @@ -170,7 +170,7 @@ defmodule WhoNeedHelpWeb.CategoryProposalLive do
{gettext("No proposals yet.")}
diff --git a/lib/who_need_help_web/live/leaderboard_live.ex b/lib/who_need_help_web/live/leaderboard_live.ex index 1cf101d..3ed908d 100644 --- a/lib/who_need_help_web/live/leaderboard_live.ex +++ b/lib/who_need_help_web/live/leaderboard_live.ex @@ -62,7 +62,7 @@ defmodule WhoNeedHelpWeb.LeaderboardLive do - + {gettext("No completed help yet.")} diff --git a/lib/who_need_help_web/live/moderation_live.ex b/lib/who_need_help_web/live/moderation_live.ex index b6e706c..6228de2 100644 --- a/lib/who_need_help_web/live/moderation_live.ex +++ b/lib/who_need_help_web/live/moderation_live.ex @@ -434,7 +434,7 @@ defmodule WhoNeedHelpWeb.ModerationLive do
{signal_label(signal.kind)} · {signal.subject.display_name}
-

+

{gettext( "A signal requests human review; optional tracking absence is not proof of abuse." )} diff --git a/lib/who_need_help_web/live/profile_live.ex b/lib/who_need_help_web/live/profile_live.ex index 5c21376..91030f3 100644 --- a/lib/who_need_help_web/live/profile_live.ex +++ b/lib/who_need_help_web/live/profile_live.ex @@ -174,7 +174,7 @@ defmodule WhoNeedHelpWeb.ProfileLive do label={gettext("Optional external thank-you link")} placeholder="https://…" /> -

+

{gettext("The platform never handles, requires, splits, or guarantees a payment.")}

<.button class="btn btn-primary w-full">{gettext("Save profile")} @@ -208,7 +208,7 @@ defmodule WhoNeedHelpWeb.ProfileLive do

{gettext("Visible reviews")}

-

+

{gettext("None revealed yet.")}

@@ -239,7 +239,7 @@ defmodule WhoNeedHelpWeb.ProfileLive do

{gettext("Social links")}

-

+

{gettext( "Manually added links are public and marked unverified. A verified badge is only granted after completing a provider authorization flow." )} @@ -265,7 +265,7 @@ defmodule WhoNeedHelpWeb.ProfileLive do

-

+

{gettext("No social links added.")}

{gettext("Blocked users")}

-

+

{gettext("You have not blocked anyone.")}

{@user.bio}

-

+

{gettext("This person has not added a public bio yet.")}

{gettext("Public social links")}

-

+

{gettext( "A verified badge means the account completed that provider's authorization flow. Manually added links remain unverified." )}

-

+

{gettext("No public social links added.")}

@@ -144,10 +144,10 @@ defmodule WhoNeedHelpWeb.PublicProfileLive do

{gettext("Revealed reviews")}

-

+

{gettext("A review becomes public only after both people submit for that match.")}

-

+

{gettext("None revealed yet.")}

diff --git a/lib/who_need_help_web/live/request_live/index.ex b/lib/who_need_help_web/live/request_live/index.ex index 25d75d1..f378487 100644 --- a/lib/who_need_help_web/live/request_live/index.ex +++ b/lib/who_need_help_web/live/request_live/index.ex @@ -465,7 +465,7 @@ defmodule WhoNeedHelpWeb.RequestLive.Index do
<.icon name="hero-chevron-right" class="mt-2 size-5 shrink-0" />
-
+
<.icon name="hero-map-pin" class="size-4" /> {request.location_label} diff --git a/lib/who_need_help_web/live/request_live/show.ex b/lib/who_need_help_web/live/request_live/show.ex index ba66e02..628348a 100644 --- a/lib/who_need_help_web/live/request_live/show.ex +++ b/lib/who_need_help_web/live/request_live/show.ex @@ -1309,7 +1309,7 @@ defmodule WhoNeedHelpWeb.RequestLive.Show do class="rounded-3xl border border-base-300 p-5" >

{gettext("Live location")}

-

+

{gettext( "In a browser this works only while the page remains open. The Android app shows a persistent notification and can continue after it is minimized. Raw coordinates are removed when sharing stops." )} @@ -1335,7 +1335,7 @@ defmodule WhoNeedHelpWeb.RequestLive.Show do

{gettext("Safety controls")}

-

+

{gettext( "Reports go to moderators. Blocking hides requests in both directions and prevents new chat messages." )} diff --git a/lib/who_need_help_web/live/support_operations_live.ex b/lib/who_need_help_web/live/support_operations_live.ex index 512f138..a6d6f50 100644 --- a/lib/who_need_help_web/live/support_operations_live.ex +++ b/lib/who_need_help_web/live/support_operations_live.ex @@ -149,7 +149,7 @@ defmodule WhoNeedHelpWeb.SupportOperationsLive do {gettext("contact unverified")} - {removal_category(notice.category)} + {removal_category(notice.category)} {gettext("review by %{time}", time: notice.response_due_at)} @@ -234,10 +234,10 @@ defmodule WhoNeedHelpWeb.SupportOperationsLive do {gettext("contact unverified")} - {support_kind(request.kind)} + {support_kind(request.kind)}

{request.subject}

-

{request.contact_email}

+

{request.contact_email}

{request.details}

<.form for={form}