[PR #1325] feat: Persist board filters in localStorage #1272

Open
opened 2026-02-05 19:00:22 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/plankanban/planka/pull/1325
Author: @symonbaikov
Created: 9/3/2025
Status: 🔄 Open

Base: masterHead: feature/persist-board-filters


📝 Commits (3)

  • d7d0bc3 feat: persist board filters in localStorage
  • cbb6810 fix Board.js
  • 60d351b fix Board.js & users.js

📊 Changes

4 files changed (+106 additions, -8 deletions)

View changed files

📝 client/src/models/Board.js (+17 -8)
📝 client/src/sagas/core/services/labels.js (+5 -0)
📝 client/src/sagas/core/services/users.js (+5 -0)
client/src/utils/localStorage.js (+79 -0)

📄 Description

CleanShot 2025-09-03 at 09 35 09

  • Persistent Label Filters: Selected labels are now saved and restored across browser sessions
  • Persistent User Filters: Selected users are now saved and restored across browser sessions
  • Per-Board Storage: Each board maintains its own independent filter state
  • Error Handling: Graceful fallbacks if localStorage is unavailable
  • Clean Integration: Follows existing code patterns and maintains backward compatibility

New Files

  • client/src/utils/localStorage.js - Utility functions for managing board filters in localStorage

Modified Files

  • client/src/sagas/core/services/labels.js - Updated label filter functions to save/restore from localStorage
  • client/src/sagas/core/services/users.js - Updated user filter functions to save/restore from localStorage
  • client/src/models/Board.js - Modified to restore filters on board load and handle clearing

Key Functions

  • addLabelToBoardFilters() / removeLabelFromBoardFilters() - Manage label persistence
  • addUserToBoardFilters() / removeUserFromBoardFilters() - Manage user persistence
  • getBoardFiltersFromStorage() - Restore filters when loading boards
  • clearBoardFilters() - Handle filter clearing scenarios

How It Works

  1. When filters are added: Immediately saved to localStorage with board-specific keys
  2. When filters are removed: Immediately removed from localStorage
  3. When boards are loaded: Previously saved filters are automatically restored
  4. When filters are cleared: localStorage is also cleared for that board
  • Before: Users had to re-select filters every time they returned to a board
  • After: Filters persist automatically across sessions, tabs, and browser restarts

Closes: #1311


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/plankanban/planka/pull/1325 **Author:** [@symonbaikov](https://github.com/symonbaikov) **Created:** 9/3/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `feature/persist-board-filters` --- ### 📝 Commits (3) - [`d7d0bc3`](https://github.com/plankanban/planka/commit/d7d0bc3883ec99cfb37df59278a5a32350a74dfb) feat: persist board filters in localStorage - [`cbb6810`](https://github.com/plankanban/planka/commit/cbb6810ce0d3d63d0bd797b7198ba41dbe0de812) fix Board.js - [`60d351b`](https://github.com/plankanban/planka/commit/60d351b76cfec6e917282da27a814217353d1379) fix Board.js & users.js ### 📊 Changes **4 files changed** (+106 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `client/src/models/Board.js` (+17 -8) 📝 `client/src/sagas/core/services/labels.js` (+5 -0) 📝 `client/src/sagas/core/services/users.js` (+5 -0) ➕ `client/src/utils/localStorage.js` (+79 -0) </details> ### 📄 Description ![CleanShot 2025-09-03 at 09 35 09](https://github.com/user-attachments/assets/cdba9e0f-6f8a-4d98-b5bd-fb5a9458cb85) - **Persistent Label Filters**: Selected labels are now saved and restored across browser sessions - **Persistent User Filters**: Selected users are now saved and restored across browser sessions - **Per-Board Storage**: Each board maintains its own independent filter state - **Error Handling**: Graceful fallbacks if localStorage is unavailable - **Clean Integration**: Follows existing code patterns and maintains backward compatibility ### New Files - `client/src/utils/localStorage.js` - Utility functions for managing board filters in localStorage ### Modified Files - `client/src/sagas/core/services/labels.js` - Updated label filter functions to save/restore from localStorage - `client/src/sagas/core/services/users.js` - Updated user filter functions to save/restore from localStorage - `client/src/models/Board.js` - Modified to restore filters on board load and handle clearing ### Key Functions - `addLabelToBoardFilters()` / `removeLabelFromBoardFilters()` - Manage label persistence - `addUserToBoardFilters()` / `removeUserFromBoardFilters()` - Manage user persistence - `getBoardFiltersFromStorage()` - Restore filters when loading boards - `clearBoardFilters()` - Handle filter clearing scenarios ## How It Works 1. **When filters are added**: Immediately saved to localStorage with board-specific keys 2. **When filters are removed**: Immediately removed from localStorage 3. **When boards are loaded**: Previously saved filters are automatically restored 4. **When filters are cleared**: localStorage is also cleared for that board - **Before**: Users had to re-select filters every time they returned to a board - **After**: Filters persist automatically across sessions, tabs, and browser restarts Closes: #1311 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 19:00:22 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/planka-plankanban#1272