Skip to content

Simplify rules setup UI and polish resident dashboard#1

Open
sarwarkaiser wants to merge 1 commit intomainfrom
codex/fix-bugs-and-improve-ui
Open

Simplify rules setup UI and polish resident dashboard#1
sarwarkaiser wants to merge 1 commit intomainfrom
codex/fix-bugs-and-improve-ui

Conversation

@sarwarkaiser
Copy link
Copy Markdown
Owner

Motivation

  • Simplify and declutter the rules/constraints setup flow which was previously too complex and visually noisy.
  • Reduce cognitive load by moving the AI assistant to an optional/advanced area and make constraint type selection explicit and persistent.
  • Improve the resident dashboard's visual hierarchy and make rendering safer when backend data is partial or missing.

Description

  • Reworked components/admin/rules/RulesManager.tsx to introduce constraintType state, persist the selected type into the form via a hidden input and append it to form data on submit, replace the old AI toggle with an details-based advanced AI helper, and convert the plugin/type selectors into clearer button/cards with a single settings panel and preview.
  • Removed the now-unused showAiAssist / activePlugin usages and consolidated the constraint creation UI to a three-step flow (name → type → plugin → settings).
  • Updated components/resident/ResidentDashboard.tsx to add ResidentDashboardProps typing, a formatShiftDate helper, safer optional-field handling (default fallbacks for names/times/sites), and a visual refresh (hero metrics, next-shift details card, improved cards, color and spacing polish).
  • Kept existing behaviors but improved safety for missing/partial data and tightened UI affordances for creating constraints and viewing upcoming shifts.

Testing

  • No automated tests (unit, lint, type-check, or dev-server) were executed in this environment due to missing runtime dependencies and registry access preventing package installation; therefore no runtime verification was performed.

Codex Task

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 50c6f1c5c7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +429 to +435
<input
value={aiPrompt}
onChange={(e) => setAiPrompt(e.target.value)}
placeholder="e.g. Max 4 shifts per month..."
className="flex-1 rounded border p-2 text-sm dark:bg-gray-700 dark:border-gray-600"
onKeyDown={(e) => e.key === 'Enter' && handleAiProcess()}
/>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Prevent AI prompt Enter key from submitting form

The AI helper input sits inside the constraint <form>, and its onKeyDown handler triggers handleAiProcess when Enter is pressed but does not prevent the default form submit. In a filled-out form, pressing Enter to “generate” will also submit the form immediately, creating a constraint with the pre-AI state (or partially updated values) before the AI timeout updates the fields. Previously the AI UI was outside the form, so this submission side-effect is new. Consider calling e.preventDefault() (or moving the AI prompt outside the form) so Enter only triggers the AI helper.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant