AppFlowy-IO / AppFlowy-IO/AppFlowy

[Bug] Home stack tab and secondary-view interaction state can become stale

Aperta
#8,950 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Dart
Stelle
76.6k
Fork
6k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

### Bug Description

The desktop home stack does not consistently clean up or synchronize its interaction state.

The secondary-view resize handle starts a delayed hover callback that can run after the widget has been disposed. A canceled resize gesture can also leave the divider highlighted, and the secondary-view AnimationController is not disposed.

In addition, HomeStack maintains a local selected index while the tab bar uses TabsState.currentIndex. Closing, programmatically selecting, or reordering tabs can therefore make the selected tab disagree with the visible page. The floating action used to reopen the secondary view is also pointer-only and displays an incorrect icon.

### How to Reproduce

Scenario 1: delayed hover callback

1. Open a secondary view.
2. Move the pointer onto the divider between the primary and secondary views.
3. Close or replace the view before the 500 ms hover delay completes.
4. A delayed callback may attempt to call setState after the widget has been disposed.

Scenario 2: canceled resize

1. Open a secondary view.
2. Start dragging the divider.
3. Interrupt or cancel the gesture.
4. The divider can remain in its active highlighted state.

Scenario 3: tab state synchronization

1. Open three tabs.
2. Select the final tab.
3. Close, pin, or reorder tabs.
4. Compare the highlighted tab with the visible page.
5. The selected tab and visible page can become inconsistent.

Scenario 4: keyboard accessibility

1. Hide the secondary view.
2. Use only the keyboard to focus and activate the floating reopen action.
3. The action cannot be operated like a standard button.

### Expected Behavior

The secondary view should cancel pending callbacks and animations when it is removed.

A canceled resize gesture should always clear its active visual state. The visible page should always follow TabsState.currentIndex and preserve the correct page identity after tabs are closed or reordered.

The secondary-view reopen action should support pointer, keyboard, focus, tooltip, and semantic interaction, and it should display the correct directional sidebar icon.

### Operating System

Windows 11

### AppFlowy Version(s)

Source build from main at commit 5cf3a365d

### Screenshots

_No response_

### Additional Context

I found these problems while auditing the lifecycle and interaction state in home_stack.dart.

I have prepared a candidate fix and focused widget regression tests for disposal during the delayed hover callback and resize gesture cancellation. I would like to work on this issue and submit a draft pull request.

If the maintainers prefer the tab synchronization and secondary-view lifecycle changes to be split into separate pull requests, I am happy to adjust the scope.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Start with home_stack.dart and the focused widget regression tests mentioned in the issue. Trace the secondary-view hover, resize, animation, tab-selection, and reopen-action state from their lifecycle and interaction entry points. Done means disposal is safe, canceled gestures reset their visuals, the visible page follows TabsState.currentIndex, and the reopen action supports keyboard and semantic interaction with the correct icon.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
dart, flutter
Ambito
accessibility, frontend, testing
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.