Skip to content

feat: replace inline edit/delete buttons with dropdown menu in pricing overrides table - #3485

Merged
akshaydeo merged 6 commits into
devfrom
05-14-chore_made_actions_sticky_on_the_workspace_custom-pricing_overrides_page_and_sidebar_active_state_fix
May 14, 2026
Merged

feat: replace inline edit/delete buttons with dropdown menu in pricing overrides table#3485
akshaydeo merged 6 commits into
devfrom
05-14-chore_made_actions_sticky_on_the_workspace_custom-pricing_overrides_page_and_sidebar_active_state_fix

Conversation

@impoiler

@impoiler impoiler commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Replaces the individual Edit and Delete action buttons in the pricing overrides table with a consolidated DropdownMenu triggered by a MoreHorizontal icon. Also fixes a sidebar active state bug where sub-items were incorrectly matching routes, and adds hasAPIKeyAccess to the sidebar's memoization dependencies.

Changes

  • Replaced separate Edit and Delete icon buttons in the pricing overrides table rows with a single MoreHorizontal actions dropdown containing labeled Edit and Delete menu items. The Delete item uses the destructive variant for visual clarity.
  • Fixed sidebar sub-item active state detection to use isRouteMatch instead of pathname.startsWith, preventing incorrect active highlighting on partial path matches.
  • Added hasAPIKeyAccess to the sidebar's useMemo dependency array, which was previously missing and could cause stale renders.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

  1. Navigate to the custom pricing overrides table.
  2. Hover over a row and click the (MoreHorizontal) button — a dropdown should appear with Edit and Delete options.
  3. Clicking Edit should open the edit drawer without triggering row selection.
  4. Clicking Delete should open the delete confirmation dialog without triggering row selection.
  5. Verify sidebar sub-item active states are correct when navigating between nested routes — only the exact matching route should appear active.
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build

Screenshots/Recordings

Before: Two separate ghost icon buttons (pencil and trash) visible inline on each row.
After: A single button per row that reveals a dropdown with labeled Edit and Delete actions.

Breaking changes

  • Yes
  • No

Related issues

Security considerations

No security implications.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai

coderabbitai Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Pricing overrides table actions now accessible via dropdown menu instead of inline buttons.
  • Improvements

    • Enhanced sidebar navigation active-state highlighting and conditional menu item visibility based on system configuration.

Walkthrough

Pricing overrides table row actions shift from inline edit/delete buttons to a dropdown menu. Sidebar routing detects active flyout items using the isRouteMatch helper; conditional sidebar entries use spread-based syntax; styling is reformatted; and API-key permission changes now trigger sidebar recomputation.

Changes

Pricing Overrides and Sidebar Updates

Layer / File(s) Summary
Pricing overrides dropdown actions
ui/app/workspace/custom-pricing/overrides/scopedPricingOverridesView.tsx
Imports DropdownMenu UI primitives and MoreHorizontal icon. Table row actions replace two inline buttons with a dropdown menu triggered by icon button; selecting "Edit" opens the edit drawer, selecting "Delete" sets the delete target and stops propagation.
Sidebar active-state routing logic
ui/components/sidebar.tsx
Collapsed flyout subitem active-state now uses isRouteMatch(subItem.url) instead of pathname.startsWith(subItem.url), enabling proper route matching including the /workspace/custom-pricing special case.
Sidebar styling and configuration updates
ui/components/sidebar.tsx
SidebarItemView button and subitem className expressions reformatted; Prompt Repository and Proxy entries restructured into spread-based conditional array forms; hasAPIKeyAccess added to items memo dependency list so sidebar recomputes on API-key permission changes; user-menu conditional parenthesized.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A dropdown blooms where buttons stood,
The sidebar now knows what's good—
Route matching swift, permissions bright,
UI freshened, configs right! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and specifically describes the main change: replacing inline edit/delete buttons with a dropdown menu in the pricing overrides table.
Description check ✅ Passed The PR description covers all required template sections with substantive content: summary explains the changes, changes details what was modified and why, type of change is marked, affected areas are identified, testing steps are provided, and all checklist items are addressed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 05-14-chore_made_actions_sticky_on_the_workspace_custom-pricing_overrides_page_and_sidebar_active_state_fix

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

@impoiler impoiler changed the title chore: Made actions sticky on the workspace/custom-pricing/overrides page and sidebar active state fix feat: replace inline edit/delete buttons with dropdown menu in pricing overrides table May 14, 2026
@impoiler impoiler self-assigned this May 14, 2026
@impoiler
impoiler marked this pull request as ready for review May 14, 2026 08:49
@greptile-apps

greptile-apps Bot commented May 14, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

Safe to merge — the changes are well-scoped UI refactors with no logic regressions introduced.

All three changes are straightforward: the dropdown replaces two buttons with an equivalent UX, the isRouteMatch fix corrects a subtle but low-risk active-state mismatch in the flyout, and the missing dependency in useMemo is a genuine correctness fix that prevents stale sidebar rendering when access permissions change. No data flow or API contracts are affected.

No files require special attention.

Important Files Changed

Filename Overview
ui/app/workspace/custom-pricing/overrides/scopedPricingOverridesView.tsx Replaces two inline icon buttons (Edit, Delete) with a single MoreHorizontal dropdown; variant="destructive" is supported by the local DropdownMenuItem component
ui/components/sidebar.tsx Fixes flyout sub-item active state to use isRouteMatch instead of pathname.startsWith, adds missing hasAPIKeyAccess to the useMemo dependency array, and reformats template literals

Reviews (2): Last reviewed commit: "chore: Made actions sticky on the worksp..." | Re-trigger Greptile

coderabbitai[bot]
coderabbitai Bot previously approved these changes May 14, 2026
@impoiler
impoiler force-pushed the 05-14-chore_made_actions_sticky_on_the_workspace_custom-pricing_overrides_page_and_sidebar_active_state_fix branch from 364c29a to aeb12f4 Compare May 14, 2026 10:12
@impoiler
impoiler force-pushed the 05-14-chore_made_actions_sticky_on_the_workspace_routing-rules_page branch from 24fe3b1 to 4f05042 Compare May 14, 2026 10:12

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

🧹 Nitpick comments (1)
ui/app/workspace/custom-pricing/overrides/scopedPricingOverridesView.tsx (1)

330-348: ⚡ Quick win

Use onSelect instead of onClick for menu item actions.

Lines 333 and 345 use onClick with event.stopPropagation() on DropdownMenuItem. Radix menu items provide the onSelect callback specifically for item activation, which properly integrates with menu lifecycle and keyboard interactions. This pattern is already used elsewhere in the codebase (e.g., addProviderDropdown.tsx).

Suggested patch
- <DropdownMenuItem
+ <DropdownMenuItem
    data-testid={`pricing-override-edit-btn-${row.id}`}
    className="cursor-pointer"
-   onClick={(event) => {
+   onSelect={() => {
-     event.stopPropagation();
      openEditDrawer(row);
    }}
  >
@@
- <DropdownMenuItem
+ <DropdownMenuItem
    data-testid={`pricing-override-delete-btn-${row.id}`}
    variant="destructive"
    className="cursor-pointer"
-   onClick={(event) => {
+   onSelect={() => {
-     event.stopPropagation();
      setDeleteTarget(row);
    }}
  >
🤖 Prompt for 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.

In `@ui/app/workspace/custom-pricing/overrides/scopedPricingOverridesView.tsx`
around lines 330 - 348, Replace the DropdownMenuItem onClick handlers with
onSelect handlers so menu activation uses Radix’s lifecycle and keyboard
support: for the "Edit" item call onSelect={() => openEditDrawer(row)} instead
of onClick with event.stopPropagation(), and for the "Delete" item call
onSelect={() => setDeleteTarget(row)}; update the DropdownMenuItem instances
(the ones with data-testid pricing-override-edit-btn-{row.id} and
pricing-override-delete-btn-{row.id}) to remove event.stopPropagation() and use
the onSelect callbacks to trigger openEditDrawer(row) and setDeleteTarget(row)
respectively.
🤖 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.

Nitpick comments:
In `@ui/app/workspace/custom-pricing/overrides/scopedPricingOverridesView.tsx`:
- Around line 330-348: Replace the DropdownMenuItem onClick handlers with
onSelect handlers so menu activation uses Radix’s lifecycle and keyboard
support: for the "Edit" item call onSelect={() => openEditDrawer(row)} instead
of onClick with event.stopPropagation(), and for the "Delete" item call
onSelect={() => setDeleteTarget(row)}; update the DropdownMenuItem instances
(the ones with data-testid pricing-override-edit-btn-{row.id} and
pricing-override-delete-btn-{row.id}) to remove event.stopPropagation() and use
the onSelect callbacks to trigger openEditDrawer(row) and setDeleteTarget(row)
respectively.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 46a624bb-cc22-45ec-904b-a73242b08117

📥 Commits

Reviewing files that changed from the base of the PR and between 4f05042 and aeb12f4.

📒 Files selected for processing (2)
  • ui/app/workspace/custom-pricing/overrides/scopedPricingOverridesView.tsx
  • ui/components/sidebar.tsx

@impoiler impoiler mentioned this pull request May 14, 2026
18 tasks

akshaydeo commented May 14, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • May 14, 10:19 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • May 14, 10:24 AM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo
akshaydeo changed the base branch from 05-14-chore_made_actions_sticky_on_the_workspace_routing-rules_page to graphite-base/3485 May 14, 2026 10:23
@akshaydeo
akshaydeo changed the base branch from graphite-base/3485 to dev May 14, 2026 10:23
@akshaydeo
akshaydeo dismissed coderabbitai[bot]’s stale review May 14, 2026 10:23

The base branch was changed.

@akshaydeo
akshaydeo merged commit d4bc5a0 into dev May 14, 2026
12 of 13 checks passed
@akshaydeo
akshaydeo deleted the 05-14-chore_made_actions_sticky_on_the_workspace_custom-pricing_overrides_page_and_sidebar_active_state_fix branch May 14, 2026 10:24
akshaydeo pushed a commit that referenced this pull request May 14, 2026
…g overrides table (#3485)

## Summary

Replaces the individual Edit and Delete action buttons in the pricing overrides table with a consolidated `DropdownMenu` triggered by a `MoreHorizontal` icon. Also fixes a sidebar active state bug where sub-items were incorrectly matching routes, and adds `hasAPIKeyAccess` to the sidebar's memoization dependencies.

## Changes

- Replaced separate Edit and Delete icon buttons in the pricing overrides table rows with a single `MoreHorizontal` actions dropdown containing labeled Edit and Delete menu items. The Delete item uses the destructive variant for visual clarity.
- Fixed sidebar sub-item active state detection to use `isRouteMatch` instead of `pathname.startsWith`, preventing incorrect active highlighting on partial path matches.
- Added `hasAPIKeyAccess` to the sidebar's `useMemo` dependency array, which was previously missing and could cause stale renders.

## Type of change

- [ ] Bug fix
- [x] Feature
- [x] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [x] UI (React)
- [ ] Docs

## How to test

1. Navigate to the custom pricing overrides table.
2. Hover over a row and click the `⋯` (MoreHorizontal) button — a dropdown should appear with **Edit** and **Delete** options.
3. Clicking **Edit** should open the edit drawer without triggering row selection.
4. Clicking **Delete** should open the delete confirmation dialog without triggering row selection.
5. Verify sidebar sub-item active states are correct when navigating between nested routes — only the exact matching route should appear active.

```sh
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

## Screenshots/Recordings

Before: Two separate ghost icon buttons (pencil and trash) visible inline on each row.
After: A single `⋯` button per row that reveals a dropdown with labeled **Edit** and **Delete** actions.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

No security implications.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
akshaydeo pushed a commit that referenced this pull request May 15, 2026
…g overrides table (#3485)

## Summary

Replaces the individual Edit and Delete action buttons in the pricing overrides table with a consolidated `DropdownMenu` triggered by a `MoreHorizontal` icon. Also fixes a sidebar active state bug where sub-items were incorrectly matching routes, and adds `hasAPIKeyAccess` to the sidebar's memoization dependencies.

## Changes

- Replaced separate Edit and Delete icon buttons in the pricing overrides table rows with a single `MoreHorizontal` actions dropdown containing labeled Edit and Delete menu items. The Delete item uses the destructive variant for visual clarity.
- Fixed sidebar sub-item active state detection to use `isRouteMatch` instead of `pathname.startsWith`, preventing incorrect active highlighting on partial path matches.
- Added `hasAPIKeyAccess` to the sidebar's `useMemo` dependency array, which was previously missing and could cause stale renders.

## Type of change

- [ ] Bug fix
- [x] Feature
- [x] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [x] UI (React)
- [ ] Docs

## How to test

1. Navigate to the custom pricing overrides table.
2. Hover over a row and click the `⋯` (MoreHorizontal) button — a dropdown should appear with **Edit** and **Delete** options.
3. Clicking **Edit** should open the edit drawer without triggering row selection.
4. Clicking **Delete** should open the delete confirmation dialog without triggering row selection.
5. Verify sidebar sub-item active states are correct when navigating between nested routes — only the exact matching route should appear active.

```sh
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

## Screenshots/Recordings

Before: Two separate ghost icon buttons (pencil and trash) visible inline on each row.
After: A single `⋯` button per row that reveals a dropdown with labeled **Edit** and **Delete** actions.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

No security implications.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
akshaydeo pushed a commit that referenced this pull request May 15, 2026
…g overrides table (#3485)

## Summary

Replaces the individual Edit and Delete action buttons in the pricing overrides table with a consolidated `DropdownMenu` triggered by a `MoreHorizontal` icon. Also fixes a sidebar active state bug where sub-items were incorrectly matching routes, and adds `hasAPIKeyAccess` to the sidebar's memoization dependencies.

## Changes

- Replaced separate Edit and Delete icon buttons in the pricing overrides table rows with a single `MoreHorizontal` actions dropdown containing labeled Edit and Delete menu items. The Delete item uses the destructive variant for visual clarity.
- Fixed sidebar sub-item active state detection to use `isRouteMatch` instead of `pathname.startsWith`, preventing incorrect active highlighting on partial path matches.
- Added `hasAPIKeyAccess` to the sidebar's `useMemo` dependency array, which was previously missing and could cause stale renders.

## Type of change

- [ ] Bug fix
- [x] Feature
- [x] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [x] UI (React)
- [ ] Docs

## How to test

1. Navigate to the custom pricing overrides table.
2. Hover over a row and click the `⋯` (MoreHorizontal) button — a dropdown should appear with **Edit** and **Delete** options.
3. Clicking **Edit** should open the edit drawer without triggering row selection.
4. Clicking **Delete** should open the delete confirmation dialog without triggering row selection.
5. Verify sidebar sub-item active states are correct when navigating between nested routes — only the exact matching route should appear active.

```sh
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

## Screenshots/Recordings

Before: Two separate ghost icon buttons (pencil and trash) visible inline on each row.
After: A single `⋯` button per row that reveals a dropdown with labeled **Edit** and **Delete** actions.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

No security implications.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
akshaydeo pushed a commit that referenced this pull request May 20, 2026
…g overrides table (#3485)

## Summary

Replaces the individual Edit and Delete action buttons in the pricing overrides table with a consolidated `DropdownMenu` triggered by a `MoreHorizontal` icon. Also fixes a sidebar active state bug where sub-items were incorrectly matching routes, and adds `hasAPIKeyAccess` to the sidebar's memoization dependencies.

## Changes

- Replaced separate Edit and Delete icon buttons in the pricing overrides table rows with a single `MoreHorizontal` actions dropdown containing labeled Edit and Delete menu items. The Delete item uses the destructive variant for visual clarity.
- Fixed sidebar sub-item active state detection to use `isRouteMatch` instead of `pathname.startsWith`, preventing incorrect active highlighting on partial path matches.
- Added `hasAPIKeyAccess` to the sidebar's `useMemo` dependency array, which was previously missing and could cause stale renders.

## Type of change

- [ ] Bug fix
- [x] Feature
- [x] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [x] UI (React)
- [ ] Docs

## How to test

1. Navigate to the custom pricing overrides table.
2. Hover over a row and click the `⋯` (MoreHorizontal) button — a dropdown should appear with **Edit** and **Delete** options.
3. Clicking **Edit** should open the edit drawer without triggering row selection.
4. Clicking **Delete** should open the delete confirmation dialog without triggering row selection.
5. Verify sidebar sub-item active states are correct when navigating between nested routes — only the exact matching route should appear active.

```sh
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

## Screenshots/Recordings

Before: Two separate ghost icon buttons (pencil and trash) visible inline on each row.
After: A single `⋯` button per row that reveals a dropdown with labeled **Edit** and **Delete** actions.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

No security implications.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
@akshaydeo akshaydeo mentioned this pull request May 20, 2026
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