AppFlowy-IO / AppFlowy-IO/AppFlowy

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

Abierto
#8,950 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Dart
Estrellas
76.6k
Forks
6k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### 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.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
dart, flutter
Área
accessibility, frontend, testing
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Tranquilo
Claridad
Bastante claro
Aptitud para principiantes
42/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.