Skip to content

feat(DiffRenderable): synchronize scroll between split view panes in diff.ts#742

Merged
kommander merged 9 commits intoanomalyco:mainfrom
viralcodex:sync-scroll-diff
Mar 9, 2026
Merged

feat(DiffRenderable): synchronize scroll between split view panes in diff.ts#742
kommander merged 9 commits intoanomalyco:mainfrom
viralcodex:sync-scroll-diff

Conversation

@viralcodex
Copy link
Copy Markdown
Contributor

@viralcodex viralcodex commented Feb 25, 2026

Fixes: #563
Hi @kommander and @simonklee,

Added this synced scroll in code diff as mentioned in this issue...

I was thinking to keep both separate and synced scroll which can be toggled through hotkeys depending on user preferences.

Whatever you guys say 😄

opentui4.mov

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Feb 25, 2026

@opentui/core

npm i https://pkg.pr.new/@opentui/core@c7447e3

@opentui/react

npm i https://pkg.pr.new/@opentui/react@c7447e3

@opentui/solid

npm i https://pkg.pr.new/@opentui/solid@c7447e3

@opentui/core-darwin-arm64

npm i https://pkg.pr.new/@opentui/core-darwin-arm64@c7447e3

@opentui/core-darwin-x64

npm i https://pkg.pr.new/@opentui/core-darwin-x64@c7447e3

@opentui/core-linux-arm64

npm i https://pkg.pr.new/@opentui/core-linux-arm64@c7447e3

@opentui/core-linux-x64

npm i https://pkg.pr.new/@opentui/core-linux-x64@c7447e3

@opentui/core-win32-arm64

npm i https://pkg.pr.new/@opentui/core-win32-arm64@c7447e3

@opentui/core-win32-x64

npm i https://pkg.pr.new/@opentui/core-win32-x64@c7447e3

commit: c7447e3

@simonklee
Copy link
Copy Markdown
Member

Thanks for taking a stab at this. If i understand the impl right you changed the behavior to always be "synced"?

@viralcodex
Copy link
Copy Markdown
Contributor Author

@simonklee , yes I have changed it to always sync, um, like everywhere else we see. If you want I can have a hotkey based toggle between both separate/synced behaviours too.

@simonklee
Copy link
Copy Markdown
Member

@simonklee , yes I have changed it to always sync, um, like everywhere else we see. If you want I can have a hotkey based toggle between both separate/synced behaviours too.

I understand, but this is effectively just changing the behavior of a design decision made by @kommander. See his comment in the original issue:

That was intentional. Synced scroll could be added though.

So, to land this PR, that should be addressed.

@viralcodex
Copy link
Copy Markdown
Contributor Author

Yes, I read it, but for starters I did the change.
@kommander, what would you suggest? A toggle between both states, or anything else. Will make the change accordingly.

@simonklee
Copy link
Copy Markdown
Member

Yeh, something like that. An option on the DiffRenderable that defaults to the current behavior.

@viralcodex
Copy link
Copy Markdown
Contributor Author

Yeh, something like that. An option on the DiffRenderable that defaults to the current behaviour.

Hey @simonklee , made the changes, added the option in the API as syncScroll, false by default to keep the current behaviour. can be set to true to make it synced.

@kommander kommander merged commit 4663e76 into anomalyco:main Mar 9, 2026
8 checks passed
@viralcodex viralcodex deleted the sync-scroll-diff branch March 9, 2026 14:26
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.

bug: <diff mode={"split"} > scrolling is not synced

3 participants