返回提示词目录第 1301 页

无障碍扫描问题定位修复

将扫描问题按组件根因归组,生成源码修复补丁,复测结果并列出仍需人工检查的体验问题。

完整提示词

<context>
Automated scanners catch only part of WCAG failures (published estimates vary widely with how issues are counted), and the ones they catch cluster: one button component without a name shows up as 140 violations across a page. Fixing the rendered HTML node by node, or silencing a rule with `aria-label` everywhere, makes the count drop while the experience stays broken. The useful move is to group violations by the component or pattern that produces them, fix that source once, and treat "needs review" items (contrast over images, `aria-hidden` content that might be focusable, duplicate ids from portals) as questions a human must answer. Common traps: `color-contrast` failures on text over gradients are often unverifiable by the tool; `region` and `landmark-one-main` point to page structure, not to the flagged node; `aria-allowed-attr` usually means the wrong role, not a stray attribute; `nested-interactive` needs a redesign, not a role change.
</context>

<task>
Fix the violations in this scan of a {{framework}} codebase:

<scan_output>
{{scan_output}}
</scan_output>
{{#scope_note}}
Scope: {{scope_note}}
{{/scope_note}}

1. Parse the report. For each rule id, list the count, the WCAG success criterion it maps to, and the selectors. Group nodes that come from the same component, template or style token; name that source by searching the repository for the class names, test ids or text in the snippets.
2. For each group, explain in one or two sentences what a user experiences (for example "screen reader says 'button' with no name on every product card").
3. Fix each group at its source with the smallest correct change: visible text before `aria-label`, native elements before ARIA roles, corrected design tokens before per-element colour overrides, structural fixes (landmarks, heading order) in the layout component. Show each change as a diff or replaced block with file paths.
4. Separate items the tool marked as incomplete or needs review, and items you believe are false positives. For each, say why and what a person must check by hand. Never suppress a rule globally; if a rule must be disabled for a node, scope it to that selector with a comment giving the reason.
5. Flag violations inside third-party code you cannot change and suggest the realistic option (configuration, wrapper, upstream issue, replacement).
6. Rerun the scanner or the existing accessibility tests if available and report the before and after counts. If you cannot run them, say so.
7. List what this scan could not have checked for the scanned pages: keyboard order and traps, focus visibility, meaningful alt text, announcement of dynamic changes, reading order, zoom and reflow.
</task>

<constraints>
- Do not add ARIA to make a rule pass when a native element or visible text fixes the cause.
- Do not invent violations that are not in the report or components that are not in the repository; mark guesses about the source as inferred.
- Do not claim the page is accessible or WCAG-conformant because the scan is clean.
{{> guardrails/scope-discipline}}
{{> guardrails/verify-before-done}}
</constraints>

<output_format>
## Violations grouped by cause
Table: rule id | WCAG criterion | count | source component or file | user impact.

## Fixes
Per group: the change with file path, as a diff or replaced block.

## Needs review and false positives
Bullets: item, why, what to check by hand.

## What the scan did not check
A short checklist of manual tests for these pages, and the before and after counts if the scan was rerun.
</output_format>

可替换内容

  • {{framework}}
  • {{scan_output}}
  • {{#scope_note}}
  • {{scope_note}}
  • {{/scope_note}}
  • {{> guardrails/scope-discipline}}
  • {{> guardrails/verify-before-done}}

分类与标签

编程开发、无障碍修复、组件排错、源码补丁、扫描复测

前往 AI 图片创作