Skip to content

review: warn when slides share a title - #2291

Open
ChenzhuoJi wants to merge 1 commit into
storytold:mainfrom
ChenzhuoJi:feat/review-accessibility-duplicate-titles
Open

ChenzhuoJi wants to merge 1 commit into
storytold:mainfrom
ChenzhuoJi:feat/review-accessibility-duplicate-titles

Conversation

@ChenzhuoJi

@ChenzhuoJi ChenzhuoJi commented Nov 21, 2026 •

Copy link
Copy Markdown

Slides that share a title are now reported by the accessibility checker, so a deck can be read by title without ambiguity.

Fixes #2225.

What the user saw

review.accessibility reported nothing about two slides with the same title. A deck whose slides are all called "Results" passed the checker, and a screen-reader user navigating by title could not tell the slides apart.

The cause

crates/engine/src/cmd/review.rs checked each slide on its own: a missing title, missing alternative text and low-contrast text. Nothing compared a slide's title with the other slides', so a title shared by several slides went unnoticed.

What changed

review.accessibility now collects the title of every slide, counts how many slides carry each title, and reports Duplicate slide title for each slide whose title is shared. The report carries the shared title in a new title field, so a deck with more than one group of duplicates stays readable.

Titles are compared as they are read: case and spacing differences do not make a title a different one ("Results" and "results " are the same title). Slides with no title keep their existing "Missing slide title" report and are not also reported as duplicates.

The change is one command in the engine, because that is where the check lives; the accessibility dialog already lists whatever the checker returns, so no UI change was needed.

Test

crates/engine/src/cmd/review.rs, accessibility_duplicate_title_tests:

  • every_slide_that_shares_a_title_is_reported — a deck with two slides titled "Results" and one titled "Agenda" reports the two sharing the title and not the third.
  • slides_without_a_title_are_not_reported_as_duplicates — untitled slides are reported as missing a title and not as duplicates.
  • titles_that_differ_only_in_case_or_spacing_share_one_title — titles that differ only in case or spacing are one title.

The first and the third fail without this change: with the fix reverted, review.accessibility reports no Duplicate slide title at all.

Verification

  • cargo fmt --all --check — passed.
  • cargo clippy -p deckcraft-engine --all-targets -- -D warnings — passed, no warnings.
  • cargo test -p deckcraft-engine — passed: 604 passed, 0 failed, 1 ignored (unit tests), 6 passed (tests/it), 8 passed (tests/show_paragraph_builds).
  • cargo xtask wasm — passed.
  • In the app: deckcraft-cli run --cmd-file a11y.txt --print on a deck with two slides titled "Results" and one titled "Agenda" prints
    review.accessibility → [{"issue":"Missing slide title","slide":0},{"issue":"Duplicate slide title","slide":1,"title":"Results"},{"issue":"Duplicate slide title","slide":2,"title":"Results"}]
    — the two slides sharing the title are reported, the one with its own title is not, and the untitled slide keeps its existing report.
  • The repository's own CI, Lockfile and SonarCloud workflows are queued and wait for a maintainer to approve them, which GitHub requires on a first run from a fork, so they have not run yet.

Summary by CodeRabbit

  • New Features
    • Accessibility reviews now flag slides that share the same nonblank title, in addition to slides missing a title. Each slide in a duplicate-title group is reported. Titles are compared without regard to capitalization or extra spacing, so formatting differences do not hide duplicates.
  • Improvements
    • Title-related findings no longer require a shape reference, making the reported issue details more consistent. Untitled slides are excluded from duplicate-title checks.

Slides that share a title are hard to tell apart for a screen-reader user
navigating by title, so review.accessibility now reports every slide whose
title another slide carries too.

Titles are compared as they are read: case and spacing differences do not
make a title a different one. A slide with no title keeps its existing
"Missing slide title" report and is not also reported as a duplicate.

Fixes storytold#2225
@coderabbitai

coderabbitai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The review.accessibility command now reports slides with duplicate nonblank titles. It compares titles after collapsing whitespace and lowering case. Duplicate-title issues include the trimmed title. Tests cover duplicate groups, untitled slides, and titles that differ only in case or spacing.

Changes: Accessibility title checks

Layer / File(s) Summary
Normalize and report duplicate titles
crates/engine/src/cmd/review.rs
The command description marks shape and title as optional issue fields. The command reports every slide with a duplicate normalized, nonblank title. Tests cover duplicate groups, untitled slides, and differences in case or spacing.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

fixed_issue_severityMedium</fixed_issue_severity>

Suggested reviewers: echelon, nikitkara

Merge Risk: Minimal · up to 97af6

The accessibility check now also flags slides that share a title, which helps screen-reader users tell slides apart. The change is small and localized, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "review: warn when slides share a title" matches the main change. The PR adds duplicate-title detection to review.accessibility, which reports slides whose nonblank titles are shared. The ti…
Linked Issues check Passed [#2225] requires a warning when slides share a title in review.accessibility. The diff in crates/engine/src/cmd/review.rs adds a title_counts map keyed by title_key (whitespace collapsed, lowercased).…
Out of Scope Changes check Passed All changes are in crates/engine/src/cmd/review.rs and serve the duplicate-title objective. They are: the title_key helper, the duplicate counting in accessibility(), the optional title? entry in the …
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title "review: warn when slides share a title" matches the main change. The PR adds duplicate-title detection to review.accessibility, which reports slides whose nonblank titles are shared. The title is specific and short, and it names the affected command area. It does not describe the full change, such as case and whitespace normalization or the new title field, but that detail is not required.

Full details: Linked Issues check

Explanation

[#2225] requires a warning when slides share a title in review.accessibility. The diff in crates/engine/src/cmd/review.rs adds a title_counts map keyed by title_key (whitespace collapsed, lowercased). Each non-blank title that occurs on more than one slide produces {"slide", "title", "issue": "Duplicate slide title"} for every slide in that group. Untitled slides take the existing "Missing slide title" branch and are not reported as duplicates. The command spec now lists title? as optional output. Tests in accessibility_duplicate_title_tests cover a shared group, untitled slides, and case/spacing equivalence. The reproduction's picture and icon checks belong to #2223, which the issue excludes from this scope. The requirement is met at the reviewed head.

Full details: Out of Scope Changes check

Explanation

All changes are in crates/engine/src/cmd/review.rs and serve the duplicate-title objective. They are: the title_key helper, the duplicate counting in accessibility(), the optional title? entry in the command output spec, and the new test module. No unrelated checks, UI files, or other commands were changed in the diff. The raw summary's claim that the shape field is omitted for duplicate and missing-title issues is not visible in the diff; the diff keeps shape out of these two issue objects, which matches the summary, so no scope concern arises.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between c355c06 and 97af600.

Files selected for processing: 1

  • crates/engine/src/cmd/review.rs

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@autocraft-bot autocraft-bot Bot added the small extra Goes beyond the reference application, but is tiny and changes no default label Nov 21, 2026

@autocraft-bot autocraft-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI-generated review (Claude Opus 5.5). Not a maintainer decision.

Changes needed (not certain):

Adds a 'Duplicate slide title' report to review.accessibility, matching titles regardless of case and spacing, with tests.

  • crates/engine/src/cmd/review.rs:250: title_key folds case and whitespace; please confirm this matches how titles should be compared for this check.
  • crates/engine/src/cmd/review.rs:268: the new entry adds a 'title' field; consumers of the report that expect only {slide, shape, issue} should be checked.
  • crates/engine/src/cmd/review.rs:256: slides are collected and counted before the walk, so each duplicate is reported once per slide; untitled slides are left out of the count.

Claims checked:

  • unverified: review.accessibility reports 'Duplicate slide title' for each slide whose title is shared, with the title in a new 'title' field. (crates/engine/src/cmd/review.rs:256-270 (diff) counts titles and pushes the entry; the surrounding code and the dialog that reads the report could not be read.)
  • unverified: Titles differing only in case or spacing are the same title. (crates/engine/src/cmd/review.rs:250 title_key splits on whitespace, joins with single spaces and lowercases; sl.title() could not be read.)
  • unverified: Untitled slides keep 'Missing slide title' and are not also reported as duplicates. (crates/engine/src/cmd/review.rs:259-268 (diff) skips empty trimmed titles in the count and in the if/else branch; not checked against sl.title() for placeholder prompt text.)
  • unverified: The accessibility dialog already lists whatever the checker returns, so no UI change is needed. (crates/engine/src/cmd/review.rs:38 (diff) only changes the spec string; the dialog code could not be read.)
  • unverified: Fixes issue 2225. (crates/engine/src/cmd/review.rs:256-270 (diff); the issue and the reference app behaviour could not be read.)

Reviewed at 97af600.

Recommendation: update the pull request; it will be reviewed again.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

small extra Goes beyond the reference application, but is tiny and changes no default

Projects

None yet

Development

Successfully merging this pull request may close these issues.

review.accessibility: warn when slides share a title

1 participant