AppFlowy-IO / AppFlowy-IO/AppFlowy

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

未关闭
#8,950 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Dart
星标
76.6k
派生
6k
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

这个仓库没有索引到贡献指南

调研方向

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.

由索引模型根据 Issue 内容生成。

评估

技术栈
dart, flutter
领域
accessibility, frontend, testing
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。