Skip to content

Conversation

@jzsfkzm
Copy link
Contributor

@jzsfkzm jzsfkzm commented Oct 21, 2025

refs #1981

Summary by CodeRabbit

  • Bug Fixes

    • Improved selection behavior to ensure only valid items from the current list remain selected, preventing stale selections.
    • Enhanced deployment details navigation with explicit interactive controls for better clarity.
  • Style

    • Updated touch target styling for checkbox interactions with refined visual feedback on hover.

@jzsfkzm jzsfkzm requested a review from a team as a code owner October 21, 2025 15:38
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 21, 2025

Walkthrough

The PR refactors deployment row navigation from implicit row-click to explicit button and anchor link elements, adds validation filtering to the selection hook to ensure selected IDs match current data using intersection, and updates checkbox styling for the expanded touch target mode.

Changes

Cohort / File(s) Summary
Deployment Row Navigation
apps/deploy-web/src/components/deployments/DeploymentListRow.tsx
Removed row-level click handler; added Button wrapper for navigation trigger and anchor link wrapping deployment name; adjusted layout spacing by removing explicit gaps.
Selection Validation
apps/deploy-web/src/hooks/useListSelection/useListSelection.ts
Added lodash intersection and uniq imports; filters selected item IDs against current ids list; returns validSelectedItemIds derived from intersection to ensure only present items are selected.
Checkbox Styling
packages/ui/components/checkbox.tsx
Updated expandedTouchTarget mode classes: replaced -m-3 cursor-pointer p-3 hover:bg-muted-foreground/10 rounded-full with hover:bg-accent cursor-pointer rounded-full p-3 to alter hover behavior and remove negative margins.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • akash-network/console#1994: Modifies the same useListSelection hook and DeploymentListRow component; adds multi-select and Shift-range logic that complements this PR's selection filtering.
  • akash-network/console#2077: Introduces the expandedTouchTarget API for checkbox component; this PR adjusts the styling applied when that mode is enabled.

Suggested reviewers

  • ygrishajev

Poem

🐰✨ A row clicks no more, the buttons now lead,
Selection stays honest—we filter with speed,
Checkboxes glow softer with accents so bright,
Navigation flows cleaner, our UI feels right! 🎯

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "fix: name and right button link to deployment page, not the whole line" directly and accurately reflects the main change in the changeset. The primary alteration in DeploymentListRow.tsx removes the click handler from the entire table row and replaces it with specific navigation elements: an anchor link on the deployment name and a button on the right-aligned action. The title clearly communicates this shift from row-level navigation to targeted element links, making it specific and helpful for developers scanning PR history. While the changeset includes secondary modifications to useListSelection.ts and checkbox.tsx, these support the primary change and are not expected to be covered in the title.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/deploy-web/src/components/deployments/DeploymentListRow.tsx (1)

180-182: Consider using semantic link styles instead of hardcoded color.

The anchor correctly provides explicit navigation to deployment details, but className="text-black" hardcodes the text color, which may:

  • Not follow the design system's link patterns
  • Fail to indicate the element is clickable
  • Break in dark mode themes

Consider using a semantic class or removing the className to inherit proper link styling:

-          <a href={UrlService.deploymentDetails(deployment.dseq)} className="text-black">
+          <a href={UrlService.deploymentDetails(deployment.dseq)} className="hover:underline">
             <DeploymentName deployment={deployment} deploymentServices={leaseStatus?.services} providerHostUri={provider?.hostUri} />
           </a>
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b41833f and 1d457e9.

📒 Files selected for processing (3)
  • apps/deploy-web/src/components/deployments/DeploymentListRow.tsx (5 hunks)
  • apps/deploy-web/src/hooks/useListSelection/useListSelection.ts (3 hunks)
  • packages/ui/components/checkbox.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Never use type any or cast to type any. Always define the proper TypeScript types.

Files:

  • apps/deploy-web/src/components/deployments/DeploymentListRow.tsx
  • packages/ui/components/checkbox.tsx
  • apps/deploy-web/src/hooks/useListSelection/useListSelection.ts
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

**/*.{js,ts,tsx}: Never use deprecated methods from libraries.
Don't add unnecessary comments to the code

Files:

  • apps/deploy-web/src/components/deployments/DeploymentListRow.tsx
  • packages/ui/components/checkbox.tsx
  • apps/deploy-web/src/hooks/useListSelection/useListSelection.ts
🧠 Learnings (1)
📓 Common learnings
Learnt from: jzsfkzm
PR: akash-network/console#1994
File: apps/deploy-web/src/hooks/useListSelection/useListSelection.spec.ts:58-64
Timestamp: 2025-10-17T10:04:00.909Z
Learning: In the Akash Console deployment list multi-select feature (PR #1994, apps/deploy-web/src/hooks/useListSelection), the requirement is for additive Shift+click behavior: subsequent Shift+clicks should expand/add to the existing selection rather than replacing the previous Shift range. This differs from canonical Gmail/Finder-style replacement behavior.
🧬 Code graph analysis (2)
apps/deploy-web/src/components/deployments/DeploymentListRow.tsx (1)
apps/deploy-web/src/components/deployments/DeploymentName/DeploymentName.tsx (1)
  • DeploymentName (27-69)
packages/ui/components/checkbox.tsx (1)
apps/provider-console/src/utils/styleUtils.ts (1)
  • cn (4-6)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: validate / validate-app
  • GitHub Check: test-build
  • GitHub Check: test-build
  • GitHub Check: test-build
  • GitHub Check: Validate local packages
🔇 Additional comments (7)
packages/ui/components/checkbox.tsx (1)

33-33: LGTM! Styling update aligns with navigation refactor.

The removal of negative margin and switch to hover:bg-accent improves consistency with the updated navigation pattern in the deployment list.

apps/deploy-web/src/components/deployments/DeploymentListRow.tsx (3)

91-93: LGTM! Navigation callback is correctly implemented.

The viewDeployment callback is properly memoized and uses the appropriate routing service.


167-167: LGTM! Row-level navigation correctly removed.

The TableRow now provides visual hover feedback without implicit navigation, aligning with the PR objective.


344-346: LGTM! Navigation button correctly implements explicit navigation.

The Button properly wraps the NavArrowRight icon and calls the viewDeployment handler, providing clear, explicit navigation as intended by the PR.

apps/deploy-web/src/hooks/useListSelection/useListSelection.ts (3)

2-3: LGTM! Per-method imports optimize bundle size.

The imports use the recommended per-method pattern for lodash, ensuring only the required utilities are included in the bundle.


41-50: LGTM! Toggle selection logic is correct.

The callback properly handles single-item selection toggling and maintains the interval selection anchor for shift-click behavior.


83-85: Excellent defensive improvement! Selection validation prevents stale selections.

The validSelectedItemIds computation filters out any selected IDs that no longer exist in the current ids array. This prevents edge cases where:

  • Items are removed from the list but remain in the selection state
  • The list is filtered or refreshed with a different set of items

The memoization correctly depends on both ids and selectedItemIds, ensuring the intersection is recomputed when either changes.

Also applies to: 89-89, 94-94

@ygrishajev ygrishajev merged commit 3ea1f04 into akash-network:main Oct 22, 2025
63 checks passed
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