audit-ui-thread-safety

โดย flutter

ป้องกันการค้างของ UI และรับประกันประสบการณ์ผู้ใช้ที่ตอบสนองได้ดี โดยการตรวจสอบกฎการทำงานแบบเธรด และย้ายการเรียกที่บล็อกออกจาก Event Dispatch Thread (EDT)

npx skills add https://github.com/flutter/flutter-intellij --skill audit-ui-thread-safety

Skill: UI Thread Safety & Responsiveness

You are tasked with preventing UI freezes and ensuring a responsive user experience by validating threading rules.

Objective

Prevent UI freezes and ensure a responsive user experience by validating threading rules.

Workflow Instructions

1. Baseline

  • Run ./gradlew test and ./gradlew verifyPlugin to ensure the project is in a good state before refactoring.

2. Audit EDT Usage

  • Search for usages of runInEdt, invokeLater, and invokeAndWait.

3. Identify Blocking Calls

  • Ensure no I/O operations (file access, network calls) or heavy computations occur within these UI blocks.

4. Migrate to Background

  • Refactor heavy tasks to run on background threads using Task.Backgroundable or ReadAction.nonBlocking.

5. Check Modality

  • Verify that modal dialogs do not block the UI thread unnecessarily.

6. Verify

  • Run ./gradlew testClasses to ensure safe refactoring.
  • Run ./gradlew test and ./gradlew verifyPlugin to ensure no regressions.
  • Run the plugin in a sandbox (./gradlew runIde) and perform key actions while monitoring for UI freezes.
  • Suggest manual test steps: Check the code changes made and write test steps for a user to execute that will trigger the code paths that have changed. If needed, add logging statements to verify that the code paths have successfully run.

7. Report & Review

  • Summarize the threading fixes.
  • Test Location: Explicitly state where in the IDE the user should go to test the changed functionality (e.g., "Go to Preferences > Languages & Frameworks > Flutter").
  • Action: Ask the user to review the changes closely to ensure no deadlocks or UI freezes are introduced.
  • Do not commit or push.
  • Provide a suggested Git commit message (e.g., "Fix UI freeze: Move heavy computation to background task").

Skills เพิ่มเติมจาก flutter

dart-modern-features
flutter
เพื่อหาผู้สมัครสำหรับการปรับปรุงให้ทันสมัย:
flutter-fix-layout-issues
flutter
แก้ไขข้อผิดพลาดการจัดวาง Flutter (โอเวอร์โฟลว์, ข้อจำกัดที่ไม่มีขอบเขต) โดยใช้เครื่องมือ Dart และ Flutter MCP ใช้เมื่อจัดการกับ "RenderFlex overflowed", "Vertical…
adding-release-notes
flutter
เพิ่มคำอธิบายการเปลี่ยนแปลงที่ผู้ใช้เห็นลงในบันทึกประจำรุ่นของ DevTools ใช้เมื่อบันทึกการปรับปรุง การแก้ไข หรือฟีเจอร์ใหม่ในไฟล์ NEXT_RELEASE_NOTES.md
reviewing-devtools-prs
flutter
เวิร์กโฟลว์การรีวิว PR เฉพาะคลังของ DevTools ที่บังคับใช้แนวทางสไตล์ของ DevTools และรูปแบบการรีวิวทั่วไป ใช้เมื่อรีวิว pull requests ใน...
dart-use-primary-constructors
flutter
ช่วยให้ผู้ใช้เขียนคอนสตรักเตอร์หลักใน Dart ที่ถูกต้องทั้งทางไวยากรณ์และความหมาย และย้าย/ใช้งานไวยากรณ์คอนสตรักเตอร์แบบใหม่ ไวยากรณ์เซมิโคลอนแบบไม่มีเนื้อหา…
code-documentation
flutter
คู่มือสำหรับการเขียนเอกสารประกอบโค้ดอย่างมีประสิทธิภาพ รวมถึง docstrings, JSDoc, dartdoc และคอมเมนต์การใช้งาน ใช้ทักษะนี้เมื่อเขียนโค้ดใหม่ เพิ่มเติม…
api-review
flutter
ตรวจสอบโค้ดที่ระบุเทียบกับแนวทาง API Design มาตรฐาน ใช้สกิลนี้เมื่อผู้ใช้ขอให้รีวิว API หรือตรวจสอบโค้ดตามแนวทาง API design…
flutter-accessibility
flutter
ใช้มาตรฐานการเข้าถึง WCAG 2 และ EN 301 549 รวมถึงเลย์เอาต์แบบปรับเปลี่ยนได้ในแอป Flutter บังคับใช้คำอธิบายเชิงความหมาย ขนาดเป้าหมายการแตะ (ขั้นต่ำ 48x48 dp) และอัตราส่วนความคมชัดของข้อความ (4.5:1 สำหรับข้อความขนาดเล็ก, 3:1 สำหรับข้อความขนาดใหญ่) บนแพลตฟอร์มมือถือ เว็บ และเดสก์ท็อป มีตรรกะการตัดสินใจสำหรับการเริ่มต้นความหมายบนเว็บ การห่อวิดเจ็ตแบบโต้ตอบ การสลับเลย์เอาต์ตามขนาดหน้าจอ และการจัดการอินพุตคีย์บอร์ด/เมาส์ รวมถึงการจัดการการนำทางโฟกัสผ่าน FocusTraversalGroup และ...