Skip to content

Fix project filtering for tasks without a project name#621

Open
srykaran wants to merge 3 commits intoCCExtractor:mainfrom
srykaran:fix-no-project-filter
Open

Fix project filtering for tasks without a project name#621
srykaran wants to merge 3 commits intoCCExtractor:mainfrom
srykaran:fix-no-project-filter

Conversation

@srykaran
Copy link

@srykaran srykaran commented Mar 11, 2026

Description

This PR fixes an issue where selecting "No Project" incorrectly displayed all tasks instead of only tasks without a project.

The root cause was that an empty string ("") was used to represent both:

  • All Projects (no filter applied)

  • No Project (tasks without a project name)

This overlap caused the filter to reset instead of isolating tasks with no assigned project.

  • Changes

  • Logic Separation

Introduced a sentinel constant HomeController.noProjectValue to explicitly represent the "No Project" filter state.

  • Filtering Logic Fix

Updated HomeController._refreshTasks() to correctly filter tasks where:

  • project == null

  • project == ""

when the "No Project" filter is selected.

  • Localization Support

Added noProject translation keys to the Sentences localization system for all supported languages:

  • English

  • Hindi

  • Marathi

  • French

  • Spanish

  • Bengali

  • German

  • Urdu

  • UI Improvements

  • Added a dedicated "No Project" option to project filter views.

  • Fixed "All Projects" radio buttons to correctly clear the filter.

  • Removed redundant blank entries from dynamic project lists to prevent UI clutter.

  • Result

Selecting "No Project" now correctly displays only tasks without an assigned project, instead of resetting the filter and displaying all tasks.

Fixes #610

This PR resolves the bug reported in issue #610, where selecting the "No Project Name" filter failed to isolate tasks without projects.

Screenshots

  • Before Fix

WhatsApp Image 2026-03-11 at 3 58 11 PM

Selecting "No Project" incorrectly displayed all tasks.

  • After Fix

WhatsApp Image 2026-03-11 at 8 28 42 PM

Selecting "No Project" correctly shows only tasks without a project.

Checklist

  • Tests have been added or updated to cover the changes (not required for this UI/filter logic fix)
  • Documentation has been updated to reflect the changes
  • Code follows the established coding style guidelines
  • All tests are passing

Summary by CodeRabbit

  • New Features
    • Added ability to filter tasks by "No Project" status, allowing users to view tasks without assigned projects
    • Enhanced project filtering interface with radio button selection for "All Projects" and "No Project" options
    • Added multilingual support for "No Project" label across all supported languages

@coderabbitai
Copy link

coderabbitai bot commented Mar 11, 2026

📝 Walkthrough

Walkthrough

This PR addresses the inability to reset project filters and view tasks without assigned projects. It introduces a special "no project" filter option alongside the existing "all projects" option, adds localized translations across nine languages, and updates the project filtering logic to distinguish between unfiltered and explicitly filtered states.

Changes

Cohort / File(s) Summary
Project Filter Logic
lib/app/modules/home/controllers/home_controller.dart, lib/app/modules/home/views/project_column_home_page.dart, lib/app/modules/home/views/project_column_taskc.dart
Introduces noProjectValue constant and refactors project filtering UI. Adds interactive Radio button options for "All Projects" (callback with empty string) and "No Project" (callback with noProjectValue). Updates project list filtering to exclude empty entries. ProjectTileTaskc now supports optional displayName parameter for custom labels.
Language Interface & Translations
lib/app/utils/language/sentences.dart, lib/app/utils/language/{english,bengali,french,german,hindi,marathi,spanish,urdu}_sentences.dart
Adds noProject getter to the Sentences interface and implements localized "no project" translations across all supported languages: "No Project" (English), "কোন প্রকল্প নেই" (Bengali), "Aucun Projet" (French), "Kein Projekt" (German), "कोई प्रोजेक्ट नहीं" (Hindi), "कोणताही प्रकल्प नाही" (Marathi), "Sin Proyecto" (Spanish), "کوئی منصوبہ نہیں" (Urdu).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A filter reset, at long last!
No more projects stuck in the past,
All tasks and none—now both appear,
In nine tongues we celebrate here! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix project filtering for tasks without a project name' accurately summarizes the main change—adding a dedicated 'No Project' filter option to fix filtering logic.
Description check ✅ Passed The description comprehensively covers the issue, root cause, solution approach, localization changes, UI improvements, and includes before/after screenshots.
Linked Issues check ✅ Passed The PR successfully addresses both requirements from issue #610: (1) ability to reset project filter to view all tasks via empty string callback, and (2) dedicated 'No Project' sentinel value to filter tasks without assigned projects.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the project filtering issue: sentinel constant, filtering logic, localization strings, and UI components for project selection are all in scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
lib/app/modules/home/views/project_column_home_page.dart (1)

52-53: ⚠️ Potential issue | 🟡 Minor

Display will show sentinel value with extra spaces when "No Project" is selected.

When projectFilter equals HomeController.noProjectValue (i.e., " (No Project) "), line 53 displays it directly, including the leading/trailing spaces. Consider using the localized noProject string instead.

🔧 Suggested fix to display localized string
                      Text(
-                       projectFilter == "" ? SentenceManager(currentLanguage: AppSettings.selectedLanguage).sentences.notSelected : projectFilter,
+                       projectFilter == ""
+                           ? SentenceManager(currentLanguage: AppSettings.selectedLanguage).sentences.notSelected
+                           : projectFilter == HomeController.noProjectValue
+                               ? SentenceManager(currentLanguage: AppSettings.selectedLanguage).sentences.noProject
+                               : projectFilter,
                        style: TextStyle(
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/app/modules/home/views/project_column_home_page.dart` around lines 52 -
53, The current Text uses projectFilter directly and will display the sentinel
HomeController.noProjectValue (which contains surrounding spaces) verbatim;
update the conditional in the widget that builds the label (where projectFilter
is used) to check if projectFilter == HomeController.noProjectValue and, if so,
use SentenceManager(currentLanguage:
AppSettings.selectedLanguage).sentences.noProject (localized string) instead of
projectFilter, otherwise keep the existing projectFilter or the existing
notSelected fallback; this ensures the "No Project" display is localized and
does not include extra spaces.
lib/app/modules/home/views/project_column_taskc.dart (1)

51-56: ⚠️ Potential issue | 🟡 Minor

Display will show sentinel value with extra spaces when "No Project" is selected.

Similar to project_column_home_page.dart, when projectFilter equals HomeController.noProjectValue, the header displays the raw sentinel value including spaces. Consider mapping to the localized string.

🔧 Suggested fix to display localized string
                  child: Text(
                    projectFilter.isEmpty
                        ? SentenceManager(
                                currentLanguage: AppSettings.selectedLanguage)
                            .sentences
                            .notSelected
+                       : projectFilter == HomeController.noProjectValue
+                           ? SentenceManager(
+                                   currentLanguage: AppSettings.selectedLanguage)
+                               .sentences
+                               .noProject
                        : projectFilter,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/app/modules/home/views/project_column_taskc.dart` around lines 51 - 56,
The header currently shows the raw sentinel "No Project" string with extra
spaces because it only checks projectFilter.isEmpty; update the conditional to
also detect when projectFilter == HomeController.noProjectValue and, in that
case, return the localized sentinel via SentenceManager(currentLanguage:
AppSettings.selectedLanguage).sentences.noProject (or the equivalent localized
property) instead of the raw projectFilter; modify the expression around
projectFilter in project_column_taskc.dart to map HomeController.noProjectValue
to the localized string while keeping the existing empty-string fallback to
notSelected.
🧹 Nitpick comments (2)
lib/app/modules/home/views/project_column_taskc.dart (1)

75-81: Redundant lambda wrapper.

The callback: (val) => callback(val) is equivalent to callback: callback. This is a minor inconsistency since line 71 uses callback directly.

✨ Simplify callback
         ProjectTileTaskc(
             project: HomeController.noProjectValue,
             projectFilter: projectFilter,
-            callback: (val) => callback(val),
+            callback: callback,
             displayName: SentenceManager(
               currentLanguage: AppSettings.selectedLanguage,
             ).sentences.noProject),
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/app/modules/home/views/project_column_taskc.dart` around lines 75 - 81,
The ProjectTileTaskc instantiation uses a redundant lambda for the callback
prop; replace the wrapped form callback: (val) => callback(val) with the direct
reference callback: callback to match the other usages (e.g., the earlier
ProjectTileTaskc call) — update the ProjectTileTaskc call where project:
HomeController.noProjectValue and projectFilter: projectFilter to pass callback
directly.
lib/app/modules/home/controllers/home_controller.dart (1)

44-44: Consider using a more robust sentinel value.

The constant " (No Project) " with leading/trailing spaces works as a sentinel, but spaces can cause subtle issues:

  • If accidentally displayed directly, the spaces would be visible
  • Trimming operations elsewhere could break the sentinel check

A cleaner approach would use a value that's clearly invalid as a project name (e.g., a symbol prefix).

💡 Suggested alternative sentinel value
-  static const String noProjectValue = " (No Project) ";
+  static const String noProjectValue = "\u0000NO_PROJECT";

Or simply document the intentional spaces:

+  /// Sentinel value for filtering tasks without a project.
+  /// Uses leading/trailing spaces to avoid collision with real project names.
   static const String noProjectValue = " (No Project) ";
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/app/modules/home/controllers/home_controller.dart` at line 44, Replace
the fragile sentinel string used by the home controller: update the static const
String noProjectValue to a clearly invalid, trim-safe sentinel (e.g., a
symbol-prefixed token like "__NO_PROJECT__" or similar) and update any
comparisons or UI uses of noProjectValue accordingly so they rely on the new
token rather than whitespace; ensure the change is applied wherever
noProjectValue is referenced (e.g., in HomeController and any view or comparison
logic) and add a short comment documenting that the value is an internal
sentinel that must not be displayed or trimmed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@lib/app/modules/home/views/project_column_home_page.dart`:
- Around line 52-53: The current Text uses projectFilter directly and will
display the sentinel HomeController.noProjectValue (which contains surrounding
spaces) verbatim; update the conditional in the widget that builds the label
(where projectFilter is used) to check if projectFilter ==
HomeController.noProjectValue and, if so, use SentenceManager(currentLanguage:
AppSettings.selectedLanguage).sentences.noProject (localized string) instead of
projectFilter, otherwise keep the existing projectFilter or the existing
notSelected fallback; this ensures the "No Project" display is localized and
does not include extra spaces.

In `@lib/app/modules/home/views/project_column_taskc.dart`:
- Around line 51-56: The header currently shows the raw sentinel "No Project"
string with extra spaces because it only checks projectFilter.isEmpty; update
the conditional to also detect when projectFilter ==
HomeController.noProjectValue and, in that case, return the localized sentinel
via SentenceManager(currentLanguage:
AppSettings.selectedLanguage).sentences.noProject (or the equivalent localized
property) instead of the raw projectFilter; modify the expression around
projectFilter in project_column_taskc.dart to map HomeController.noProjectValue
to the localized string while keeping the existing empty-string fallback to
notSelected.

---

Nitpick comments:
In `@lib/app/modules/home/controllers/home_controller.dart`:
- Line 44: Replace the fragile sentinel string used by the home controller:
update the static const String noProjectValue to a clearly invalid, trim-safe
sentinel (e.g., a symbol-prefixed token like "__NO_PROJECT__" or similar) and
update any comparisons or UI uses of noProjectValue accordingly so they rely on
the new token rather than whitespace; ensure the change is applied wherever
noProjectValue is referenced (e.g., in HomeController and any view or comparison
logic) and add a short comment documenting that the value is an internal
sentinel that must not be displayed or trimmed.

In `@lib/app/modules/home/views/project_column_taskc.dart`:
- Around line 75-81: The ProjectTileTaskc instantiation uses a redundant lambda
for the callback prop; replace the wrapped form callback: (val) => callback(val)
with the direct reference callback: callback to match the other usages (e.g.,
the earlier ProjectTileTaskc call) — update the ProjectTileTaskc call where
project: HomeController.noProjectValue and projectFilter: projectFilter to pass
callback directly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: abbd71f6-37e6-4aae-ae91-ff90b024fb89

📥 Commits

Reviewing files that changed from the base of the PR and between f058b4a and 8b277e6.

📒 Files selected for processing (12)
  • lib/app/modules/home/controllers/home_controller.dart
  • lib/app/modules/home/views/project_column_home_page.dart
  • lib/app/modules/home/views/project_column_taskc.dart
  • lib/app/utils/language/bengali_sentences.dart
  • lib/app/utils/language/english_sentences.dart
  • lib/app/utils/language/french_sentences.dart
  • lib/app/utils/language/german_sentences.dart
  • lib/app/utils/language/hindi_sentences.dart
  • lib/app/utils/language/marathi_sentences.dart
  • lib/app/utils/language/sentences.dart
  • lib/app/utils/language/spanish_sentences.dart
  • lib/app/utils/language/urdu_sentences.dart

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.

Project filter cannot be unset/reset

1 participant