Skip to content

feat(apollo-react): select and move through rules in the decision text [ECS-2140] - #1551

Merged
pateljay43 merged 1 commit into
mainfrom
jay/apollo-decision-table-nl-selection
Nov 13, 2026
Merged

pateljay43 merged 1 commit into
mainfrom
jay/apollo-decision-table-nl-selection

Conversation

@pateljay43

@pateljay43 pateljay43 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Adds selection and keyboard to DecisionText: a rule or one of its cells can be selected (selected / onSelect, the same { rowId, columnId } shape the grid selects), Tab lands on the selected stop, and the arrow keys, Home and End move it, ignoring keys while an IME composes, like the grid. The view keeps the selected row mounted while windowing, scrolls to a selection the host moves, and leaves a clicked rule where it is. Long lines wrap instead of clipping, and a focused add-rule action stays in view after the rule it adds. ECS-2140

Stacked on #1543.

@pateljay43
pateljay43 added this pull request to stack #1552 November 9, 2026 18:35
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

📊 Coverage + size by package

Per-package coverage and bundle size on this PR. New-line coverage = of the source lines this PR adds or changes, the % hit by tests.

Package Coverage New-line coverage Packed (gzip) Unpacked vs main
@uipath/apollo-core — — 42.02 MB 50.17 MB ±0
@uipath/apollo-react 60.5% 97.6% (323/331) 2.54 MB 14.26 MB +50.4 KB
@uipath/apollo-ui-icons — — 2.86 MB 6.97 MB ±0
@uipath/apollo-vertex — — — — —
@uipath/apollo-wind — — 909.2 KB 5.12 MB −1 B
@uipath/ap-chat 85.8% — 40.48 MB 46.10 MB ±0

"Coverage" is each package's own coverage.include scope (e.g. apollo-core instruments only scripts/). "Packed"/"Unpacked" come from npm pack --dry-run and only cover built packages — "—" means not measured this run (package not affected / not built). "vs main" is the packed (gzipped) delta against the last successful main build (the package-sizes artifact from the Release workflow); "—" there means no main baseline was available this run. The baseline is main's latest build, not this PR's exact merge-base, so it includes any drift since the branch diverged. Packages with no vitest config are omitted.

@pateljay43
pateljay43 force-pushed the jay/apollo-decision-table-nl-selection branch from 0fa58db to bcd2298 Compare November 9, 2026 21:47
Copilot AI balanced review requested due to automatic review settings November 9, 2026 21:47
@pateljay43 pateljay43 changed the title feat(apollo-react): select and move through rules in the decision table sentences [ECS-2140] feat(apollo-react): select and move through rules in the decision card [ECS-2140] Nov 9, 2026
@github-actions
github-actions Bot temporarily deployed to preview/apollo-landing November 9, 2026 21:47 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-design November 9, 2026 21:47 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-vertex November 9, 2026 21:47 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-docs November 9, 2026 21:47 Destroyed
@github-actions github-actions Bot added the size:XXL 1,000+ changed lines. label Nov 9, 2026
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Dependency License Review

  • ✅ 1958 package(s) scanned
  • ✅ No license issues found
  • ⚠️ 2 package(s) excluded (see details below)
License distribution
License Packages
MIT 1722
ISC 91
Apache-2.0 57
BSD-3-Clause 28
BSD-2-Clause 23
BlueOak-1.0.0 8
MPL-2.0 4
CC0-1.0 4
MIT-0 3
MIT OR Apache-2.0 2
(MIT OR Apache-2.0) 2
Unlicense 2
LGPL-3.0-or-later 1
Python-2.0 1
CC-BY-4.0 1
(MPL-2.0 OR Apache-2.0) 1
Unknown 1
Artistic-2.0 1
(WTFPL OR MIT) 1
(BSD-2-Clause OR MIT OR Apache-2.0) 1
CC-BY-3.0 1
0BSD 1
(MIT OR CC0-1.0) 1
MIT AND ISC 1
Excluded packages
Package Version License Reason
@img/sharp-libvips-linux-x64 1.3.4 LGPL-3.0-or-later LGPL pre-built binary, not linked
khroma 2.1.0 Unknown MIT per GitHub repo, missing license field in package.json

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Outstanding issues cause scroll jumps in oversized rules, leave selected chips clipped after resizing, and produce incorrect rule accessible names.

3 open issues
What changed in this PR

Extends the sentence-based DecisionCard introduced in #1543 with controlled selection and keyboard navigation, aligning it with DecisionTable.

Changes:

  • Adds rule and cell selection, keyboard navigation, focus handling, and selection styling.
  • Preserves selected rows during virtualization and exposes scrolling, container access, and host overlays.
  • Adds interaction tests, accessible cell labels, and a selection story.
File Description
packages/​apollo-react/​src/​decision-table/​useSentenceNavigation.ts Implements keyboard navigation, focus, and selected-cell reveal.
packages/​apollo-react/​src/​decision-table/​useGridNavigation.ts Exports shared navigation constants and helpers.
packages/​apollo-react/​src/​decision-table/​sentenceTypes.ts Defines selection, ref handle, and cell-label contracts.
packages/​apollo-react/​src/​decision-table/​sentenceStyles.ts Adds selection rings and revealed-text styling.
packages/​apollo-react/​src/​decision-table/​sentenceMarks.ts Exports value-column ordering for navigation.
packages/​apollo-react/​src/​decision-table/​RuleCard.tsx Adds focusable stops, cell labels, and selection indicators.
packages/​apollo-react/​src/​decision-table/​DecisionCard.tsx Connects selection, scrolling, ref methods, and overlays.
packages/​apollo-react/​src/​decision-table/​DecisionCard.test.tsx Covers selection, navigation, focus, scrolling, and ref behavior.
packages/​apollo-react/​src/​decision-table/​DecisionCard.stories.tsx Demonstrates controlled selection and reports selected state.
packages/​apollo-react/​src/​decision-table/​__fixtures__/​sentences.fixtures.ts Supplies accessible cell-label text.

Review effort: Balanced

@pateljay43 pateljay43 changed the title feat(apollo-react): select and move through rules in the decision card [ECS-2140] feat(apollo-react): select and move through rules in the decision text [ECS-2140] Nov 9, 2026
@pateljay43
pateljay43 force-pushed the jay/apollo-decision-table-nl-selection branch from bcd2298 to 7b1260e Compare November 9, 2026 22:51
Copilot AI balanced review requested due to automatic review settings November 9, 2026 22:51
@github-actions
github-actions Bot temporarily deployed to preview/apollo-docs November 9, 2026 22:51 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-vertex November 9, 2026 22:51 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-design November 9, 2026 22:51 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-landing November 9, 2026 22:52 Destroyed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Row accessible names incorrectly repeat cell labels, and selected chips can remain clipped after resizing or rule updates.

4 open issues

Review effort: Balanced

@github-actions
github-actions Bot temporarily deployed to preview/apollo-design November 9, 2026 23:00 Destroyed
Copilot AI balanced review requested due to automatic review settings November 9, 2026 23:01
@github-actions
github-actions Bot temporarily deployed to preview/apollo-landing November 9, 2026 23:02 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-vertex November 9, 2026 23:02 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-design November 9, 2026 23:02 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-docs November 9, 2026 23:02 Destroyed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Controlled selection handling can fail to clear the host’s stale cell selection and leave selected headings offscreen in tall rules.

2 open issues

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 10, 2026 05:06
@github-actions
github-actions Bot temporarily deployed to preview/apollo-design November 10, 2026 05:06 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-landing November 10, 2026 05:06 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-docs November 10, 2026 05:06 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-vertex November 10, 2026 05:07 Destroyed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the DecisionText selection and keyboard-navigation changes.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

@pateljay43
pateljay43 force-pushed the jay/apollo-decision-table-nl-selection branch from bda56cf to ccf19df Compare November 10, 2026 18:59
Copilot AI balanced review requested due to automatic review settings November 10, 2026 18:59
@github-actions
github-actions Bot temporarily deployed to preview/apollo-design November 10, 2026 18:59 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-docs November 10, 2026 18:59 Destroyed
@github-actions
github-actions Bot temporarily deployed to preview/apollo-landing November 10, 2026 18:59 Destroyed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Oversized RTL tokens can be scrolled so their right-hand reading-start edge is clipped; reveal alignment must respect the line’s direction.

1 open issue

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the DecisionText selection and navigation changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the DecisionText selection, keyboard navigation, and host-integration changes.

No open issues 🎉

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

DecisionText lacks the advertised imperative ref APIs and children slot, preventing hosts from accessing container()/scrollRowIntoView or rendering overlays as described.

1 open issue

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

DecisionText does not expose the advertised scrolling ref handle or accept and render children, preventing hosts from using the scrolling API or mounting overlays inside the view.

2 open issues

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Scrolling prioritizes the selected cell over the focused Add rule footer, which can leave keyboard focus below the viewport for a tall newly added rule.

1 open issue
2 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Human assessment is needed to evaluate a shadow-root focus-recovery issue that can leave keyboard focus unrestored when a focused rule is removed.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Keyboard focus can be lost after rule removal in shadow-root views or left on an off-screen Add rule button after the first rule is added without a selection update.

2 open issues

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

An explicit rule click can leave the remembered column uncleared, causing subsequent vertical navigation to select a cell instead of the rule.

1 open issue
2 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues are reported for the DecisionText selection and navigation changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

…t [ECS-2140]

A host's selected rule or cell is a keyboard stop that Tab lands on; arrows, Home and End
move it, a click selects without scrolling, and focus follows only selections the host applies.
Lines wrap instead of clipping, and the window lays rules out at their measured heights.
@github-actions

Copy link
Copy Markdown
Contributor

Storybook visual diff

⚠️ Visual changes detected: 14 added (of 28 compared, 14 unchanged). View report

Baseline is the deployed main Storybook, so changes merged to main after this branch was last updated can also appear here. Logs

Updated (PT): Nov 13, 2026, 11:57:36 AM

@alucauipath alucauipath left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approving: the roving focus, retained selected row and add-rule focus handling look solid and well tested. A few things worth addressing (the first one before or right after merge):

1. Rule cards lost their run verdicts in the accessible name. ruleCardModel.ts replaces the card's aria-labelledby (heading + lead, which included the lead's sr-only "Matched"/"Not matched" spans) with an aria-label built from shownLineText(heading) + shownLineText(lead), which has no verdicts. For rules worded entirely in the lead (e.g. the grid story's rules with lines: []), focusing the rule no longer announces whether the run matched its conditions. Cell stops still carry their verdicts via verdictOf, so only the rule stop regressed. Could the lead's verdicts be added to the label, or the card go back to aria-labelledby?

2. Scroll jumps in Safari (worth a manual check). With lines wrapping, measured card heights replace estimates as cards mount. When an overscanned card above the viewport measures taller than its estimate, content below shifts; Chrome/Firefox compensate with scroll anchoring, Safari doesn't. Worth trying a scroll-up through long wrapped rules at a narrow width in Safari.

3. containerProps.onKeyDown is skipped for keys the view claims (useContainerHandlers.ts), and since the view runs first, a host can't preventDefault to keep a key. Probably intended, but the containerProps doc still says its handlers "run after the view's"; worth updating.

4. Refocus-on-removal relies on blur. The per-render effect in useContainerHandlers.ts refocuses the view when focus is lost while focusWithinRef is set. Browsers that don't fire blur when the focused element is removed may behave differently from jsdom here; worth checking by deleting the focused selected row in a real browser.

5. Nits: the measured heights map in useRuleWindow.ts never drops row ids that are gone; and since a new rules identity now also rebuilds offsets and re-measures every render, the rules prop doc could say to memoize it, as labels does.

This branch was successfully deployed

No deployments
preview/apollo-landing — ddb277ab Deployed Nov 13, 2026 by github-actions[bot]
preview/apollo-vertex — ddb277ab Deployed Nov 13, 2026 by github-actions[bot]
preview/apollo-docs — ddb277ab Deployed Nov 13, 2026 by github-actions[bot]
preview/apollo-design — ddb277ab Deployed Nov 13, 2026 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:apollo-react size:XXL 1,000+ changed lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants