Skip to content

🎨 Palette: Fix missing DialogContent in TherapeuticGoalsTracker modal#332

Open
daggerstuff wants to merge 1 commit intostagingfrom
palette/ux-therapeutic-goals-dialog-a11y-2469809200838224246
Open

🎨 Palette: Fix missing DialogContent in TherapeuticGoalsTracker modal#332
daggerstuff wants to merge 1 commit intostagingfrom
palette/ux-therapeutic-goals-dialog-a11y-2469809200838224246

Conversation

@daggerstuff
Copy link
Copy Markdown
Owner

@daggerstuff daggerstuff commented Mar 31, 2026

💡 What: Wrapped the <form> inside the add/edit goal <Dialog> with <DialogContent>.
🎯 Why: The original implementation was missing <DialogContent>, which meant the modal lacked the necessary role="dialog", aria-modal="true", and focus trapping logic required for screen readers and keyboard accessibility.
📸 Before/After: Before, the modal rendered bare HTML tags. After, it properly utilizes the Shadcn-style dialog wrapper with accessibility features enabled.
♿ Accessibility: Ensures the modal can be properly navigated by keyboard and announced by screen readers as a dialog.


PR created automatically by Jules for task 2469809200838224246 started by @daggerstuff

Summary by Sourcery

Improve accessibility of the TherapeuticGoalsTracker goal dialog modal.

Bug Fixes:

  • Wrap the TherapeuticGoalsTracker goal form inside DialogContent so the modal receives correct dialog semantics and focus management.

Tests:

  • Fix a minor formatting issue in PasswordInputWithStrength tests by ensuring the file ends with a newline.

Summary by cubic

Wrapped the add/edit goal modal content in DialogContent so the TherapeuticGoalsTracker dialog exposes correct semantics (role="dialog", aria-modal) and traps focus for keyboard and screen reader support. Also fixes a stray closing brace in the PasswordInputWithStrength test.

Written for commit 77ddb20. Summary will update on new commits.

Summary by CodeRabbit

  • Refactor
    • Improved modal component structure in therapeutic goals tracking feature.

💡 What: Wrapped the `<form>` inside the add/edit goal `<Dialog>` with `<DialogContent>`.
🎯 Why: The original implementation was missing `<DialogContent>`, which meant the modal lacked the necessary `role="dialog"`, `aria-modal="true"`, and focus trapping logic required for screen readers and keyboard accessibility.
📸 Before/After: Before, the modal rendered bare HTML tags. After, it properly utilizes the Shadcn-style dialog wrapper with accessibility features enabled.
♿ Accessibility: Ensures the modal can be properly navigated by keyboard and announced by screen readers as a dialog.

Co-authored-by: daggerstuff <261005129+daggerstuff@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pixelated Error Error Mar 31, 2026 9:58pm

@charliecreates charliecreates bot requested a review from CharlieHelps March 31, 2026 21:54
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Mar 31, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Wraps the TherapeuticGoalsTracker add/edit goal form content in DialogContent to enable proper dialog semantics and accessibility, and makes a trivial test file formatting tweak.

Flow diagram for updated dialog component structure in TherapeuticGoalsTracker

graph TD
  TherapeuticGoalsTracker[ TherapeuticGoalsTracker component ]

  TherapeuticGoalsTracker --> DialogAddGoal[ Dialog add_goal ]
  TherapeuticGoalsTracker --> DialogEditGoal[ Dialog edit_goal ]

  subgraph Add_or_edit_goal_dialog_structure
    DialogAddGoal --> DCAdd[ DialogContent ]
    DCAdd --> FormAdd[ form onSubmit handleFormSubmit ]
    FormAdd --> TitleAdd[ DialogTitle ]
    FormAdd --> InputAdd[ Input goal_title ]
    FormAdd --> TextareaAdd[ Textarea goal_description ]
    FormAdd --> ButtonAdd[ Button submit ]

    DialogEditGoal --> DCEd[ DialogContent ]
    DCEd --> FormEd[ form onSubmit handleFormSubmit ]
    FormEd --> TitleEd[ DialogTitle ]
    FormEd --> InputEd[ Input goal_title ]
    FormEd --> TextareaEd[ Textarea goal_description ]
    FormEd --> ButtonEd[ Button submit ]
  end

  note_over_TherapeuticGoalsTracker[ Before change: form was a direct child of Dialog without DialogContent, so dialog semantics and focus trapping were not applied ]
  note_over_Add_or_edit_goal_dialog_structure[ After change: DialogContent wraps the form, enabling correct role dialog, aria modal true, and focus management ]
Loading

File-Level Changes

Change Details Files
Wrap add/edit goal form in proper dialog content container to enable dialog semantics and accessibility behavior.
  • Enclosed the goal add/edit form markup within a DialogContent component inside the Dialog.
  • Ensured that the dialog title and form fields are now rendered within the dialog content wrapper so that focus trapping and aria attributes work as intended.
  • Kept existing submit/cancel behavior and form handlers unchanged while structurally nesting them in the dialog content.
src/components/therapy/TherapeuticGoalsTracker.tsx
Minor formatting adjustment in a password input strength test file.
  • Updated test file to end with a newline character to satisfy formatting or linting rules.
src/components/ui/__tests__/PasswordInputWithStrength.test.tsx

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 31, 2026

📝 Walkthrough

Walkthrough

Two minor updates: wrapping therapeutic goals form content in a DialogContent component for proper modal composition, and correcting a closing bracket in a test file to match the describe block structure.

Changes

Cohort / File(s) Summary
Dialog Content Wrapper
src/components/therapy/TherapeuticGoalsTracker.tsx
Added DialogContent import and wrapped the add/edit goals form inside <DialogContent> component within the modal dialog.
Test File Syntax Fix
src/components/ui/__tests__/PasswordInputWithStrength.test.tsx
Corrected closing brace to properly close the describe block (changed } to }))

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • CharlieHelps

Poem

🐰 A wrapper here, a bracket there,
The code now flows with modal care,
Test files sing in harmony,
Small tweaks make things run free! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: wrapping a modal dialog with missing DialogContent in TherapeuticGoalsTracker to fix accessibility issues.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch palette/ux-therapeutic-goals-dialog-a11y-2469809200838224246

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider moving the DialogTitle outside of the <form> but still within <DialogContent> so the dialog heading is not part of the form controls, which better matches typical dialog semantics and avoids submitting when activating the title.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider moving the `DialogTitle` outside of the `<form>` but still within `<DialogContent>` so the dialog heading is not part of the form controls, which better matches typical dialog semantics and avoids submitting when activating the title.

Fix all in Cursor


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown

@charliecreates charliecreates bot left a comment

Choose a reason for hiding this comment

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

No issues found in the modified lines; the DialogContent addition aligns with the stated accessibility goal, and the test file change corrects the suite closure.

Additional notes (1)
  • Maintainability | src/components/therapy/TherapeuticGoalsTracker.tsx:348-353
    DialogContent is a good fix, but the title is currently the first element inside the <form>. For Radix/Shadcn dialogs, it’s typically better to structure the content with a header section (and optionally a description) outside the form fields to keep semantics/layout consistent and make it easier to add an accessible description later (many setups wire aria-describedby via DialogDescription).
Summary of changes

Summary

  • Updated TherapeuticGoalsTracker to wrap the add/edit goal <form> in DialogContent by importing DialogContent and nesting the form within it.
  • Fixed a test-suite block terminator in PasswordInputWithStrength.test.tsx by changing the final closing from } to }).

@charliecreates charliecreates bot removed the request for review from CharlieHelps March 31, 2026 21:55
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 2 files

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
src/components/therapy/TherapeuticGoalsTracker.tsx (1)

353-353: Consider moving DialogTitle outside the form element.

The <DialogTitle> is currently nested inside the <form> element. While functional, the typical shadcn/ui pattern places DialogTitle as a direct child of DialogContent for clearer semantic structure:

<DialogContent>
  <DialogTitle>{editGoal ? 'Edit Goal' : 'Add Goal'}</DialogTitle>
  <form onSubmit={handleFormSubmit} className='space-y-4'>
    {/* form fields */}
  </form>
</DialogContent>

This keeps the dialog title semantically separate from the form content and follows the component composition pattern more closely.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/therapy/TherapeuticGoalsTracker.tsx` at line 353, Move the
DialogTitle out of the <form> so it becomes a direct child of DialogContent:
locate the DialogContent block containing DialogTitle and the form (the form
uses onSubmit={handleFormSubmit} and references editGoal), cut the DialogTitle
declaration and place it immediately inside DialogContent above the <form>,
leaving the form only for inputs and submit logic; ensure no props or handlers
are lost when relocating DialogTitle.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@src/components/therapy/TherapeuticGoalsTracker.tsx`:
- Line 353: Move the DialogTitle out of the <form> so it becomes a direct child
of DialogContent: locate the DialogContent block containing DialogTitle and the
form (the form uses onSubmit={handleFormSubmit} and references editGoal), cut
the DialogTitle declaration and place it immediately inside DialogContent above
the <form>, leaving the form only for inputs and submit logic; ensure no props
or handlers are lost when relocating DialogTitle.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 862fba36-28f4-466e-b5b1-dc35786abf1e

📥 Commits

Reviewing files that changed from the base of the PR and between 919a5fd and 77ddb20.

📒 Files selected for processing (2)
  • src/components/therapy/TherapeuticGoalsTracker.tsx
  • src/components/ui/__tests__/PasswordInputWithStrength.test.tsx

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant