feat(executor): add tab character to tab node conversion in text insert#2832
feat(executor): add tab character to tab node conversion in text insert#2832harbournick merged 6 commits intomainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f4a3cd90a8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…ontent for tab nodes - Introduced a new integration test for the `executeTextInsert` function to validate behavior when inserting text into nodes that disallow tab nodes, specifically for the `total-page-number` type. - Updated the `executeTextInsert` function to check if the parent node allows tab nodes before creating them, ensuring that raw tab characters are preserved as text when necessary. - Added a utility function `parentAllowsNode` to determine if a node type can be inserted based on the parent's content match.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
hey @andrii-harbour - review pass on this one, wanted to share a few concerns. fixing tabs at the editor-data layer introduces two new problems:
scope is also narrow: might be worth going export-side instead: when serializing a text run, if we see happy to chat if there's context i'm missing. |
hey @caio-pizzol ! Thnx for the review. I agree that going export-side would be easier fix, however I have one concern here. Doing that means we have different nodes/content while rendering the doc and while exporting the doc. That might not be the problem now, but in the long run with this approach our differences of actual data for document API and data for export would be too different. |
caio-pizzol
left a comment
There was a problem hiding this comment.
hey @andrii-harbour! you're right - the importer makes tab nodes on docx open anyway, so keeping the write path consistent is the cleaner call. scratch my export-side suggestion from before.
that said, the inline comments are still valid. the four things from my earlier pass haven't moved:
- marks dropped on the tab node
|| truein the new test- only
insertis fixed -replaceand the structural paths still write raw\t - reading a tab back gives
\ufffcinstead of\t
good to merge after that.
|
@caio-pizzol deal. Agree on the comments. Working on the fixes now |
…raction - Introduced `buildTextWithTabs` and `textBetweenWithTabs` functions to manage tab characters, converting them to tab nodes during text insertion and ensuring they are correctly represented in document extraction. - Updated existing commands (`insertHeadingAt`, `insertListItemAt`, `insertParagraphAt`) to utilize the new tab handling functions, enhancing text formatting capabilities. - Modified tests to validate the new tab handling behavior, ensuring that tab characters are preserved and correctly processed in various scenarios. - Added comprehensive tests for the new helper functions to ensure robust functionality across different document structures. This update enhances the editor's ability to handle tab characters, improving the overall user experience when working with formatted text.
|
@caio-pizzol made the fixes. A bit more than expected, but also fixed a few minor things along the way |
|
🎉 This PR is included in @superdoc-dev/react v1.2.0-next.38 The release is available on GitHub release |
|
🎉 This PR is included in vscode-ext v2.3.0-next.40 |
|
🎉 This PR is included in superdoc-cli v0.8.0-next.3 The release is available on GitHub release |
|
🎉 This PR is included in superdoc v1.28.0-next.3 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-sdk v1.6.0-next.39 |
|
🎉 This PR is included in esign v2.4.0 The release is available on GitHub release |
### Bug Fixes - restore published config typings - place cursor at clicked pos inside tracked change (#2855) - wait for in-flight cleanup in dispose() (#2892) ### Changes - Merge remote-tracking branch 'origin/main' into merge/main-into-stable-2026-04-22 ### Features - add tab character to tab node conversion in text insert (#2832)
|
🎉 This PR is included in superdoc-sdk v1.7.0 |
|
🎉 This PR is included in superdoc v1.28.0 The release is available on GitHub release |
No description provided.