Fix project filtering for tasks without a project name#621
Fix project filtering for tasks without a project name#621srykaran wants to merge 3 commits intoCCExtractor:mainfrom
Conversation
📝 WalkthroughWalkthroughThis 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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 | 🟡 MinorDisplay will show sentinel value with extra spaces when "No Project" is selected.
When
projectFilterequalsHomeController.noProjectValue(i.e.," (No Project) "), line 53 displays it directly, including the leading/trailing spaces. Consider using the localizednoProjectstring 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 | 🟡 MinorDisplay will show sentinel value with extra spaces when "No Project" is selected.
Similar to
project_column_home_page.dart, whenprojectFilterequalsHomeController.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 tocallback: callback. This is a minor inconsistency since line 71 usescallbackdirectly.✨ 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
📒 Files selected for processing (12)
lib/app/modules/home/controllers/home_controller.dartlib/app/modules/home/views/project_column_home_page.dartlib/app/modules/home/views/project_column_taskc.dartlib/app/utils/language/bengali_sentences.dartlib/app/utils/language/english_sentences.dartlib/app/utils/language/french_sentences.dartlib/app/utils/language/german_sentences.dartlib/app/utils/language/hindi_sentences.dartlib/app/utils/language/marathi_sentences.dartlib/app/utils/language/sentences.dartlib/app/utils/language/spanish_sentences.dartlib/app/utils/language/urdu_sentences.dart
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.
Updated HomeController._refreshTasks() to correctly filter tasks where:
project == null
project == ""
when the "No Project" filter is selected.
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
Selecting "No Project" incorrectly displayed all tasks.
Selecting "No Project" correctly shows only tasks without a project.
Checklist
Summary by CodeRabbit