fix(ui): disable Create/Submit buttons for empty required fields #93

Merged
mahmoud merged 3 commits from development_ui_required_field_validation into development 2026-04-21 07:54:50 +00:00
Member

Summary

Fix three islands whose primary Create/Submit buttons stayed enabled when required fields were empty, producing a silent no-op on click. Mirrors the Contacts validation pattern from lhumina_code/hero_os#50.

Closes lhumina_code/hero_os#68

Changes

  • archipelagos/system/contexts/src/views/create_form.rs — remove pointer-events: none div wrapper that silently swallowed clicks; apply disabled: !can_submit directly on the shared Button; switch variant to Secondary when disabled; invert inner onclick guard to an early return; tighten can_submit with trim().
  • archipelagos/communication/room/src/views/room_card.rs — tighten can_save with trim().is_empty() so whitespace-only counts as empty (button already gated via disabled: !can_save).
  • archipelagos/productivity/tasks/src/views/new_task_view.rs — tighten can_submit with trim().is_empty() (button already gated via disabled: !can_submit).

All three now rely on the shared hero_archipelagos_core::Button disabled handling: when disabled is true the component applies the hero-btn-disabled CSS class (opacity: 0.5; cursor: not-allowed; pointer-events: none) and its internal onclick gate early-returns — so disabled buttons cannot fire actions.

Test results

  • cargo check -p hero_archipelagos_contexts, -p hero_archipelagos_room, -p hero_archipelagos_tasks: all pass.
  • cargo test for each crate: no unit tests defined, vacuous pass.
  • Workspace-level cargo check has pre-existing, unrelated failures in hero_archipelagos_knowledge and hero_archipelagos_messaging (upstream SDK drift) — not introduced by this branch.
  • Live browser verification (headless Chromium and local Chrome against make run hero_os):
    • Contexts / Create Context: verified the four states (empty, whitespace-only, valid, cleared). hero-btn-disabled class applied and click does not register when required fields are empty.
    • Tasks / Create Task: verified the four states.
    • Conference / Create Room: source-verified — island-room is not compiled into the current web WASM build (routes through the hero_livekit iframe instead), so runtime verification pending a build that includes the island.
## Summary Fix three islands whose primary Create/Submit buttons stayed enabled when required fields were empty, producing a silent no-op on click. Mirrors the Contacts validation pattern from lhumina_code/hero_os#50. ## Related issue Closes https://forge.ourworld.tf/lhumina_code/hero_os/issues/68 ## Changes - `archipelagos/system/contexts/src/views/create_form.rs` — remove `pointer-events: none` div wrapper that silently swallowed clicks; apply `disabled: !can_submit` directly on the shared `Button`; switch variant to `Secondary` when disabled; invert inner onclick guard to an early return; tighten `can_submit` with `trim()`. - `archipelagos/communication/room/src/views/room_card.rs` — tighten `can_save` with `trim().is_empty()` so whitespace-only counts as empty (button already gated via `disabled: !can_save`). - `archipelagos/productivity/tasks/src/views/new_task_view.rs` — tighten `can_submit` with `trim().is_empty()` (button already gated via `disabled: !can_submit`). All three now rely on the shared `hero_archipelagos_core::Button` disabled handling: when `disabled` is true the component applies the `hero-btn-disabled` CSS class (`opacity: 0.5; cursor: not-allowed; pointer-events: none`) and its internal onclick gate early-returns — so disabled buttons cannot fire actions. ## Test results - `cargo check -p hero_archipelagos_contexts`, `-p hero_archipelagos_room`, `-p hero_archipelagos_tasks`: all pass. - `cargo test` for each crate: no unit tests defined, vacuous pass. - Workspace-level `cargo check` has pre-existing, unrelated failures in `hero_archipelagos_knowledge` and `hero_archipelagos_messaging` (upstream SDK drift) — not introduced by this branch. - Live browser verification (headless Chromium and local Chrome against `make run` hero_os): - Contexts / Create Context: verified the four states (empty, whitespace-only, valid, cleared). `hero-btn-disabled` class applied and click does not register when required fields are empty. - Tasks / Create Task: verified the four states. - Conference / Create Room: source-verified — `island-room` is not compiled into the current `web` WASM build (routes through the `hero_livekit` iframe instead), so runtime verification pending a build that includes the island.
fix(ui): disable Create/Submit buttons for empty required fields
Some checks failed
Build and Test / build (pull_request) Failing after 1m20s
fa96a7556b
Mirror the Contacts validation pattern from #50 across three more islands.
All three now gate their primary submit through the shared Button's
`disabled` prop, and treat whitespace-only input as empty via
`trim().is_empty()`.

- Contexts: replace `pointer-events: none` div wrapper (which silently
  swallowed clicks) with a real `disabled` prop; switch variant to
  `Secondary` when disabled; invert inner onclick guard to early return.
- Conference/Room: tighten `can_save` with `trim()`.
- Tasks/NewTaskView: tighten `can_submit` with `trim()`.

lhumina_code/hero_os#68
Merge branch 'development' into development_ui_required_field_validation
All checks were successful
Build and Test / build (pull_request) Successful in 5m16s
cd2a7bcc82
Merge branch 'development' into development_ui_required_field_validation
All checks were successful
Build and Test / build (pull_request) Successful in 7m56s
cd62893a7f
mahmoud approved these changes 2026-04-21 07:54:40 +00:00
mahmoud merged commit 333faad4e0 into development 2026-04-21 07:54:50 +00:00
mahmoud deleted branch development_ui_required_field_validation 2026-04-21 07:54:54 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_archipelagos!93
No description provided.