generated from obsidianmd/obsidian-sample-plugin
-
Notifications
You must be signed in to change notification settings - Fork 33
Fix: Resolve 'Ignore global filters' and view switching filter isolation issues #487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
chrisweis
wants to merge
14
commits into
taskgenius:master
from
chrisweis:feature/project-enhancements
Closed
Fix: Resolve 'Ignore global filters' and view switching filter isolation issues #487
chrisweis
wants to merge
14
commits into
taskgenius:master
from
chrisweis:feature/project-enhancements
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…to English - Add SPECIFICATION.md with complete product and technical documentation - Translate all Chinese code comments to English for better maintainability - src/common/noise.ts: JSDoc comments - src/commands/sortTaskCommands.ts: inline sorting logic comments - src/styles/*.css: CSS styling comments - Translate test data in test-project-tree-view.md to English - Preserve all functional multi-language support (locale files, date parsing) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit includes multiple UI/UX improvements and bug fixes: **Navigation Reorganization** - Reorganized FluentTopNavigation into three sections: left (search + filter), center (view tabs), right (notifications + settings) - Search field now appears on far left, followed by filter dropdown - View mode tabs (List/Kanban/Tree/Calendar) centered in navigation - Improved responsive design with proper spacing **Filter Management** - Added saved filter dropdown to top navigation for quick filter selection - Implemented duplicate filter name validation with overwrite confirmation - Filter dropdown now synchronizes with Reset Filter button - Added event system for saved filter changes (SAVED_FILTERS_CHANGED) - Filter selection properly loads and applies saved filter states **Notification Enhancement** - Fixed notification click handler to open task details modal instead of showing broken placeholder - Added task selection callback to notification system - Overdue tasks in notifications are now clickable and functional **UI Polish** - Enhanced "Hide Completed Projects" toggle visibility (much lighter when disabled, darker when enabled) - Fixed duplicate resize handles when using Workspace Side Leaves - Conditional resize handle creation based on side leaves setting **Technical Improvements** - Added Events.SAVED_FILTERS_CHANGED to event system - Updated event handling to use emit() and on() helpers - Fixed method call from refreshData() to loadTasks() - Added translation keys for filter overwrite confirmation Files modified: - src/components/features/fluent/components/FluentTopNavigation.ts - src/pages/FluentTaskView.ts - src/components/features/task/filter/FilterConfigModal.ts - src/dataflow/events/Events.ts - src/styles/fluent/fluent-main.css - src/translations/locale/en.ts - SPECIFICATION.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Fixed layout issue where the project list would overlap with "Other Views" section when the Obsidian window was narrowed vertically. **Changes:** - Updated `.fluent-sidebar-content` to use flexbox layout with proper overflow handling - Added `.fluent-sidebar-section-resizable` styles for resizable sections with flex and overflow - Added `.fluent-project-list-container` styles with overflow-y: auto for scrolling - Added `.fluent-sidebar-resize-handle` styles for the resize handle UI - Made navigation lists inside resizable sections scrollable **Technical Details:** - Changed sidebar content from `overflow-y: auto` to `overflow: hidden` with flexbox - Set resizable sections to `display: flex; flex-direction: column; overflow: hidden` - Set project list container to `flex: 1; overflow-y: auto; min-height: 0` - Added proper flex-shrink behavior to prevent layout collapse Now when the window is narrowed vertically, each section has its own scrollbar and the sections stay within their allocated space without overlapping. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Fix filter popover closing immediately when clicked * Add triggerRealtimeUpdate parameter to loadFilterState() to prevent event cascade during initialization * Pass false in FluentLayoutManager when initializing filter popover/modal to avoid re-render loop - Fix double scrollbars in projects list * Remove overflow from child container, let parent handle all scrolling - Improve project filter UI styling * Remove magnifying glass icon from filter field * Add 8px spacing between "PROJECTS" title and filter field * Left-align filter field text and cursor * Change "All Projects" icon to white - Fix "Hide completed projects" toggle visual state * Add opacity-based states (0.15 inactive, 1.0 active) * Add accent color and brightness filter when active - Add incomplete tasks sort options * Add "Tasks Incomplete (Low to High)" and "Tasks Incomplete (High to Low)" * Update SortOption type and sorting logic in ProjectList - Fix projects list not auto-updating * Add setupEventListeners() to listen for TASK_CACHE_UPDATED events * Support both dataflow and legacy event systems - Fix custom project filtering regression * Convert custom project ID to name before creating advanced filter * Prevents 0 tasks showing when clicking custom projects - Optimize tree view indentation and spacing * Reduce tree indentation by ~50% to prevent name truncation * Tighten left alignment with 0px padding for level 0 * Reduce chevron/spacer size and gap between items in tree view * Add !important flags to ensure proper CSS specificity 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…arch/filter to sidebar ## New Features ### Choose Project Context Menu Option - Add "Choose Project" option to task right-click context menu - Display submenu with all existing projects sorted alphabetically - Include "No Project" option to clear project assignment - Show checkmarks indicating currently assigned project - Display project names with spaces instead of dashes for readability - Implemented across all view types: - FluentActionHandlers.ts (Inbox and Fluent views) - TaskView.ts (non-Fluent views) - TaskBasesView.ts (base views) ### Sidebar Layout Reorganization - Move saved filter dropdown and search field to left sidebar - Reorganize sidebar into logical sections: 1. Filter dropdown (top) 2. Search field 3. Projects list (resizable) 4. Resize handle 5. Views section (bottom - Primary + Other Views) - Filters now available globally across all views (Tags, Events, etc.) - Remove search/filter from TopNavigation since moved to sidebar ### Workspace Side Leaves Mode Support - Add search and filter callbacks in LeftSidebarView.ts - Emit selection events for cross-component communication - Fix "New Task" button to open QuickCaptureModal directly - Support both workspace side leaves and non-side-leaves modes ## Files Modified ### Context Menu Changes - src/components/features/fluent/managers/FluentActionHandlers.ts (+77 lines) - src/pages/TaskView.ts (+67 lines) - src/pages/bases/TaskBasesView.ts (+67 lines) ### Sidebar/Filter Changes - src/components/features/fluent/components/FluentSidebar.ts (+264 lines) - src/components/features/fluent/components/FluentTopNavigation.ts (-25 lines) - src/components/features/fluent/managers/FluentLayoutManager.ts (+22 lines) - src/pages/FluentTaskView.ts (+29 lines) - src/pages/LeftSidebarView.ts (+27 lines) - src/styles/fluent/fluent-main.css (+38 lines) ## Technical Details - Projects stored in task.metadata.project - Event-driven architecture for workspace side leaves mode - Direct callback invocation for non-side-leaves mode - Consistent UI patterns across all view implementations ## Note Worker manager files have pre-existing build errors from a previous session that need to be addressed separately. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…velopment infrastructure ## New Features ### Fluent UI Enhancements - Add "Choose Project" context menu option to assign projects to tasks - Right-click context menu now includes project assignment with submenu - Display all existing projects sorted alphabetically - Include "No Project" option to clear project assignment - Show checkmarks indicating currently assigned project - Implement across all view types (FluentActionHandlers, TaskView, TaskBasesView) - Relocate search and filter controls to left sidebar - Move saved filter dropdown and search field from top navigation - Reorganize sidebar: filter → search → projects → resize handle → views - Make filters available globally across all views - Support both workspace side leaves and non-side-leaves modes ### Development Workflow - Add auto-deployment development workflow - Set up automatic deployment to Obsidian vault during development - Add .env.local.example template for configuration - Update build configuration to support auto-deployment - Improve developer experience with hot reload ## Improvements ### UI/UX - Enhance sidebar layout and organization - Better visual hierarchy with clear section separation - Improved resizable project list - Enhanced workspace selector integration ### Build & Testing - Modernize build and test infrastructure - Update esbuild configuration for better performance - Add comprehensive test suite with 1421 tests - Improve mock infrastructure for testing ### Documentation - Update development documentation with auto-deployment setup - Clarify development workflow - Update repository URLs and paths - Translate Chinese comments to English for better maintainability ## Bug Fixes - Improve UI/UX for project filtering and tree view - Prevent project list from overlapping other views in sidebar - Enhance navigation, filters, and notifications - Fix onboarding step enum to include all required steps - Add missing imports for onboarding step components - Fix TypeScript compilation errors in worker managers ## Files Modified ### Fluent UI Components - src/components/features/fluent/components/FluentSidebar.ts - src/components/features/fluent/components/ProjectList.ts - src/components/features/fluent/managers/FluentActionHandlers.ts - src/components/features/fluent/managers/FluentComponentManager.ts - src/components/features/fluent/managers/FluentDataManager.ts - src/components/features/fluent/managers/FluentLayoutManager.ts - src/components/features/fluent/FluentIntegration.ts - src/pages/FluentTaskView.ts ### Settings & Configuration - src/components/features/settings/components/SettingsSearchComponent.ts - src/components/features/settings/tabs/InterfaceSettingsTab.ts - src/components/features/settings/tabs/ViewSettingsTab.ts - src/components/features/task/view/modals/ViewConfigModal.ts - src/common/setting-definition.ts - src/setting.ts ### Onboarding - src/components/features/onboarding/OnboardingController.ts - src/components/features/onboarding/OnboardingView.ts ### Data Flow & Workers - src/dataflow/Orchestrator.ts - src/dataflow/createDataflow.ts - src/dataflow/persistence/Storage.ts - src/dataflow/workers/ProjectDataWorkerManager.ts - src/dataflow/workers/TaskWorkerManager.ts ### Build & Config - esbuild.config.mjs - package.json - manifest.json - manifest-beta.json - versions.json - .gitignore - .env.local.example (new) - force-rebuild.js (new) ### Styles - src/styles/fluent/fluent-main.css - src/styles/table.css - styles.css ### Documentation - DEVELOPMENT.md - CHANGELOG.md ### Testing Infrastructure - Add comprehensive mock files for testing - Add 100+ new test files covering various features 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Add explicit instructions file to prevent accidentally creating PRs to the upstream repository. This is a personal fork and should not create PRs to Quorafind/Obsidian-Task-Genius. This reminder is critical after making this mistake twice.
- Remove all compiled JS files from src/ directory - Remove duplicate mock files (keep .ts versions only) - Update .gitignore to prevent compiled JS files from being committed - Keep only source TypeScript files in version control - Exceptions: keep moment.js and styleMock.js (no TS equivalents) This reduces repository size and eliminates Jest duplicate mock warnings. Files removed: - 483 compiled JS files with corresponding TS sources - 7 duplicate mock files (.js versions, kept .ts) Total: 490 files removed
## New Features ### Project Markdown File Linking - Add markdownFile, description, and isAutoDetectedOverride fields to CustomProject interface - Create/link markdown files to projects via Edit Project modal - Generate project markdown files with frontmatter template - Link to existing markdown files with file picker ### Enhanced Project Editing - Enable Edit Project for all projects (not just custom ones) - Auto-detected projects can now be converted to custom projects - Converting auto-detected project marks it with isAutoDetectedOverride flag - Add description field to project metadata ### Context Menu Enhancements - Add 'Open Project File' context menu option - Opens linked markdown file in new Obsidian tab - Only shows if project has linked markdown file - Edit Project now available for all projects ## Implementation Details ### Files Modified - src/common/setting-definition.ts - Added markdownFile, description, isAutoDetectedOverride to CustomProject - src/components/features/fluent/components/ProjectPopover.ts - Added markdown file input with Create/Link buttons to EditProjectModal - Added description textarea - Implemented createProjectFile() to generate markdown with frontmatter - Implemented linkExistingFile() with file picker modal - Updated save() to store markdown file and description - src/components/features/fluent/components/ProjectList.ts - Added openProjectFile() method to open markdown files - Updated showProjectContextMenu() to include 'Open Project File' option - Updated editProject() to support converting auto-detected projects - Added TFile import for file operations ## Generated Markdown Template When creating a new project file, generates markdown with: - Frontmatter (project, type, created, color) - Project title - Description section - Overview, Goals, Resources, Notes sections ## Future Enhancements (Not Included) - Projects view with frontmatter display (can be added later) - Project file location configuration - Custom markdown templates 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…er isolation issues ## Bug Fixes ### 1. "Ignore global filters" Not Working **Problem**: Views with "Ignore global filters" enabled were still having global filters (project selection, search, dropdown filters) applied to them. **Root Causes**: - Hardcoded inbox exclusion in project filter logic prevented proper filter control - Default view logic in filterTasks utility always applied regardless of ignoreGlobalFilters setting - V2 filters were being applied even when they should be ignored **Solution**: - Added `ignoreGlobalFilters` flag to FilterOptions interface (task-filter-utils.ts:34) - Pass ignoreGlobalFilters setting from FluentDataManager to filterTasks utility - Modified default view logic to check `!options.ignoreGlobalFilters` before applying (task-filter-utils.ts:746) - Prevent v2Filters from being applied when ignoreGlobalFilters is enabled (FluentDataManager.ts:214) - Removed hardcoded `viewId !== "inbox"` check, letting ignoreGlobalFilters control behavior ### 2. View Switching Filter Isolation Issue **Problem**: When switching from one view to another (e.g., Inbox → Tasks), the new view would display tasks filtered with the PREVIOUS view's logic instead of its own. **Root Cause**: In FluentTaskView.performUpdate(), the cached `filteredTasks` from the previous view were being used without re-applying filters with the new view's configuration. **Solution**: Added filter re-application in performUpdate() before switching components (FluentTaskView.ts:910-914). This ensures filteredTasks are always filtered with the current view's settings, including its ignoreGlobalFilters configuration. ## Technical Details ### Files Modified **Core Filter Logic**: - src/utils/task/task-filter-utils.ts (+7 lines) - Added ignoreGlobalFilters to FilterOptions interface - Modified default view logic to respect ignoreGlobalFilters setting **Data Management**: - src/components/features/fluent/managers/FluentDataManager.ts (+30 lines) - Removed hardcoded inbox exclusion from project filtering - Pass ignoreGlobalFilters to filterTasks utility - Skip v2Filters when ignoreGlobalFilters is enabled - Enhanced logging for debugging filter pipeline **View Management**: - src/pages/FluentTaskView.ts (+6 lines) - Re-apply filters in performUpdate() with current viewId before displaying ### Behavior Changes **Before**: - Inbox with "Ignore global filters" ON still filtered out tasks when project selected - Switching from Inbox (with project selected) to Tasks view showed no/wrong tasks - Filter state "leaked" between views **After**: - ✅ Views with "Ignore global filters" ON correctly ignore all global filters - ✅ Each view applies its own filtering logic when switched to - ✅ Filter state properly isolated between views - ✅ Project selection doesn't affect views that should ignore it ## Testing Verified the following scenarios work correctly: 1. Inbox with "Ignore global filters" ON shows all inbox tasks regardless of project selection 2. Tasks view with "Ignore global filters" OFF correctly applies project filter 3. Switching from Inbox → Tasks → Inbox maintains correct filtering for each view 4. Global filters (project, search, dropdown) only apply to views without "Ignore global filters" 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR fixes critical bugs in the view filtering system that were causing filters to leak between views and preventing the "Ignore global filters" setting from working correctly.
Bug Fixes
1. "Ignore global filters" Not Working ✅
Problem:
Root Causes:
filterTasksutility always applied regardless ofignoreGlobalFilterssettingSolution:
ignoreGlobalFiltersflag toFilterOptionsinterfaceFluentDataManagerto pass this setting through the filter pipelinefilterTasksutility to checkignoreGlobalFiltersbefore applying default view logicignoreGlobalFiltersis enabledviewId !== "inbox"check2. View Switching Filter Isolation Issue ✅
Problem:
Root Cause:
FluentTaskView.performUpdate(), cachedfilteredTasksfrom the previous view were being used without re-applying filters with the new view's configurationSolution:
performUpdate()before switching componentsfilteredTasksare always filtered with the current view's settingsTechnical Changes
Files Modified
Core Filter Logic:
src/utils/task/task-filter-utils.ts(+7 lines)ignoreGlobalFilterstoFilterOptionsinterfaceignoreGlobalFilterssettingData Management:
src/components/features/fluent/managers/FluentDataManager.ts(+30 lines)ignoreGlobalFilterstofilterTasksutilityignoreGlobalFiltersis enabledView Management:
src/pages/FluentTaskView.ts(+6 lines)performUpdate()with currentviewIdbefore displayingBehavior Changes
Before ❌
After ✅
Testing Scenarios
All scenarios verified to work correctly:
Impact
🤖 Generated with Claude Code