Skip to content

fix: Favorites filter not applied on reload in the project view - EXO-88376#629

Merged
bmestrallet merged 1 commit into
feature/ai-contributionfrom
fix/EXO-88376-favorites-filter-project-view
Jul 22, 2026
Merged

fix: Favorites filter not applied on reload in the project view - EXO-88376#629
bmestrallet merged 1 commit into
feature/ai-contributionfrom
fix/EXO-88376-favorites-filter-project-view

Conversation

@bmestrallet

Copy link
Copy Markdown

Follow-up to #619 / #624 / #628 on EXO-88376, addressing @jihed_chabbeh's re-test: "set to display favorite tasks on filter → refresh page: the filter is set but displayed list is not ok".

Root cause — #628 fixed only one of the two dashboards

The "Favorites only" filter is edited in one shared drawer but consumed by two dashboards:

persists favorite restores toggle + count on reload applies it to the fetch
My Tasks (TasksDashboard) yes yes yes — since #628
Project / space board (TasksViewDashboard) yes yes no ← the bug

TasksFilterDrawer.saveValueFilterInStorage() writes favorite into filterStorage<projectId>+<tab> for projects too, open() restores the toggle from that key and TasksViewToolbar restores the count chip from filtersNumber — but TasksViewDashboard rebuilt tasksFilter with only groupBy / orderBy / offset / limit / showCompletedTasks, dropping favorite. So on load the request went out unfiltered while the UI showed the filter as set. (#628's statement that the project view "does not persist the favorite filter" was incorrect, which is how this slipped through.)

Fixes

  • TasksViewDashboard.vue — carry favorite through both restore paths (the project watcher and getTasksByProject) and the no-storage defaults. This also repairs the un-bookmark listener added in fix: un-bookmark removes the task from the Favorites filter + grey filter star - EXO-88376 #624, whose guard reads tasksFilter.favorite and therefore silently bailed out after a reload.
  • TasksDashboard.vue — sync filterTasks.favorite in the ALL branch of filterTaskQuery (a stale value re-applied the filter on any updateTasksList(): task added, assignee/priority/due-date changed), and clear the favorites restriction when the primary filter changes, so the list matches the drawer that resetFields('primary') just cleared.
  • TasksListToolbar.vue — restore the filter count from this view's own storage key (not the shared filtersNumber, also written by the project toolbar), and stop the mount-time primary-filter-task re-emit that reset the drawer fields and the count restored moments earlier on every load.

Front-end only, 3 files, +35/−3. eslint clean.

Verification

Built the services JAR + WAR from this branch and deployed on a local 7.3 platform:

  • Project board: 6 tasks → Favorites only → 2 → reload → still 2, chip shows 1, and the initial request is GET /tasks/filter?projectId=1&…&favorite=true (was favorite= before).
  • My Tasks: 3 tasks → 1 → reload → still 1, and the chip now reads Filter (1) (it used to reset to 0 while the list stayed filtered).
  • fix: un-bookmark removes the task from the Favorites filter + grey filter star - EXO-88376 #624 regression check: un-bookmarking a task on a reloaded favorites-filtered board removes the row immediately and the menu flips to "Make it a favorite".
  • Switching the primary filter to "Assigned to me" clears the favorites restriction in the list, the drawer and the count together.

Known limitation (unchanged, out of scope)

TaskRestService.filterTasks filters favorites after pagination (taskList is already the page), so in My Tasks (limit=20) a user whose favorites sit beyond the first page sees too few rows and tasksSize / "Show more" are off. The project view is unaffected (limit=0). Happy to address it in a separate PR if you want it fixed now.

🤖 Generated with Claude Code

…8376

Follow-up to #619/#624/#628 on @jihed_chabbeh's re-test: after a reload the
"Favorites only" toggle and the filter count come back set, but the displayed
list is not filtered.

Root cause: the favorites filter is edited in one shared drawer but consumed by
two dashboards, and #628 only fixed one of them. TasksFilterDrawer persists
`favorite` into `filterStorage<projectId>+<tab>` for projects too, and restores
the toggle (and TasksViewToolbar the count chip) from that same key — but
TasksViewDashboard rebuilt `tasksFilter` with only groupBy/orderBy/
showCompletedTasks, dropping `favorite`, so the fetch on load went out
unfiltered. Hence "the filter is set but the list is not".

Fixes:
- TasksViewDashboard: carry `favorite` through both restore paths (the `project`
  watcher and getTasksByProject) and the no-storage defaults. This also repairs
  the un-bookmark listener from #624, whose guard reads tasksFilter.favorite and
  silently bailed out after a reload.
- TasksDashboard: sync filterTasks.favorite in the ALL branch of
  filterTaskQuery (a stale value re-applied the filter on any
  updateTasksList()), and drop the favorites restriction when the primary filter
  changes, so the list matches the drawer that resetFields() just cleared.
- TasksListToolbar: restore the filter count from this view's own storage key,
  and stop the mount-time primary-filter re-emit which reset the drawer state
  and the count that had just been restored on every load.

Verified live on a local 7.3 platform with a build of this branch:
- project board: 6 tasks -> Favorites only -> 2 -> reload -> still 2, chip "1",
  initial request carries `favorite=true`;
- My Tasks: 3 -> 1 -> reload -> still 1, chip now reads "Filter (1)" (was 0);
- un-bookmark on a reloaded filtered board removes the row on the spot;
- switching the primary filter clears the favorites restriction everywhere.
Front-end only, lint clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bmestrallet
bmestrallet requested a review from ahamdi July 22, 2026 10:32
@github-actions github-actions Bot added the partialCIBuild Perform Partial CI Build label Jul 22, 2026
@sonarqubecloud

Copy link
Copy Markdown

@bmestrallet
bmestrallet merged commit 620dcc8 into feature/ai-contribution Jul 22, 2026
9 checks passed
@bmestrallet
bmestrallet deleted the fix/EXO-88376-favorites-filter-project-view branch July 22, 2026 10:48
Jihed525 added a commit that referenced this pull request Jul 22, 2026
## What

Backport of #619, #624, #628, #629 onto `develop`.

Adds a **"Favorites only"** filter for tasks (follow-up to Favorites
#615 / EXO-88316), with the fixes that followed after real-world
testing:

- **#619** — `favorite` query param on `GET /tasks/filter` (batched via
`FavoriteService`) + a "Favorites only" toggle in the Sort & Filter
drawer, persisted in localStorage.
- **#624** — un-bookmarking a task now removes it from the
favorites-filtered list immediately (list rows carry `favorite` state,
front-end listens for `metadata.favorite.updated`); drawer star
recolored to neutral grey.
- **#628** — the persisted "Favorites only" toggle is now honored on the
*first* fetch after a page reload in My Tasks (was previously applied
only after the initial unfiltered fetch).
- **#629** — same reload fix extended to the project/space board view,
which #628 had missed.

## Backport notes

Cherry-picked the 4 commits onto `develop`. Two conflicts, both
resolved:
- `TaskRestService.java`: import conflict (develop already had
`FavoriteService` imported for an unrelated feature); also dropped a
private `isFavorite(String, long)` helper introduced by #624 that
duplicated `FavoriteUtil.isFavorite`, already present on `develop` since
#622 (`Favorites for projects & tasks - EXO-88316`) — it was unused here
since `getTaskById` on `develop` already goes through `FavoriteUtil`.
- `TasksViewDashboard.vue`: #629's diff assumed `favorite` had been
dropped from this file by an intermediate commit that only exists on
`feature/ai-contribution`, not `develop` — on `develop` the field was
already being carried through (from #619/#624), so the "fix" was already
effectively in place; resolved by keeping upstream's exact wording where
it was purely a stylistic difference (`!!x` vs `x || false`), for
consistency.

## Test

- `mvn -pl services -am -Dcheckstyle.skip=true -DskipTests install` →
BUILD SUCCESS
- `mvn -pl services -Dcheckstyle.skip=true -Dtest=TestTaskRestService
test` → 20 tests, 0 failures/errors

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

partialCIBuild Perform Partial CI Build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant