[Interactive Graph] Add WB Announcer to Ray graph#3685
Draft
catandthemachines wants to merge 1 commit into
Draft
[Interactive Graph] Add WB Announcer to Ray graph#3685catandthemachines wants to merge 1 commit into
catandthemachines wants to merge 1 commit into
Conversation
Wires the Ray graph's movePoint (endpoint) and moveRay (whole-line grab handle) actions into the existing WB Announcer pipeline. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Size Change: +216 B (+0.04%) Total Size: 506 kB 📦 View Changed
ℹ️ View Unchanged
|
Contributor
npm Snapshot: PublishedGood news!! We've packaged up the latest commit from this PR (9daa827) and published it to npm. You Example: pnpm add @khanacademy/perseus@PR3685If you are working in Khan Academy's frontend, you can run the below command. ./dev/tools/bump_perseus_version.ts -t PR3685If you are working in Khan Academy's webapp, you can run the below command. ./dev/tools/bump_perseus_version.js -t PR3685 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
Wires the Ray graph's
movePoint(endpoint) andmoveRay(whole-line grabhandle) actions into the existing WB Announcer pipeline.
What this PR does:
case "ray"indoMovePointInFigurenow emitsstateAnnouncement: {type: "move-ray-point", pointIndex, x, y}when anendpoint moves.
case "ray"indoMoveLineemitsstateAnnouncement: {type: "move-ray-line", coords}when the whole ray isdragged via the grab handle. Both
case "ray"blocks are split out fromthe shared
case "linear"/case "vector"blocks so linear and vectorare intentionally untouched.
MoveRayPointAnnouncementandMoveRayLineAnnouncementtoInteractiveGraphStateAnnouncement.getAnnouncementTexthandles"move-ray-point"byindex — the endpoint (index 0) uses
srRayEndpoint("Endpoint at X commaY.") and the terminal point (index 1) uses
srRayTerminalPoint("Through point at X comma Y.") — and
"move-ray-line"usessrRayGrabHandle("Ray with endpoint X1 comma Y1 going through point X2comma Y2.").
ariaLiveoverride prop toMovableLine. Itdefaults to
undefined, preserving the internalaria-livestate machinefor the other graphs that still share
MovableLine(linear, segment,linear-system).
ray.tsxpassesariaLive="off"so the WB Announcer isthe only source of move announcements for the Ray graph.
which tracks removing
aria-livefromuseControlPointandMovableLineonce every line graph's reducer is wired to the announcer.
movePointandmoveRayon ray, addsscreenreader-texttests (move-ray-pointat both indices +move-ray-line), and removes the now-obsolete "Should update thearia-live when X is moved" test from
ray.test.tsx.Issue: LEMS-4199
Test plan:
Automated
pnpm tsc— passespnpm lint packages/perseus— passespnpm jest packages/perseus/src/widgets/interactive-graphs— passesManual (reviewer)
pnpm storybook). Turn on VoiceOver / NVDA (or use the Storybook a11y addon's live-region inspector).aria-label, unchanged).aria-liveand the WB Announcer would have fired.move-ray-lineannouncement, and you should hear it only once.