aria-treeitem-name
ما الذي تفعله
تتحقق هذه المهارة من أن عناصر الأدوات الشجرية لها أسماء واضحة وحالات توسيع صحيحة. وهي موجهة إلى المطورين الذين يبنون مستكشفات الملفات أو القوائم المتداخلة أو المخططات التنظيمية.
متى تستخدمها
- ✓عندما تبني مستكشف ملفات أو تنقلًا متداخلًا أو عرض شجرة.
- ✓عندما تحمل عناصر الشجرة أسماء فارغة أو عامة مثل folder أو item.
- ✓عندما لا توضح العناصر القابلة للتوسيع ما إذا كانت مفتوحة أم مغلقة.
رابط المهارة
https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/aria-treeitem-name/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“ملف الشجرة عندي يعرض مجلدات يعلنها قارئ الشاشة بكلمة item فقط. أصلح الأسماء.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يتحقق الوكيل من اسم كل عنصر في الشجرة بالترتيب: aria-labelledby ثم aria-label ثم النص الظاهر، ويتأكد من أن العناصر القابلة للتوسيع لها حالة expanded.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Provide accessible names for tree items
Tree widgets represent hierarchical data (file explorers, nested navigation, organization charts). Screen readers announce each focused treeitem's name, level, and position — e.g., 'src, collapsed, level 1, 1 of 3'. If the name is empty or generic ('folder', 'item'), blind users cannot distinguish between nodes and cannot navigate the hierarchy with confidence. VoiceOver on macOS uses the name to populate the rotor, and NVDA reads it as the user moves through the tree with arrow keys.
Quick Reference
- Every element with
role='treeitem'must have a non-empty accessible name - Text content of the element is used as the name by default — ensure it is descriptive
- Use
aria-labelto override or supplement the visible text (e.g., adding file type context) - Use
aria-labelledbyto compose a name from multiple visible elements within the item - A treeitem with
aria-expandedmust also convey its expanded/collapsed state — this is separate from its name
Check
Find all elements with role='treeitem'. For each, determine its accessible name via the accname computation: check aria-labelledby first, then aria-label, then visible text content. Flag any treeitem with an empty or whitespace-only accessible name. Also check whether treeitems with children have aria-expanded set to 'true' or 'false' (not just absent).
Fix
For each unnamed treeitem: (1) If the element has visible text content that is descriptive, no change is needed — the text content becomes the accessible name. (2) If the visible text is ambiguous (e.g., an icon with no text), add aria-label='Descriptive name'. (3) If the item has multiple text parts (e.g., filename + file size), use aria-labelledby referencing the most descriptive element's id. (4) For expandable treeitems, ensure aria-expanded='true' or aria-expanded='false' is present and toggled on expand/collapse.
Explain
WAI-ARIA 1.2 requires that treeitem elements have an accessible name as part of the tree widget pattern. Screen readers convey position within the tree using: name + level (aria-level or DOM nesting depth) + set size (aria-setsize) + position in set (aria-posinset) + expanded state (aria-expanded). The name is the only user-facing identifier — without it, a user navigating by arrow keys hears only 'treeitem, level 2' with no way to know which node they are on.
Code Review
Review the rendered markup and interactive states that affect Provide accessible names for tree items. Flag exact elements, roles, labels, focus behavior, or keyboard interactions that violate the rule, and note how to verify the fix with browser accessibility tooling or assistive tech.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/rules/accessibility/aria-treeitem-name
الأسئلة الشائعة
ماذا يقول قارئ الشاشة لعنصر شجرة جيد؟
تعطي المهارة مثالًا مثل: src، مطوي، المستوى 1، 1 من 3، وهذا يشمل الاسم والحالة والموقع.
أي اسم يستخدمه قارئ الشاشة أولًا؟
تصف المهارة أن الترتيب هو aria-labelledby أولًا، ثم aria-label، ثم النص الظاهر.
هل يحتاج العنصر القابل للتوسيع إلى حالة خاصة به؟
نعم. تقول المهارة إن العناصر التي لها أبناء تحتاج إلى aria-expanded بقيمة true أو false.
التفاصيل
الوصف الأصلي من المؤلف
Use when applies to custom tree widgets built with role='tree', role='treeitem', and role='group'. Common in file explorers, nested navigation menus, org charts, and any UI where items can be expanded or collapsed to reveal children.
الشعبية
- نجوم GitHub
- 75k
- الترتيب
- #2741
- الترخيص
- MIT
- آخر تحديث
- 31/10/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
frontendchecklist
75kيفحص شيفرة الواجهة الأمامية والصفحات الحية مقابل أكثر من 380 قاعدة للوصول وسرعة الأداء وتحسين محركات البحث والأمان، بأداة سطر أوامر.
frontend-checklist-global
75kيدقق مشروع الواجهة الأمامية وفق كل قواعد Front-End Checklist البالغ عددها 386، ويقدم إصلاحًا محددًا لكل مشكلة وجدت.
404-page
75kيتأكد من أن صفحة الصفحات غير الموجودة تقدم روابط مفيدة وتُرجع رمز حالة 404 حقيقيًا، لمساعدة الزوار التائهين على إيجاد طريقهم.
about-page
75kيراجع ما إذا كان لموقعك صفحة «من نحن» واضحة تشرح من يديره، لبناء الثقة لدى الزوار ومحركات البحث.
مهارات مشابهة
angular-developer
280kيساعد وكيلك على كتابة شيفرة Angular وتقديم نصائح لبنية المشروع، ويفيد في بدء المشاريع الجديدة وإنشاء المكونات وتحسين الأداء وإمكانية الوصول.
frontend-a11y
280kيساعد وكيلك على جعل واجهات الويب متاحة للجميع، فيضمن أن المواقع والتطبيقات تعمل جيدًا مع قارئات الشاشة والتنقل بلوحة المفاتيح.
frontend-patterns
280kيطبّق وكيلك أنماط تطوير الواجهات الحديثة، فيحسّن الأداء ويدير الحالة ويتبع أفضل الممارسات في React وNext.js.