Skip to content

Refactor/row actions - #380

Merged
ako3131 merged 7 commits into
mainfrom
refactor/row-actions
Nov 9, 2026
Merged

ako3131 merged 7 commits into
mainfrom
refactor/row-actions

Conversation

@ako3131

@ako3131 ako3131 commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

ref: https://app.clickup.com/t/9014802374/86bcxj2kh

Summary

Replaces the separate Edit and Delete icon columns in MuiTable, EditableTable and SortableTable with a single ⋮ row actions menu.

  • The menu shows Edit, then any custom actions, a divider, then Delete in red.
  • New getRowActions(row) prop on all three tables for extra menu items ({ label, onClick, disabled }).
  • Disabled rows (options.disableProp): Edit and Delete are greyed out. The ⋮ button stays enabled while any custom action is enabled. EditableTable now disables them too; before, its Edit and Delete stayed clickable on disabled rows.
  • canDelete(row) === false hides Delete in MuiTable.
  • MuiTable drops its responsive "collapse actions into a menu" behaviour, because the menu is now always used.
  • Adds the i18n key general.more_actions.
  • Not changed: BulkEditTable and SortableTableV2 since they are not in summit admin. I scoped it to summit admin so it is easier to manage.

Follow ups

-Move archiving into the row actions button
-Create linkable cells instead of full row clicks. For example, clicking the name of a summit brings you to the corresponding edit page.

Breaking changes (fixes are in fntechgit/summit-admin#1147)

  • Test selectors: data-testid="action-edit" / "action-delete" and the EditIcon / DeleteIcon buttons are gone. Tests should click row-actions-menu-trigger, then select the menuitem by name.
  • Column count: tables with both onEdit and onDelete have one fewer action column. Extra rows passed as children with fixed column spans (e.g. TotalRow trailing) need adjusting.
  • Removed option: options.responsive is now ignored.

Question

-Should table rows be editable/deletable when archived?

@ako3131
ako3131 requested a balanced review from Copilot November 3, 2026 19:11
@ako3131 ako3131 self-assigned this Nov 3, 2026
@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1371d328-03d4-4821-add3-41ca6b87ea13
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Copilot AI 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.

🟡 Changes recommended

The sortable table does not pass the row-disabled flag to RowActionsMenu, leaving Edit/Delete clickable for disabled rows.

1 open issue
What changed in this PR

Consolidates Edit and Delete into a shared row-actions menu across MuiTable, EditableTable, and SortableTable, with support for custom per-row actions.

Changes:

  • Replaces separate action columns with an always-visible menu column.
  • Adds custom actions, shared disabled-state handling, and a translated menu label.
  • Updates table tests to use menu interactions and cover custom actions.
File Description
src/​i18n/​en.json Adds the “More actions” label.
src/​components/​mui/​tables/​sortable-table/​index.js Integrates the shared menu and custom row actions.
src/​components/​mui/​tables/​mui-table/​index.js Replaces responsive action collapsing with a single menu column.
src/​components/​mui/​tables/​editable-table/​index.js Integrates the menu and disables built-in actions on disabled rows.
src/​components/​mui/​tables/​components/​row-actions-menu.js Adds built-in actions, custom items, and trigger accessibility attributes.
src/​components/​mui/​__tests__/​mui-table.test.js Tests menu callbacks, deletion visibility, and disabled states.
src/​components/​mui/​__tests__/​mui-table-sortable.test.js Updates action tests and adds custom-action coverage.
src/​components/​mui/​__tests__/​mui-table-editable.test.js Updates menu tests, disabled-state checks, and cell expectations.

Review effort: Balanced

ako3131 and others added 2 commits November 3, 2026 13:22
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

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

@ako3131 please also consolidate with this PR so that both tables work and look coherent: #377

onEdit,
onArchive,
onDelete,
getRowActions,

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.

this would entail a change in every single instance of MuiTable, touching too many lines in show admin and sponsor services. What is the point of this ? Can we avoid passing it as prop and keep using columns with a flag to mark it as an action ? We need to try to be as little invasive as possible.

@ako3131 ako3131 Nov 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It was an optional way to add items into the row actions 3 dots button. No tables use it yet so I can just remove it. I'll hold off on making the flag until there's a real need to add column buttons into the row actions button.

{onDelete && <TableCell sx={{ ...ACTION_CELL_SX, ...getIndividualActionSx() }} />}
{onSelect && <TableCell sx={{ ...ACTION_CELL_SX, ...getIndividualActionSx() }} />}
{collapseActions && <TableCell sx={{ ...ACTION_CELL_SX, ...menuCellSx }} />}
{onArchive && <TableCell sx={ACTION_CELL_SX} />}

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.

Leaving "Archive" out of the menu is on purpose ? just checking

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I was going to put this in a follow up pr.

@ako3131 ako3131 Nov 4, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Also, I'm sorry I didn't clarify earlier, but I am closing #377 and splitting up the table action changes into smaller PRs (including this one).

@ako3131
ako3131 requested a review from santipalenque November 4, 2026 19:29

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

LGTM, just a couple of nit picks if you want to make the code cleaner

aria-haspopup="true"
aria-expanded={anchorEl ? "true" : undefined}
disabled={
(!hasBuiltIns || disabled) && actions.every((action) => action.disabled)

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.

lets move this to its own const

open={Boolean(anchorEl)}
onClose={() => setAnchorEl(null)}
>
{onEdit && (

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.

looks like if we merge actions with onEdit, the code gets simpler

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.

3 participants