Skip to content

Conversation

@khanjasir90
Copy link
Contributor

@khanjasir90 khanjasir90 commented Nov 4, 2025

Closes #

📝 Description

  1. Added Games Section Card.
  2. Added additional fields in schema.sql

🔧 Changes Made

📷 Screenshots or Visual Changes (if applicable)

🤝 Collaboration

Collaborated with: @username (optional)

✅ Checklist

  • I have read the contributing guidelines.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if applicable).
  • Any dependent changes have been merged and published in downstream modules.

Summary by CodeRabbit

  • New Features
    • Added a Games feature card to the home screen for quick access to interactive games and activities

@coderabbitai
Copy link

coderabbitai bot commented Nov 4, 2025

Walkthrough

Added Games feature integration to the home screen with navigation support, and extended the database schema to track patient-activity associations and therapist licensing information through new columns in the therapist and daily_activity_logs tables.

Changes

Cohort / File(s) Summary
Home Screen UI Enhancement
patient/lib/presentation/home/home_screen.dart
Imported GamesScreen widget and added a new navigable TherapyGoalCard titled "Games" with the i9nActivities illustration and light green background, positioned after Development Milestones in the home content list.
Database Schema Extensions
supabase/schemas/schema.sql
Added license_number TEXT column to therapist table and patient_id UUID foreign key column (referencing patient(id) with ON DELETE CASCADE) to daily_activity_logs table.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify GamesScreen widget import and namespace resolution
  • Confirm foreign key constraint on daily_activity_logs.patient_id does not conflict with existing records or migration strategy
  • Ensure TherapyGoalCard positioning and styling align with design specifications

Possibly related PRs

Suggested reviewers

  • mdmohsin7

Poem

🐰 A card for games hops onto the screen,
With emerald hues and therapy dreams,
While therapists now keep their license near,
And patients' logs grow crystal clear! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title is misleading and overly vague. It mentions 'schema fix' but the PR primarily adds a Games card feature; schema changes are secondary additions unrelated to fixing an existing schema issue. Use a clearer title like 'Add Games card feature and extend database schema' or 'Add Games card to home screen with schema updates' to accurately reflect both main changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

@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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
patient/lib/presentation/home/home_screen.dart (1)

186-202: Consider using a unique illustration for the Games card.

The Games card reuses Assets.illustrations.i9nActivities, which is the same illustration used by the Daily Activities card (line 172). This may confuse users when scanning the home screen.

If a dedicated Games illustration is available (e.g., Assets.illustrations.i9nGames), consider using it instead:

                  child: TherapyGoalCard(
                    title: 'Games',
                    subtitle: '',
-                    illustration: Assets.illustrations.i9nActivities,
+                    illustration: Assets.illustrations.i9nGames,
                    backgroundColor: const Color(0xFFE8F5E9),
                  ),
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 53d13fd and 706f96e.

📒 Files selected for processing (2)
  • patient/lib/presentation/home/home_screen.dart (2 hunks)
  • supabase/schemas/schema.sql (2 hunks)
🔇 Additional comments (1)
patient/lib/presentation/home/home_screen.dart (1)

11-11: GamesScreen import and implementation verified successfully.

The import is valid. GamesScreen exists at patient/lib/presentation/games/games_screen.dart, is properly implemented as a StatelessWidget, and is correctly instantiated in the navigation call using const GamesScreen(), which matches its constructor signature.

Comment on lines +36 to 37
license_number TEXT,
);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix SQL syntax error and resolve field redundancy.

Two critical issues:

  1. Syntax error: Trailing comma after license_number TEXT, on line 36 will cause the CREATE TABLE statement to fail. SQL does not allow a comma after the last column definition.

  2. Redundant field: The therapist table already has a license TEXT column on line 27. Adding license_number TEXT creates ambiguity. Clarify whether you intend to replace the existing license field or if these serve different purposes.

Apply this diff to fix the syntax error:

-    license_number TEXT,
+    license_number TEXT

If license_number is meant to replace license, consider removing or renaming the existing license field to avoid confusion.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
license_number TEXT,
);
license_number TEXT
);
🤖 Prompt for AI Agents
In supabase/schemas/schema.sql around lines 36 to 37, remove the trailing comma
after the final column definition to fix the SQL syntax error and resolve the
redundant field by either deleting the new license_number column or replacing
the existing license column (line ~27) so only one field remains; if replacing,
rename or remove the original license column and update any
references/migrations to use license_number consistently.

Comment on lines 160 to 162
activity_items JSONB NOT NULL
patient_id UUID REFERENCES patient(id) ON DELETE CASCADE,
);
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

Fix missing comma between columns.

Missing comma after activity_items JSONB NOT NULL on line 160 will cause a SQL syntax error. Additionally, there's a trailing comma after patient_id on line 161 before the closing parenthesis, which will also cause an error.

Apply this diff to fix both syntax errors:

-    activity_items JSONB NOT NULL
-    patient_id UUID REFERENCES patient(id) ON DELETE CASCADE,
+    activity_items JSONB NOT NULL,
+    patient_id UUID REFERENCES patient(id) ON DELETE CASCADE
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
activity_items JSONB NOT NULL
patient_id UUID REFERENCES patient(id) ON DELETE CASCADE,
);
activity_items JSONB NOT NULL,
patient_id UUID REFERENCES patient(id) ON DELETE CASCADE
);
🤖 Prompt for AI Agents
In supabase/schemas/schema.sql around lines 160 to 162, the CREATE TABLE column
list has a missing comma after "activity_items JSONB NOT NULL" and an extra
trailing comma after "patient_id UUID REFERENCES patient(id) ON DELETE CASCADE,"
before the closing parenthesis; add the comma after the activity_items line and
remove the trailing comma after patient_id so the column list is properly
comma-separated and the closing parenthesis is valid.

@mdmohsin7 mdmohsin7 merged commit 5a2d6eb into AOSSIE-Org:main Nov 15, 2025
1 check passed
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.

2 participants