Skip to content

Add CONTRIBUTING.md with setup guide and troubleshooting steps#247

Closed
Satyanarayana001 wants to merge 2 commits into
AOSSIE-Org:mainfrom
Satyanarayana001:docs/contributing-guide
Closed

Add CONTRIBUTING.md with setup guide and troubleshooting steps#247
Satyanarayana001 wants to merge 2 commits into
AOSSIE-Org:mainfrom
Satyanarayana001:docs/contributing-guide

Conversation

@Satyanarayana001

@Satyanarayana001 Satyanarayana001 commented Mar 25, 2026

Copy link
Copy Markdown

📘 Add CONTRIBUTING.md

🧩 Problem

Many contributors face difficulties while setting up Ell-ena locally, especially with environment configuration and running the app successfully.


✅ Solution

Added a comprehensive CONTRIBUTING.md that includes:

  • Step-by-step setup instructions
  • Environment configuration using .env
  • Commands to run the application
  • Common issues and their fixes
  • Code quality checks (flutter analyze)
  • Clear pull request workflow

🚀 Impact

  • Improves onboarding experience for new contributors
  • Reduces setup-related issues
  • Makes contribution process more structured and clear

💡 Additional Notes

This guide is designed to help contributors quickly get the project running and start contributing without confusion.


✨ Happy Contributing!

Summary by CodeRabbit

  • Refactor

    • Updated color transparency handling across the app for more consistent visuals.
    • Improved drag-and-drop handling and cleaned up parallel loading routines.
    • Adjusted speech input flow so voice capture behavior no longer auto-inserts interim text.
  • Chores

    • Raised Dart SDK requirement and changed speech dependency version.
    • Removed launcher icon and certain lint/build configurations.

@coderabbitai

coderabbitai Bot commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

Restructures app startup by moving runApp() into main() after async initialization, migrates many Color.withOpacity(...) calls to Color.withValues(alpha: ...), updates drag-and-drop handlers to details-based APIs, tweaks chat speech-listening flow and speech_to_text usage, and adjusts pubspec.yaml SDK/dependency and dev-dependency entries.

Changes

Cohort / File(s) Summary
App Entry & Lifecycle
lib/main.dart
Moved runApp(...) into main() after async init, reformatted navigator/route argument handling, re-indented observer widgets, and disposes SupabaseService() on detached.
Color Opacity Refactor (UI styling)
lib/screens/auth/team_selection_dialog.dart, lib/screens/calendar/calendar_screen.dart, lib/screens/home/dashboard_screen.dart, lib/screens/meetings/meeting_detail_screen.dart, lib/screens/meetings/meeting_screen.dart, lib/screens/onboarding/onboarding_screen.dart, lib/screens/profile/edit_profile_screen.dart, lib/screens/profile/profile_screen.dart, lib/screens/profile/team_members_screen.dart, lib/screens/splash_screen.dart, lib/screens/tasks/task_detail_screen.dart, lib/screens/tickets/create_ticket_screen.dart, lib/screens/tickets/ticket_detail_screen.dart, lib/widgets/custom_widgets.dart
Replaced Color.withOpacity(x) usages with Color.withValues(alpha: x) across many widgets (shadows, backgrounds, badges, decorations). No behavior changes.
Drag-and-Drop API Migration
lib/screens/tasks/task_screen.dart, lib/screens/tickets/ticket_screen.dart
Replaced onAccept/onWillAccept with onAcceptWithDetails/onWillAcceptWithDetails, extracting payload via details.data and updating status/id accordingly.
Chat / Speech Listening
lib/screens/chat/chat_screen.dart
Refactored _toggleListening() flow and listening start order, replaced some theme usages (surfaceVariantsurfaceContainerHighest), moved opacity calls to withValues, and replaced onResult handler body with placeholder logic (removed previous text-updating behavior).
Calendar Cleanup
lib/screens/calendar/calendar_screen.dart
Removed unused results variable from Future.wait, removed extraneous string interpolation, replaced opacity calls with withValues, and removed an unused selectedDateTime construction.
Build / Dependencies
pubspec.yaml
Tightened Dart SDK constraint to ^3.8.0, downgraded speech_to_text to ^6.6.0, removed flutter_launcher_icons and flutter_lints dev deps, and removed the flutter: config block (assets/uses-material-design).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

Dart/Flutter, Documentation

Poem

🐰 I hopped through code at break of day,
Swapped opacities so colors play,
Dragging details, listening light,
Startup moved to greet the night,
A tiny rabbit cheers the bright display 🥕✨

🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title claims to add CONTRIBUTING.md, but the changeset contains extensive code modifications across 20+ files (dart files and pubspec.yaml), with minimal documentation changes. Update the title to accurately reflect the primary changes: e.g., 'Migrate to withValues() API and update dependencies' or 'Fix deprecated API usage and DragTarget handling'. Consider separating documentation changes into a dedicated PR.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@Satyanarayana001

Copy link
Copy Markdown
Author

Hi 👋, this PR adds a structured CONTRIBUTING.md covering setup, environment configuration, and common issues faced by contributors.

Please let me know if any additional sections or improvements are needed.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@lib/screens/chat/chat_screen.dart`:
- Around line 1161-1164: The onResult callback passed to _speech.listen is empty
so recognized speech never reaches the composer; update it to write the
interim/final transcript into _messageController by assigning
result.recognizedWords (from the SpeechRecognitionResult) to
_messageController.text and update the text selection to the end (e.g.,
_messageController.selection = TextSelection.fromPosition(TextPosition(offset:
_messageController.text.length))); also call setState if the UI depends on any
listening/transcription state variables so the composer updates immediately.

In `@pubspec.yaml`:
- Around line 55-58: The pubspec is missing the root-level flutter:
configuration causing assets and material icons not to be bundled; restore a
flutter: block that sets uses-material-design: true and lists the splash asset
(ELL-ena-logo/png/logo-removed-bg-cropped.png) under assets so
lib/screens/splash_screen.dart (reference: splash image load at line ~101) can
find the logo at runtime and Material icons (e.g., Icons.task_alt, Icons.add)
are included.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 95d9354e-a02c-48fb-bd08-43ed8079b7e8

📥 Commits

Reviewing files that changed from the base of the PR and between 5afe656 and a6d4ece.

⛔ Files ignored due to path filters (6)
  • linux/flutter/generated_plugin_registrant.cc is excluded by !**/linux/**
  • linux/flutter/generated_plugins.cmake is excluded by !**/linux/**
  • macos/Flutter/GeneratedPluginRegistrant.swift is excluded by !**/macos/**
  • pubspec.lock is excluded by !**/*.lock
  • windows/flutter/generated_plugin_registrant.cc is excluded by !**/windows/**
  • windows/flutter/generated_plugins.cmake is excluded by !**/windows/**
📒 Files selected for processing (20)
  • CONTRIBUTING.md
  • lib/main.dart
  • lib/screens/auth/team_selection_dialog.dart
  • lib/screens/calendar/calendar_screen.dart
  • lib/screens/chat/chat_screen.dart
  • lib/screens/home/dashboard_screen.dart
  • lib/screens/meetings/meeting_detail_screen.dart
  • lib/screens/meetings/meeting_screen.dart
  • lib/screens/onboarding/onboarding_screen.dart
  • lib/screens/profile/edit_profile_screen.dart
  • lib/screens/profile/profile_screen.dart
  • lib/screens/profile/team_members_screen.dart
  • lib/screens/splash_screen.dart
  • lib/screens/tasks/task_detail_screen.dart
  • lib/screens/tasks/task_screen.dart
  • lib/screens/tickets/create_ticket_screen.dart
  • lib/screens/tickets/ticket_detail_screen.dart
  • lib/screens/tickets/ticket_screen.dart
  • lib/widgets/custom_widgets.dart
  • pubspec.yaml

Comment on lines +1161 to +1164
await _speech.listen(
onResult: (result) {
// logic
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify that _toggleListening() no longer writes speech results into the composer.
sed -n '1129,1168p' lib/screens/chat/chat_screen.dart
rg -n "_messageController\\.text\\s*=|recognizedWords" lib/screens/chat/chat_screen.dart

Repository: AOSSIE-Org/Ell-ena

Length of output: 993


Restore transcript update in the onResult callback.

The onResult callback at line 1162 contains only a comment placeholder (// logic), which means recognized speech is never written to _messageController. This breaks voice dictation entirely—the microphone listens but the transcript never reaches the message composer.

Proposed fix
 await _speech.listen(
   onResult: (result) {
-    // logic
+    if (!mounted) return;
+    _messageController
+      ..text = result.recognizedWords
+      ..selection = TextSelection.collapsed(
+        offset: result.recognizedWords.length,
+      );
   },
   listenMode: stt.ListenMode.dictation,
   partialResults: true,
   cancelOnError: true,
 );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/screens/chat/chat_screen.dart` around lines 1161 - 1164, The onResult
callback passed to _speech.listen is empty so recognized speech never reaches
the composer; update it to write the interim/final transcript into
_messageController by assigning result.recognizedWords (from the
SpeechRecognitionResult) to _messageController.text and update the text
selection to the end (e.g., _messageController.selection =
TextSelection.fromPosition(TextPosition(offset:
_messageController.text.length))); also call setState if the UI depends on any
listening/transcription state variables so the composer updates immediately.

Comment thread pubspec.yaml
Comment on lines 55 to +58
dev_dependencies:
flutter_test:
sdk: flutter

# Launcher icons
flutter_launcher_icons: ^0.13.1

# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^5.0.0

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter packages.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true

# To add assets to your application, add an assets section, like this:
assets:
- .env
- ELL-ena-logo/png/
- ELL-ena-logo/svg/
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg

# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images

# For details regarding adding assets from package dependencies, see
# https://flutter.dev/to/asset-from-package

# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/to/font-from-package

# Flutter Launcher Icons configuration
flutter_launcher_icons:
android: true
ios: true
image_path: "ELL-ena-logo/png/logo-removed-bg-bigger.png"
adaptive_icon_background: "#1A1A1A"
adaptive_icon_foreground: "ELL-ena-logo/png/logo-removed-bg-bigger.png"
flutter_lints: ^5.0.0 No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Flutter manifest entries in pubspec.yaml:\n'
rg -n '^(flutter:|  uses-material-design:|  assets:|    - )' pubspec.yaml || true

printf '\nAsset references in lib/:\n'
rg -n 'Image\.asset\(|AssetImage\(' lib

printf '\nSample Material icon usage:\n'
rg -n 'Icons\.' lib | head -n 20

Repository: AOSSIE-Org/Ell-ena

Length of output: 2268


🏁 Script executed:

# Check lines around 101-105 in splash_screen.dart to see exact asset path
sed -n '95,110p' lib/screens/splash_screen.dart

Repository: AOSSIE-Org/Ell-ena

Length of output: 739


🏁 Script executed:

# Search for the asset file mentioned in the review
find . -name "logo-removed-bg-cropped.png" -o -name "*logo*" -type f | head -20

Repository: AOSSIE-Org/Ell-ena

Length of output: 584


🏁 Script executed:

# Check if the full asset path structure exists
find . -path "*/ELL-ena-logo/png/*" -type f

Repository: AOSSIE-Org/Ell-ena

Length of output: 496


🏁 Script executed:

# Read the complete pubspec.yaml to verify the full state
cat -n pubspec.yaml

Repository: AOSSIE-Org/Ell-ena

Length of output: 1388


🏁 Script executed:

# Verify if there's any flutter configuration anywhere
rg -i 'flutter' pubspec.yaml

Repository: AOSSIE-Org/Ell-ena

Length of output: 268


Restore the root-level flutter: section.

The manifest lacks the entire flutter: configuration block. Without it, ELL-ena-logo/png/logo-removed-bg-cropped.png won't be bundled, causing the splash screen (lib/screens/splash_screen.dart, line 101) to fail on every launch and show the error fallback instead of the branded logo. Additionally, Material icons used throughout the app (Icons.task_alt, Icons.add, etc.) require uses-material-design: true to ensure proper bundling.

 dev_dependencies:
   flutter_test:
     sdk: flutter
   flutter_lints: ^5.0.0
+
+flutter:
+  uses-material-design: true
+  assets:
+    - ELL-ena-logo/png/logo-removed-bg-cropped.png
📝 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
dev_dependencies:
flutter_test:
sdk: flutter
# Launcher icons
flutter_launcher_icons: ^0.13.1
# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
flutter_lints: ^5.0.0
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter packages.
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- .env
- ELL-ena-logo/png/
- ELL-ena-logo/svg/
# assets:
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/to/resolution-aware-images
# For details regarding adding assets from package dependencies, see
# https://flutter.dev/to/asset-from-package
# To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/to/font-from-package
# Flutter Launcher Icons configuration
flutter_launcher_icons:
android: true
ios: true
image_path: "ELL-ena-logo/png/logo-removed-bg-bigger.png"
adaptive_icon_background: "#1A1A1A"
adaptive_icon_foreground: "ELL-ena-logo/png/logo-removed-bg-bigger.png"
flutter_lints: ^5.0.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^5.0.0
flutter:
uses-material-design: true
assets:
- ELL-ena-logo/png/logo-removed-bg-cropped.png
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pubspec.yaml` around lines 55 - 58, The pubspec is missing the root-level
flutter: configuration causing assets and material icons not to be bundled;
restore a flutter: block that sets uses-material-design: true and lists the
splash asset (ELL-ena-logo/png/logo-removed-bg-cropped.png) under assets so
lib/screens/splash_screen.dart (reference: splash image load at line ~101) can
find the logo at runtime and Material icons (e.g., Icons.task_alt, Icons.add)
are included.

@Satyanarayana001 Satyanarayana001 force-pushed the docs/contributing-guide branch from a6d4ece to 44b0e58 Compare March 25, 2026 12:44
@Satyanarayana001

Copy link
Copy Markdown
Author

Hi 👋, I’ve cleaned up the PR to include only the CONTRIBUTING.md documentation as intended.

Please let me know if any improvements are needed. Thanks!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

♻️ Duplicate comments (2)
pubspec.yaml (1)

55-58: ⚠️ Potential issue | 🟠 Major

Restore the root-level flutter: section.

The file now ends at Line 58, so the splash asset referenced by lib/screens/splash_screen.dart will not be bundled, and Material icons will no longer be enabled for the app. Add the root-level flutter: block back with uses-material-design: true and the logo asset declaration.

Proposed fix
 dev_dependencies:
   flutter_test:
     sdk: flutter
   flutter_lints: ^5.0.0
+
+flutter:
+  uses-material-design: true
+  assets:
+    - ELL-ena-logo/png/logo-removed-bg-cropped.png
#!/bin/bash
set -euo pipefail

printf 'Root-level flutter config in pubspec.yaml:\n'
rg -n '^(flutter:|  uses-material-design:|  assets:|    - ELL-ena-logo/png/logo-removed-bg-cropped\.png)' pubspec.yaml || true

printf '\nReferenced splash asset:\n'
rg -n 'ELL-ena-logo/png/logo-removed-bg-cropped\.png' lib/screens/splash_screen.dart
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pubspec.yaml` around lines 55 - 58, Restore the root-level flutter section in
pubspec.yaml by adding a top-level "flutter:" block containing
"uses-material-design: true" and an "assets:" list that includes the splash/logo
asset referenced by lib/screens/splash_screen.dart
(ELL-ena-logo/png/logo-removed-bg-cropped.png); ensure indentation matches YAML
(two-space indent for child keys) so the asset is bundled and Material icons
remain enabled.
lib/screens/chat/chat_screen.dart (1)

1161-1164: ⚠️ Potential issue | 🔴 Critical

Write recognized speech back into _messageController.

Line 1162 is now just a placeholder, so voice dictation never reaches the composer. The mic flow runs, but users still have nothing to send.

Proposed fix
 await _speech.listen(
   onResult: (result) {
-    // logic
+    if (!mounted) return;
+    _messageController
+      ..text = result.recognizedWords
+      ..selection = TextSelection.collapsed(
+        offset: result.recognizedWords.length,
+      );
   },
   listenMode: stt.ListenMode.dictation,
   partialResults: true,
   cancelOnError: true,
 );
#!/bin/bash
set -euo pipefail

sed -n '1159,1168p' lib/screens/chat/chat_screen.dart

printf '\nTranscript writes in chat_screen.dart:\n'
rg -n 'recognizedWords|_messageController\.\.text|_messageController\.text\s*=' lib/screens/chat/chat_screen.dart
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/screens/chat/chat_screen.dart` around lines 1161 - 1164, The onResult
callback passed to _speech.listen is not writing recognized speech into the
composer, so dictation never populates _messageController; update the onResult
handler inside _speech.listen to set _messageController.text (and update its
selection/cursor) with result.recognizedWords (or result.bestTranscription
depending on API) and call setState if needed so the UI updates; locate the
_speech.listen call and modify its onResult closure to assign the recognized
transcript into _messageController.text and place the cursor at the end.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@lib/main.dart`:
- Around line 107-109: The lifecycle handler didChangeAppLifecycleState must not
call SupabaseService().dispose() when state == AppLifecycleState.detached
because that permanently sets _disposed and makes the singleton unrecoverable;
remove the SupabaseService().dispose() call from didChangeAppLifecycleState, and
if you need to release transient resources implement and call a non-terminal
method (e.g., SupabaseService().suspendStreams() or similar) instead of dispose;
ensure dispose() remains reserved for true app termination or test teardown and
that initialize() can still be called after a detach without failing due to a
permanent _disposed flag.

In `@lib/screens/tasks/task_screen.dart`:
- Around line 413-421: The onAcceptWithDetails callback uses data['id']
(dynamic) but _updateTaskStatus requires a String; add an explicit cast/guard to
ensure a String is passed: inside the onAcceptWithDetails handler (the block
referencing status['id'] and data), validate or cast data['id'] to String (e.g.,
check for null and type, or call as String after confirming) and only call
_updateTaskStatus when taskId is a non-null String; keep the existing check
comparing data['status'] to newStatus and mirror the explicit cast style used
for status['id'].

---

Duplicate comments:
In `@lib/screens/chat/chat_screen.dart`:
- Around line 1161-1164: The onResult callback passed to _speech.listen is not
writing recognized speech into the composer, so dictation never populates
_messageController; update the onResult handler inside _speech.listen to set
_messageController.text (and update its selection/cursor) with
result.recognizedWords (or result.bestTranscription depending on API) and call
setState if needed so the UI updates; locate the _speech.listen call and modify
its onResult closure to assign the recognized transcript into
_messageController.text and place the cursor at the end.

In `@pubspec.yaml`:
- Around line 55-58: Restore the root-level flutter section in pubspec.yaml by
adding a top-level "flutter:" block containing "uses-material-design: true" and
an "assets:" list that includes the splash/logo asset referenced by
lib/screens/splash_screen.dart (ELL-ena-logo/png/logo-removed-bg-cropped.png);
ensure indentation matches YAML (two-space indent for child keys) so the asset
is bundled and Material icons remain enabled.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 095fdcc7-2182-4a28-849a-612cdc8b8aa0

📥 Commits

Reviewing files that changed from the base of the PR and between a6d4ece and 44b0e58.

⛔ Files ignored due to path filters (6)
  • linux/flutter/generated_plugin_registrant.cc is excluded by !**/linux/**
  • linux/flutter/generated_plugins.cmake is excluded by !**/linux/**
  • macos/Flutter/GeneratedPluginRegistrant.swift is excluded by !**/macos/**
  • pubspec.lock is excluded by !**/*.lock
  • windows/flutter/generated_plugin_registrant.cc is excluded by !**/windows/**
  • windows/flutter/generated_plugins.cmake is excluded by !**/windows/**
📒 Files selected for processing (19)
  • CONTRIBUTING.md
  • lib/main.dart
  • lib/screens/auth/team_selection_dialog.dart
  • lib/screens/chat/chat_screen.dart
  • lib/screens/home/dashboard_screen.dart
  • lib/screens/meetings/meeting_detail_screen.dart
  • lib/screens/meetings/meeting_screen.dart
  • lib/screens/onboarding/onboarding_screen.dart
  • lib/screens/profile/edit_profile_screen.dart
  • lib/screens/profile/profile_screen.dart
  • lib/screens/profile/team_members_screen.dart
  • lib/screens/splash_screen.dart
  • lib/screens/tasks/task_detail_screen.dart
  • lib/screens/tasks/task_screen.dart
  • lib/screens/tickets/create_ticket_screen.dart
  • lib/screens/tickets/ticket_detail_screen.dart
  • lib/screens/tickets/ticket_screen.dart
  • lib/widgets/custom_widgets.dart
  • pubspec.yaml

Comment thread lib/main.dart
Comment on lines +107 to +109
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.detached) {
SupabaseService().dispose();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Lifecycle hook in lib/main.dart:\n'
sed -n '106,110p' lib/main.dart

printf '\nSupabaseService disposal behavior:\n'
rg -n -C2 'void dispose\(|_disposed' lib/services/supabase_service.dart

Repository: AOSSIE-Org/Ell-ena

Length of output: 876


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Check SupabaseService singleton/factory pattern
printf 'SupabaseService instantiation pattern:\n'
rg -n 'class SupabaseService|static.*SupabaseService|factory SupabaseService' lib/services/supabase_service.dart | head -20

# Check for reinitialization or reset logic
printf '\nChecking for reset/reinitialization methods:\n'
rg -n 'reset|reinit|initialize' lib/services/supabase_service.dart

# Check if _disposed can be reset
printf '\nChecking _disposed variable usage:\n'
rg -n '_disposed' lib/services/supabase_service.dart

Repository: AOSSIE-Org/Ell-ena

Length of output: 2065


Avoid disposing the shared SupabaseService on detached.

Line 109 disposes a singleton whose dispose() closes stream controllers and permanently sets _disposed = true. AppLifecycleState.detached is not a terminal state—the app can reattach—leaving Supabase unusable for the remainder of the session. The _disposed flag is never reset, so the service cannot recover even if initialize() is called again.

Safer fix
   `@override`
   void didChangeAppLifecycleState(AppLifecycleState state) {
-    if (state == AppLifecycleState.detached) {
-      SupabaseService().dispose();
-    }
+    // Avoid disposing shared singletons here. If explicit teardown is needed,
+    // add a matching reinitialization path before the service is reused.
   }
📝 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
void didChangeAppLifecycleState(AppLifecycleState state) {
if (state == AppLifecycleState.detached) {
SupabaseService().dispose();
void didChangeAppLifecycleState(AppLifecycleState state) {
// Avoid disposing shared singletons here. If explicit teardown is needed,
// add a matching reinitialization path before the service is reused.
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/main.dart` around lines 107 - 109, The lifecycle handler
didChangeAppLifecycleState must not call SupabaseService().dispose() when state
== AppLifecycleState.detached because that permanently sets _disposed and makes
the singleton unrecoverable; remove the SupabaseService().dispose() call from
didChangeAppLifecycleState, and if you need to release transient resources
implement and call a non-terminal method (e.g.,
SupabaseService().suspendStreams() or similar) instead of dispose; ensure
dispose() remains reserved for true app termination or test teardown and that
initialize() can still be called after a detach without failing due to a
permanent _disposed flag.

Comment on lines +413 to +421
onAcceptWithDetails: (details) {
final data = details.data;
final newStatus = status['id'] as String;
if (task['status'] != newStatus) {
_updateTaskStatus(task['id'], newStatus);

if (data['status'] != newStatus) {
_updateTaskStatus(data['id'], newStatus);
}
},
onWillAccept: (data) => data != null,
},
onWillAcceptWithDetails: (details) => details.data != null,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify task-id type flow from UI drag payload to service method signature.
set -e
rg -nP "Future<.*updateTaskStatus\\(|required String taskId" lib/services/supabase_service.dart -C2
rg -nP "_updateTaskStatus\\(|onAcceptWithDetails|details\\.data|\\['id'\\]" lib/screens/tasks/task_screen.dart -C3

Repository: AOSSIE-Org/Ell-ena

Length of output: 3858


🏁 Script executed:

# Search for filteredTasks definition and task data source
rg -nP "filteredTasks\s*=|List<.*Task|fetchTasks|getTasks" lib/screens/tasks/task_screen.dart -C3

# Check task structure/model definition
fd -e dart . lib | xargs grep -l "class Task" | head -5

Repository: AOSSIE-Org/Ell-ena

Length of output: 538


🏁 Script executed:

# Find _tasks field declaration and its type
rg -nP "_tasks\s*[:=]|List<.*tasks" lib/screens/tasks/task_screen.dart | head -10

# Check getTasks return type in supabase_service.dart
rg -nP "Future<.*getTasks|Future<.*List.*dynamic|return.*\[" lib/services/supabase_service.dart -A5 | grep -A5 "getTasks"

Repository: AOSSIE-Org/Ell-ena

Length of output: 356


🏁 Script executed:

# Check getTasks implementation for actual data structure
rg -nP "getTasks.*async.*\{" lib/services/supabase_service.dart -A30 | head -50

# Search for other _updateTaskStatus calls to see how taskId is passed
rg -nP "_updateTaskStatus\(" lib/screens/tasks/task_screen.dart -B2 -A2

Repository: AOSSIE-Org/Ell-ena

Length of output: 378


🏁 Script executed:

# Get the full getTasks implementation to see data structure
sed -n '1154,1200p' lib/services/supabase_service.dart

Repository: AOSSIE-Org/Ell-ena

Length of output: 1222


🏁 Script executed:

# Get the rest of _doGetTasks implementation
sed -n '1185,1250p' lib/services/supabase_service.dart

Repository: AOSSIE-Org/Ell-ena

Length of output: 2214


🏁 Script executed:

# Get more of _doGetTasks to see how tasks are processed
sed -n '1250,1300p' lib/services/supabase_service.dart

Repository: AOSSIE-Org/Ell-ena

Length of output: 1367


Add explicit cast/guard for data['id'] to match String parameter requirement.

At line 418, data['id'] is dynamic from Map<String, dynamic> but _updateTaskStatus requires String taskId. Inconsistent with line 415 where status['id'] is explicitly cast as String in the same callback. This creates a type safety gap that should be protected against payload changes.

Suggested fix
              onAcceptWithDetails: (details) {
                final data = details.data;
                final newStatus = status['id'] as String;

+               final taskId = data['id'] is String ? data['id'] as String : data['id']?.toString();
-               if (data['status'] != newStatus) {
-                 _updateTaskStatus(data['id'], newStatus);
+               if (taskId != null && taskId.isNotEmpty && data['status'] != newStatus) {
+                 _updateTaskStatus(taskId, newStatus);
                }
             },
📝 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
onAcceptWithDetails: (details) {
final data = details.data;
final newStatus = status['id'] as String;
if (task['status'] != newStatus) {
_updateTaskStatus(task['id'], newStatus);
if (data['status'] != newStatus) {
_updateTaskStatus(data['id'], newStatus);
}
},
onWillAccept: (data) => data != null,
},
onWillAcceptWithDetails: (details) => details.data != null,
onAcceptWithDetails: (details) {
final data = details.data;
final newStatus = status['id'] as String;
final taskId = data['id'] is String ? data['id'] as String : data['id']?.toString();
if (taskId != null && taskId.isNotEmpty && data['status'] != newStatus) {
_updateTaskStatus(taskId, newStatus);
}
},
onWillAcceptWithDetails: (details) => details.data != null,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/screens/tasks/task_screen.dart` around lines 413 - 421, The
onAcceptWithDetails callback uses data['id'] (dynamic) but _updateTaskStatus
requires a String; add an explicit cast/guard to ensure a String is passed:
inside the onAcceptWithDetails handler (the block referencing status['id'] and
data), validate or cast data['id'] to String (e.g., check for null and type, or
call as String after confirming) and only call _updateTaskStatus when taskId is
a non-null String; keep the existing check comparing data['status'] to newStatus
and mirror the explicit cast style used for status['id'].

@Satyanarayana001

Copy link
Copy Markdown
Author

Closing this PR as I have created a cleaner version in #248 focusing only on CONTRIBUTING.md.

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