Skip to content

fix: show in-panel toasts above the inspector panel - #95

Merged
AmisKwok merged 3 commits into
mainfrom
fix/inspector-toast-overlay-component
Sep 4, 2026
Merged

fix: show in-panel toasts above the inspector panel#95
AmisKwok merged 3 commits into
mainfrom
fix/inspector-toast-overlay-component

Conversation

@AmisKwok

@AmisKwok AmisKwok commented Sep 4, 2026

Copy link
Copy Markdown
Member

Summary / 摘要

Fix in-panel toasts (copy / share / replay / bug report) being drawn behind the inspector panel and invisible after the overlay z-order change; centralize all toast feedback into a single reusable InspectorToast component.
修复复制 / 分享 / 重放 / Bug 报告等面板内提示被检查器面板遮挡、不可见的问题,并把所有提示反馈收敛到统一的 InspectorToast 组件。

Changes / 变更

  • Added InspectorToast (lib/src/ui/inspector_toast.dart) that consolidates the 11 scattered SnackBar calls across inspector_panel / network_viewer / log_viewer into one place with a consistent floating style. / 新增统一提示组件 InspectorToast,把分散在三处的 11 处 SnackBar 调用收敛到一处,统一样式。
  • Wrapped the panel overlay in its own ScaffoldMessenger so toasts render above the panel in the same overlay layer (fixes occlusion). / 面板浮层由自身的 ScaffoldMessenger 包裹,提示渲染进面板所在的 Overlay 层之上,修复被遮挡问题。
  • Added InspectorToast.showOn(ScaffoldMessengerState, …) for async call sites to keep flutter analyze clean (use_build_context_synchronously). / 新增 showOn 重载供 await 之后的调用点使用,保持 analyze 无告警。
  • Bumped package to 1.8.1 (pubspec.yaml, iOS podspec, README/CHANGELOG). / 版本 bump 到 1.8.1。

Context / 背景

After the overlay z-order refactor, in-panel SnackBar toasts were rendered under the panel and could not be seen, making copy / share / replay / bug-report feedback invisible. Centralizing into InspectorToast also removes duplicated SnackBar boilerplate.
浮层 z 序调整后,面板内的 SnackBar 提示被渲染到面板之下、不可见,导致复制 / 分享 / 重放 / Bug 报告的反馈失效;统一到 InspectorToast 同时也消除了重复的 SnackBar 样板代码。

Checklist / 检查项

  • Title follows Conventional Commits / 标题符合约定式提交
  • CI checks pass after merge / 合入后 CI 通过

Test plan

  • Build the example app, open the inspector, trigger copy / share / replay / bug-report and confirm the toast appears above the panel and is readable. / 构建 example,打开检查器,触发复制 / 分享 / 重放 / Bug 报告,确认提示出现在面板之上且清晰可读。
  • Verify the toast auto-dismisses and the floating style matches across light/dark. / 确认提示自动消失,深浅色样式一致。
  • Confirm network / log / bug-report panels still function normally (no regression). / 确认网络 / 日志 / Bug 报告面板功能正常,无回归。

🤖 Generated with Zero Buddy

Wrap the panel overlay in its own ScaffoldMessenger so in-panel SnackBar toasts (copy / share / replay / bug report) render above the panel instead of being occluded by it after the z-order change. Centralize the 11 scattered SnackBar calls into a reusable InspectorToast component.

Bump package to 1.8.1.

- lib/src/ui/inspector_toast.dart (new): shared toast component

- inspector_panel / network_viewer / log_viewer: use InspectorToast; resolve ScaffoldMessenger before await to avoid use_build_context_synchronously

- pubspec.yaml, ios/zero_inspector_kit.podspec: version 1.8.1

- README.md, README_zh.md, CHANGELOG.md: version strings + notes
Replace the bottom-anchored SnackBar with a custom top-anchored overlay toast so copy / share / replay / bug-report feedback appears at the top of the screen, still above the inspector panel.

- lib/src/ui/inspector_toast.dart: render a floating card via OverlayEntry anchored to the top (was SnackBar, always bottom).

- inspector_panel / network_viewer / log_viewer: resolve OverlayState instead of ScaffoldMessengerState before await.
Refresh the example lockfile after dependency resolution during analyze.
@AmisKwok
AmisKwok merged commit f68ffe0 into main Sep 4, 2026
10 checks passed
@AmisKwok
AmisKwok deleted the fix/inspector-toast-overlay-component branch September 4, 2026 15:55
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.

1 participant