Open
Conversation
Contributor
Author
🖼️ Screenshotsdemo.webm |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Collaborator
|
@luka-nextcloud Thanks a lot! That looks really great. I'll take a look at the code. Could you rebase and Thanks! |
max-nextcloud
requested changes
Mar 18, 2026
Collaborator
max-nextcloud
left a comment
There was a problem hiding this comment.
All in all looks good.
I think it would be nice to not move the cursor around to change the sort order. I added some more detailed comments explaining how I think this would be feasible.
87911cd to
d5f42ce
Compare
Signed-off-by: Luka Trovic <luka@nextcloud.com>
d5f42ce to
0d62d1f
Compare
Comment on lines
+75
to
+99
| const getSortableCellText = (cell) => cell.textContent.trim() | ||
|
|
||
| const isTableCellType = (node) => | ||
| node?.type?.name === 'tableCell' || node?.type?.name === 'tableHeader' | ||
|
|
||
| const resolveTableCellFromPosition = (doc, position) => { | ||
| const tryResolve = (pos) => { | ||
| if (typeof pos !== 'number' || pos < 0 || pos > doc.content.size) { | ||
| return null | ||
| } | ||
| const $pos = doc.resolve(pos) | ||
| for (let depth = $pos.depth; depth > 0; depth -= 1) { | ||
| if (isTableCellType($pos.node(depth))) { | ||
| return { $cell: $pos, cellDepth: depth } | ||
| } | ||
| } | ||
| return null | ||
| } | ||
|
|
||
| return ( | ||
| tryResolve(position) | ||
| || tryResolve(typeof position === 'number' ? position + 1 : position) | ||
| ) | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
Why is this needed?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Summary
🚧 TODO
🏁 Checklist
npm run lint/npm run stylelint/composer run cs:check)