Skip to content

fix(ui): restore resource-row expand chevron to leading edge (closes #1006) - #1446

Merged
cristim merged 2 commits into
mainfrom
fix/1006-chevron-leading-edge
Jul 17, 2026
Merged

fix(ui): restore resource-row expand chevron to leading edge (closes #1006)#1446
cristim merged 2 commits into
mainfrom
fix/1006-chevron-leading-edge

Conversation

@cristim

@cristim cristim commented Jul 17, 2026

Copy link
Copy Markdown
Member

Summary

  • The expand/collapse chevron on multi-variant Opportunities rows was rendering inline inside the content cell (before the Resource Type text) for readonly/viewer sessions, because buildListMarkup omitted the leading td.checkbox-col when showCheckboxes was false.
  • Owner decision (issue ux(opportunities): confirm expand-chevron position (moved to front of Resource Type) #1006): chevron belongs at the far-left edge, before the Provider column, for all roles.
  • This PR restores consistent placement by always emitting a leading td.checkbox-col and th.checkbox-col regardless of role, with the chevron inside it for cell summary rows and an empty cell for variant/header rows.

Changes

  • frontend/src/recommendations.ts: remove the showCheckboxes condition from chevronCell (cell summary rows); drop inlineChevron inline-injection; always emit <th class="checkbox-col"> in the header (empty for viewers); always emit <td class="checkbox-col"> in variant rows (empty for viewers); update zero-rows empty-hint colspan to always include 1 for the leading column.
  • frontend/src/__tests__/recommendations-permissions.test.ts: update readonly grouped-row test to assert chevron lives in td.checkbox-col; update SP-group variant-row test to expect one empty td.checkbox-col per row (no input[data-rec-id]).

Test plan

  • npm run typecheck passes
  • npm run build passes (pre-existing entrypoint-size warning only)
  • npx jest --no-coverage src/__tests__/recommendations.test.ts src/__tests__/recommendations-permissions.test.ts - 422 tests, 0 failures
  • Verify in browser: as a readonly user, the expand chevron on Opportunities rows appears at the far-left edge (before Provider), not inline before Resource Type text

Closes #1006

Summary by CodeRabbit

  • Bug Fixes
    • Improved table alignment in read-only recommendation views by consistently preserving the leading column.
    • Ensured expand/collapse controls remain clearly positioned in grouped summary rows.
    • Prevented selection checkboxes from appearing in read-only sessions.
    • Corrected empty-state row alignment when no recommendations match.

…1006)

The expand/collapse chevron on multi-variant cell summary rows was
rendered inline inside the content cell (before the Resource Type
text) for readonly/viewer sessions because buildListMarkup zeroed
out the leading td.checkbox-col when showCheckboxes was false.

Restore the chevron to the far-left column (before Provider) for
all roles by:
- Always emitting td.checkbox-col as the first cell in cell summary
  rows (contains the chevron button; no change for admin/editor).
- Always emitting an empty th.checkbox-col in the table header for
  viewers, keeping column alignment consistent.
- Always emitting an empty td.checkbox-col in variant rows for
  viewers, so expanded row columns align with the header and summary
  rows.
- Updating the zero-rows empty-hint colspan to always include 1 for
  the leading column.

SP-group parent rows were already correct (they always emitted the
leading cell). This change makes non-SP cell summary rows consistent.

Owner decision: chevron belongs at the table's far-left edge, before
the Provider column, matching the standard row-expander control
placement (QA row 568, issue #1006).

Tests updated: readonly grouped-row test now asserts the chevron
lives in td.checkbox-col; SP-group variant-row test updated to
expect one empty td.checkbox-col per row (no checkbox input).
@cristim cristim added triaged Item has been triaged priority/p3 Polish / idea / may never ship severity/low Minor harm urgency/eventually No deadline impact/many Affects most users effort/xs Trivial / one-liner type/bug Defect labels Jul 17, 2026
@cristim

cristim commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@cristim

cristim commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Full review finished.


You're currently rate limited under our Fair Usage Limits Policy. Your recent PR review activity is in the 95th percentile or higher among CodeRabbit users, so adaptive limits apply. Your next review will be available in 7 minutes.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 40 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b8e6a7c7-04f1-42cd-8c7a-85d339d8cbef

📥 Commits

Reviewing files that changed from the base of the PR and between e43b989 and 21aad04.

📒 Files selected for processing (1)
  • frontend/src/__tests__/recommendations-permissions.test.ts
📝 Walkthrough

Walkthrough

Readonly recommendations tables now preserve the leading checkbox column for structural alignment, place expand chevrons within it, and keep checkbox inputs disabled by omission. Empty-state colspan calculations and permission tests were updated accordingly.

Changes

Readonly recommendations alignment

Layer / File(s) Summary
Render aligned readonly columns
frontend/src/recommendations.ts
Readonly variant rows and headers retain empty checkbox-col cells, grouped-row chevrons render in that column, and empty states include the leading column in their colspan.
Validate readonly DOM structure
frontend/src/__tests__/recommendations-permissions.test.ts
Permission tests verify header and row alignment, chevron placement, and the absence of readonly checkbox inputs.

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

Possibly related PRs

  • LeanerCloud/CUDly#798: Establishes chevron placement within the recommendations table’s leading checkbox column.
  • LeanerCloud/CUDly#807: Introduces related grouped parent/child rendering and readonly checkbox gating.
  • LeanerCloud/CUDly#876: Updates recommendations viewer rendering and checkbox-column permission behavior.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes restoring the expand chevron position and references the linked issue.
Linked Issues check ✅ Passed The changes restore the chevron to the far-left column and keep alignment consistent across roles, matching #1006.
Out of Scope Changes check ✅ Passed The diff stays focused on chevron placement, table alignment, and related tests with no unrelated feature work.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/1006-chevron-leading-edge

Comment @coderabbitai help to get the list of available commands.

@cristim

cristim commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/src/__tests__/recommendations-permissions.test.ts`:
- Around line 340-351: Strengthen the readonly DOM assertions in
frontend/src/__tests__/recommendations-permissions.test.ts at lines 340-351 by
asserting the first header cell and first summary-row cell are checkbox-col
elements, while preserving the existing count and chevron checks. At lines
520-524, assert each child row’s first cell is td.checkbox-col and has empty
text content; no other sites require changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 736b3ed9-69bd-4003-b8ba-b766b552a4f9

📥 Commits

Reviewing files that changed from the base of the PR and between bef2d0e and e43b989.

📒 Files selected for processing (2)
  • frontend/src/__tests__/recommendations-permissions.test.ts
  • frontend/src/recommendations.ts

Comment thread frontend/src/__tests__/recommendations-permissions.test.ts
Assert that th.checkbox-col and td.checkbox-col are the first cells in
their respective rows (not just present), and that variant rows' leading
td.checkbox-col has empty text content.

Addresses CodeRabbit finding on PR #1446 (actionable comment, minor).
@cristim

cristim commented Jul 17, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@cristim
cristim merged commit 369e5a2 into main Jul 17, 2026
20 checks passed
@cristim
cristim deleted the fix/1006-chevron-leading-edge branch July 27, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/xs Trivial / one-liner impact/many Affects most users priority/p3 Polish / idea / may never ship severity/low Minor harm triaged Item has been triaged type/bug Defect urgency/eventually No deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ux(opportunities): confirm expand-chevron position (moved to front of Resource Type)

1 participant