mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2026-03-24 12:56:59 +00:00
[PR #8278] [MERGED] fix: prevent page flickering on rapid sidebar clicks #8331
Labels
No labels
2024
2025
2026
acct mgmt
AI
automation
bug
calendar
ci
CJK
cloud
code-block
collaboration
copy-paste
database
data migration
data sync
deploy
desktop
develop
develop
documentation
duplicate
editor
editor-plugin
emoji
export
files
flutter-only
follow-up
formula
good first issue for devs
good first issue for experienced devs
grid
hacktoberfest
HACKTOBERFEST-ACCEPTED
help wanted
i18n
icons
images
importer
improvements
infra
install
integrations
IR
kanban board
login
look and joy
mentorship
mobile
mobile
needs design
new feature
new feature
non-coding
notes
notifications
onboarding
organization
P0+
permission
platform-linux
platform-mac
platform-windows
plugins
program
pull-request
Q1 25
Q1 26
Q2 24
Q2 25
Q3 24
Q3 25
Q4 24
Q4 25
react
regression
rust
rust
Rust-only
Rust-only
Rust-starter
Rust-starter
self-hosted
shortcuts
side panel
slash-menu
sync v2
table
tablet
task
tauri
templates
tests
themes
translation
v0.5.6
v0.5.8
v0.5.9
v0.6.0
v0.6.1
v0.6.4
v0.6.7
v0.6.8
v0.7.1
v0.7.4
v0.7.4
v0.7.5
v0.7.6
v0.7.7
v0.7.8
v0.8.0
v0.8.4
v0.8.5
v0.8.9
web
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AppFlowy-IO/AppFlowy#8331
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/AppFlowy-IO/AppFlowy/pull/8278
Author: @RishiAhuja
Created: 10/9/2025
Status: ✅ Merged
Merged: 11/7/2025
Merged by: @LucasXu0
Base:
main← Head:fix/page-flickering-rapid-clicks-8252📝 Commits (2)
c3e1a9efix: prevent page flickering on rapid sidebar clicksb5f74a8refactor: improve deduplication to check both plugin and view IDs📊 Changes
2 files changed (+39 additions, -1 deletions)
View changed files
📝
frontend/appflowy_flutter/lib/workspace/application/tabs/tabs_bloc.dart(+21 -0)📝
frontend/appflowy_flutter/lib/workspace/presentation/home/menu/view/view_item.dart(+18 -1)📄 Description
Pull Request Description
Feature Preview
Before
https://github.com/user-attachments/assets/0ae313e2-71e3-4c47-92db-db6a06e7e0b4
After
https://github.com/user-attachments/assets/cd771f85-f5b2-4437-a340-fb9d49ff6d1a
What This PR Does
This PR fixes the page flickering issue that occurs when rapidly clicking between pages in the sidebar (#8252).
The Problem:
When users click rapidly between pages in the sidebar, all those clicks were being processed sequentially. Each click triggered a navigation event, causing the page to rapidly switch and re-render, creating a visible flickering effect (A→B→C→D).
I tried to implement a two-layer approach:
UI-level throttling: Added throttling in
view_item.darton the sidebar click handler. Subsequent clicks within a 200ms window are ignored. This interval feels instantaneous to the user but is effective at catching most unintentional rapid clicks.Bloc-level deduplication: As a fallback, logic has been added to tabs_bloc.dart. The bloc now tracks the most recently opened plugin and its timestamp. If another request to open the same plugin arrives within a 500ms window, it is ignored. This prevents duplicate events from causing re-renders.
This implementation uses simple DateTime comparisons, avoiding the need for Timer objects or more complex state management, and is similar to the Debounce utility already used elsewhere in the codebase.
Files Modified:
lib/workspace/presentation/home/menu/view/view_item.dart- Added_handleViewTap()method with click throttlinglib/workspace/application/tabs/tabs_bloc.dart- Added plugin deduplication inopenPluginhandlerIssues
Fixes https://github.com/AppFlowy-IO/AppFlowy/issues/8252
PR Checklist
Note: Manual testing performed on macOS. The fix prevents flickering while maintaining responsive navigation. Would appreciate testing on other platforms (Linux, Windows) to ensure consistency.
Summary by Sourcery
Prevent rapid navigation flicker by throttling sidebar taps and deduplicating plugin open events
Bug Fixes:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.