Skip to content

Control sorting through props for iTwin and iModel tables - #223

Open
arome wants to merge 32 commits into
mainfrom
omar/save-sort-imodel-table
Open

arome wants to merge 32 commits into
mainfrom
omar/save-sort-imodel-table

Conversation

@arome

@arome arome commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Added the ability to control the sorting of the tables through props.
image

@arome arome changed the title Omar/save sort imodel table Save sort imodel table Jul 10, 2026
@arome
arome marked this pull request as ready for review July 10, 2026 18:01
@arome arome changed the title Save sort imodel table Control sorting through props for iTwin and iModel tables Jul 10, 2026
@arome
arome enabled auto-merge (squash) July 10, 2026 18:02
Comment thread packages/modules/imodel-browser/src/mui/containers/iModelGrid/IModelTableMUI.tsx Outdated
Comment thread packages/modules/imodel-browser/src/mui/containers/iModelGrid/IModelTableMUI.tsx Outdated
Comment thread packages/modules/imodel-browser/src/types.ts Outdated
Comment thread packages/apps/storybook/src/imodel-browser/mui/ITwinGridMUI.stories.tsx Outdated
Comment thread packages/apps/storybook/src/imodel-browser/mui/ITwinGridMUI.stories.tsx Outdated
Comment thread packages/apps/storybook/src/imodel-browser/mui/IModelGridMUI.stories.tsx Outdated
Comment thread packages/apps/storybook/src/imodel-browser/mui/IModelGridMUI.stories.tsx Outdated
Comment thread packages/modules/imodel-browser/src/mui/containers/iModelGrid/IModelGridMUI.tsx Outdated
Comment thread packages/modules/imodel-browser/src/types.ts
Comment thread packages/modules/imodel-browser/src/mui/containers/iModelGrid/IModelTableMUI.tsx Outdated
Comment thread packages/modules/imodel-browser/src/mui/containers/iModelGrid/IModelTableMUI.tsx Outdated

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

Working great in my local testing 💪

Comment thread packages/modules/imodel-browser/src/mui/containers/iModelGrid/IModelGridMUI.tsx Outdated
Comment thread packages/modules/imodel-browser/src/mui/containers/iModelGrid/IModelGridMUI.tsx Outdated
@ben-polinsky

ben-polinsky commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

While we're the only consumers of MUI it feels like a rare opportunity to make API changes.

How are we going to know when someone else starts consuming the MUI components?

@alexdunae

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

Sort breaks when trying to sort by a hidden column.

{
  "hideColumns": [
    "ITwinName"
  ]
}

I'm not sure the sort column chip should appear if that column is being hidden, that could be implementation specific.

image

But aside from that, the records are not sorted by name in the above case, if I unhide the column:

image

Not sure if this is just the storybook implementation, or if it traces back to the component.

@alexdunae

alexdunae commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

While we're the only consumers of MUI it feels like a rare opportunity to make API changes.

How are we going to know when someone else starts consuming the MUI components?

@ben-polinsky Grrr... actually a tough question. I've done a search internally and found one consumer, but of course there is no actual way to know about public usage.

The internal consumer would be unaffected by this change.

@ben-polinsky

Copy link
Copy Markdown
Collaborator

While we're the only consumers of MUI it feels like a rare opportunity to make API changes.

How are we going to know when someone else starts consuming the MUI components?

@ben-polinsky Grrr... actually a tough question. I've done a search internally and found one consumer, but of course there is no actual way to know about public usage.

It's absolutely a "grr..." :)

Anyway, I think we're okay for these changes - perhaps we could mark the components as beta and subject to change? I don't want to hold up this PR any longer, but do think it's worth discussing moving forward.

@alexdunae

Copy link
Copy Markdown
Contributor

@ben-polinsky agreed - we added @alpha for all the MUI stuff

@arome

arome commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Sort breaks when trying to sort by a hidden column.

{
  "hideColumns": [
    "ITwinName"
  ]
}

I'm not sure the sort column chip should appear if that column is being hidden, that could be implementation specific.

image

The column chips are meant to simulate sorting controlled from an external component in that story, they're not part of the iTwinGrid, so hiding the column in the grid shouldnt affect the chips.

But aside from that, the records are not sorted by name in the above case, if I unhide the column:

image

Not sure if this is just the storybook implementation, or if it traces back to the component.

hmm, I wasnt able to reproduce that, if i hide a column and sort by that column using the chips, im still getting the proper sorting.
2026-09-01 17 24 35

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

hmm, I wasnt able to reproduce that, if i hide a column and sort by that column using the chips, im still getting the proper sorting.

Fair enough. I was on the fence about holding this up for this "issue" anyway. Not sure what I was doing wrong, but appreciate you checking it out.

@arome

arome commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

Fixed the flaky test in manage-versions that was failing unrelated to my changes in this PR

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