Skip to content

feat(tablet): add sidebar swipe gestures (#871) - #1107

Open
luojiaping wants to merge 1 commit into
AAswordman:devfrom
luojiaping:feat/issue-871-tablet-sidebar-swipe
Open

feat(tablet): add sidebar swipe gestures (#871)#1107
luojiaping wants to merge 1 commit into
AAswordman:devfrom
luojiaping:feat/issue-871-tablet-sidebar-swipe

Conversation

@luojiaping

Copy link
Copy Markdown
Collaborator

变更说明 / Description

为平板端侧栏增加边缘滑动呼出和侧栏内反向滑动收纳。

背景与动机 / Context and motivation

平板侧栏已经支持按钮切换,但缺少触控设备常用的滑动入口。

改动范围 / Changes

  • 收起态从左侧边缘右滑呼出侧栏。
  • 展开态在侧栏区域左滑收纳侧栏。
  • 复用现有展开状态、按钮入口和宽度动画。
  • 手机端布局、全局导航状态和遮罩层不在本 PR 范围内。

兼容性与风险 / Compatibility and risks

仅改变平板侧栏的触控入口,不改变持久化数据、导航 API 或手机端行为。

关联 Issue / Related issue

Closes #871

验证方式 / Verification

检查或命令:git diff --check upstream/dev...HEAD
环境与变体:拆分分支未重新运行独立构建;拆分前组合实现曾通过远程 Release 构建
结果:分支差异检查通过;精确合并候选由 GitHub Candidate checks 验证

证据 / Evidence

拆分前组合实现的远程 Release 构建已通过。

Use the existing sidebar state and animation for edge expansion and in-drawer collapse.

(cherry picked from commit fb5f516)
@CATMIAOZHI
CATMIAOZHI self-requested a review September 7, 2026 00:27

@CATMIAOZHI CATMIAOZHI left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BLOCK:1 项 P2,触发条件、后果和建议见行内评论。

审计提交:24c092f513377172cb0e7bbc5b9db159d61ae55c,目标分支 dev。已先请求 CATMIAOZHI review,再完成独立工作树全 diff、运行调用链和独立 agent 复核;git diff --check 通过。

验证范围:上游仓库该 HEAD 的 check-runs 为 0,审计前无 review 线程或普通评论。已核对工作流内容:PR workflow 仅匹配 development,本 PR 目标为 dev;构建/单测 push workflow 匹配 main。已核对 Actions Variables(GITEE_OWNER、GITEE_REPO)。未获得本次 HEAD 的可核实构建或单测成功证据,拆分前或组合分支的构建不视为当前提交已验证。遵守目标仓库 AGENTS.md,本次未执行本地编译、测试、Lint 或真机验证,未修改源码。

gestureHandled = false
gestureEligible =
isTabletSidebarExpanded ||
startOffset.x <=

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 用按下位置判断边缘手势

这里的 startOffset 不是 DOWN 坐标,而是首次跨过 touchSlop 那一帧的位置。只给 24dp 阈值加 touchSlop 无法补偿该帧额外移动量:例如从 23dp 按下、slop 为 8dp,下一帧到 33dp,就会将 gestureEligible 固定为 false,之后再向右拖也不展开。快速边缘滑动更容易触发。Compose 官方实现 在越过 slop 后调用 onDragStart(drag.position)。请保存初始按下位置,并按该位置判断是否从边缘开始。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants