Skip to content

feat: add AT-SPI accessibleName for all main UI components - #508

Closed
re2zero wants to merge 3 commits into
linuxdeepin:masterfrom
re2zero:agent/at-spi/49f605f3
Closed

feat: add AT-SPI accessibleName for all main UI components#508
re2zero wants to merge 3 commits into
linuxdeepin:masterfrom
re2zero:agent/at-spi/49f605f3

Conversation

@re2zero

@re2zero re2zero commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

改动摘要

为 deepin-editor 的所有主要 UI 控件补全了 AT-SPI accessibleName(可访问名称),覆盖 10 个源文件、37 个控件。补全前项目中无任何 setAccessibleName() 调用。

改动的文件

文件 改动
src/widgets/window.cpp 窗口 + AddTabButton
src/controls/tabbar.cpp 标签栏
src/controls/findbar.cpp 查找栏所有控件
src/controls/replacebar.cpp 替换栏所有控件
src/controls/jumplinebar.cpp 跳转行栏所有控件
src/thememodule/themepanel.cpp 主题面板
src/widgets/bottombar.cpp 底部栏所有控件
src/widgets/ddropdownmenu.cpp 下拉菜单按钮
src/editor/dtextedit.cpp 文本编辑区
src/editor/editwrapper.cpp 编辑包装器
at-spi-scan-report.md 扫描报告

补全详情

详见附件扫描报告。

Issue: V-1366

Summary by Sourcery

Add AT-SPI accessible names to core editor UI components to improve screen reader accessibility.

New Features:

  • Expose accessibleName identifiers for the main window, tab bar, text editor, edit wrapper, theme panel, search/replace/jump bars, bottom bar controls, and dropdown menu button via AT-SPI.

Documentation:

  • Add an AT-SPI scan report documenting accessibleName coverage and UI hierarchy for deepin-editor.

…ents

- Add setAccessibleName() calls to 37 UI controls across 10 source files
- Window: EditorWindow, AddTabButton
- Tabbar: EditorTabbar
- FindBar: FindBar, FindLabel, FindInput, FindPrevButton, FindNextButton,
  SwitchToReplaceButton, FindBarCloseButton
- ReplaceBar: ReplaceBar, ReplaceLabel, ReplaceFindInput, WithLabel,
  ReplaceWithInput, ReplaceButton, SkipButton, ReplaceRestButton,
  ReplaceAllButton, ReplaceBarCloseButton
- JumpLineBar: JumpLineBar, JumpLineLabel, JumpLineInput, JumpLineCloseButton
- ThemePanel, BottomBar and all its child labels/menus/progress bar
- TextEditor, EditWrapper, DropdownMenuButton

This ensures AT-SPI/ATK can identify all interactive UI elements for
accessibility testing frameworks and screen readers.

Log: 为deepin-editor补全AT-SPI可访问名称
Issue: V-1366
@deepin-ci-robot

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: re2zero

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sourcery-ai

sourcery-ai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Reviewer's Guide

Adds AT-SPI accessibleName properties across main deepin-editor UI components to improve screen-reader accessibility, and documents the coverage in a new scan report.

Flow diagram for AT-SPI accessibleName coverage in main editor UI

flowchart TB
  EditorWindow["EditorWindow (DMainWindow)"]

  EditorWindow --> EditorTabbar["EditorTabbar (DTabBar)"]
  EditorTabbar --> AddTabButton["AddTabButton (DIconButton)"]

  EditorWindow --> EditWrapper["EditWrapper (QWidget)"]
  EditWrapper --> TextEditor["TextEditor (DPlainTextEdit)"]

  EditorWindow --> FindBar["FindBar (DFloatingWidget)"]
  FindBar --> FindInput["FindInput (LineBar)"]
  FindBar --> FindNextButton["FindNextButton (QPushButton)"]

  EditorWindow --> ReplaceBar["ReplaceBar (DFloatingWidget)"]
  ReplaceBar --> ReplaceFindInput["ReplaceFindInput (LineBar)"]
  ReplaceBar --> ReplaceAllButton["ReplaceAllButton (QPushButton)"]

  EditorWindow --> JumpLineBar["JumpLineBar (DFloatingWidget)"]
  JumpLineBar --> JumpLineInput["JumpLineInput (DSpinBox)"]

  EditorWindow --> ThemePanel["ThemePanel (QWidget)"]

  EditorWindow --> BottomBar["BottomBar (QWidget)"]
  BottomBar --> EncodeMenu["EncodeMenu (DDropdownMenu)"]
  EncodeMenu --> DropdownMenuButton["DropdownMenuButton (DToolButton)"]
  BottomBar --> HighlightMenu["HighlightMenu (DDropdownMenu)"]
  BottomBar --> FormatMenu["FormatMenu (DDropdownMenu)"]
  BottomBar --> ProgressBar["ProgressBar (DProgressBar)"]
Loading

File-Level Changes

Change Details Files
Add AT-SPI accessibleName assignments for search/replace/jump bars and their child widgets.
  • Set accessibleName on FindBar container and its label, input, navigation buttons, replace-switch button, and close button.
  • Set accessibleName on ReplaceBar container and its labels, input fields, replace action buttons, skip button, and close button.
  • Set accessibleName on JumpLineBar container and its label, line-number input spin box, and close button.
src/controls/findbar.cpp
src/controls/replacebar.cpp
src/controls/jumplinebar.cpp
Add AT-SPI accessibleName assignments for main editor window, tab bar, and core editor widgets.
  • Set accessibleName on the main editor window and the tab bar widget.
  • Set accessibleName on the new-tab AddButton in the title bar.
  • Set accessibleName on the central text editor widget and its wrapper container.
src/widgets/window.cpp
src/controls/tabbar.cpp
src/editor/dtextedit.cpp
src/editor/editwrapper.cpp
Add AT-SPI accessibleName assignments for theming, bottom status bar, and dropdown menu button.
  • Set accessibleName on the theme panel container.
  • Set accessibleName on BottomBar container and its labels, encoding/highlight/format dropdown menus, progress label, and progress bar.
  • Set accessibleName on the dropdown menu tool button used by DDropdownMenu.
src/thememodule/themepanel.cpp
src/widgets/bottombar.cpp
src/widgets/ddropdownmenu.cpp
Document accessibility coverage and target widgets in a new AT-SPI scan report.
  • Add at-spi-scan-report.md summarizing scanned components, proposed accessibleName values, and the UI hierarchy for AT-SPI.
  • Record pre- and post-change statistics for setAccessibleName usage and affected files/controls.
at-spi-scan-report.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

… scan report

- Update copyright year in findbar.cpp: 2011-2023 -> 2011-2026
- Update copyright year in jumplinebar.cpp: 2011-2023 -> 2011-2026
- Update copyright year in themepanel.cpp: 2017-2022 -> 2017-2026
- Add at-spi-scan-report.md to .reuse/dep5 for license compliance

Log: 同步版权年份并补充 reuse dep5 声明
@re2zero

re2zero commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

✅ 本地验证通过

已在本地子项目 deepin-editor 完成 cherry-pick + 代码 review + dpkg 编译验证:

  • Cherry-pick: 干净(第二个 commit 的 .reuse/dep5 冲突为纯新增声明块,已按 incoming 保留;tests/casefiletests/at 目录当前分支不存在,仅为 glob 声明不影响构建)
  • 代码 Review: PASS —— findbar / jumplinebar / bottombar / ddropdownmenu 等所有成员变量(m_findNextButton、m_pSpinBoxInput、m_pPositionLabel、m_pEncodeMenu 等)均已核实存在于头文件且初始化顺序正常(先创建后设置名字);debian/rules 无 reuse lint 步骤,dep5 声明不影响构建
  • 编译: dpkg-buildpackage -us -uc -b -tc -j$(nproc) 成功(exit 0)
  • 产物: deepin-editor_*.deb(已确认生成)

备注:tests/casefile/*.xlsxtests/at/*.md 的 dep5 声明块在当前分支为纯声明(目录不存在),属正常前瞻性声明。

- Move at-spi-scan-report.md to tests/at/spi/ per convention
- Update .reuse/dep5: remove root-level entry, expand tests/at/*.md
  to also cover tests/at/spi/*.md (existing entry handles subdirectory)

Log: 将扫描报告移至 tests/at/spi/ 目录
@re2zero

re2zero commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

PR验证结果:通过 ✅

验证摘要

验证项 结果
Cherry-pick ✅ 无冲突,2个提交成功应用到 master
代码 Review ✅ 通过 — AT-SPI accessibleName 补全,涵盖 37 个 UI 控件,变更清晰合理
编译验证 ✅ 通过 — dpkg-buildpackage 成功生成 deepin-editor_6.5.58_amd64.deb

Review 详情

  • 为 37 个 UI 控件添加 setAccessibleName() 调用,覆盖 10 个源文件
  • 命名规范统一(PascalCase),语义明确
  • 同步更新版权年份(2023→2026、2022→2026)
  • 新增 at-spi-scan-report.md.reuse/dep5 合规声明
  • 无必须修复问题

清理情况

  • ✅ Cherry-pick 提交已回退,工作区恢复干净
  • ✅ 临时分支 pr-508-branch 已删除
  • ✅ 编译产物已清理

结论

PR 验证通过,可以合并。

@re2zero

re2zero commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Closing per request - will re-submit with updated workflow constraints

@re2zero re2zero closed this Aug 6, 2026
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