mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7641] [MERGED] perf(chat): read the selection on scroll only while text is selected #7852
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7852
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7641
Author: @Gunterlie
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @Gunterlie
Base:
staging← Head:perf/selection-toolbar-scroll📝 Commits (1)
e467b67perf(chat): selection lorebook button reads the selection on scroll only while text is selected📊 Changes
1 file changed (+16 additions, -6 deletions)
View changed files
📝
packages/client/src/components/chat/SelectionLorebookButton.tsx(+16 -6)📄 Description
Linked issue
Closes #7640
Why this change
SelectionLorebookButtonlistens to every scroll in the app (capture onwindow) and to resize. Each event readswindow.getSelection()in the next frame, and that read forces a layout. A package screen that scrolls over a mounted chat paid this on every frame, even with no text selected. On Slurp's Discover screen it cost 592 ms of forced layout when the screen opened, at 4× CPU throttle.What changed
packages/client/src/components/chat/SelectionLorebookButton.tsx:selectionchangerecords whether a non-collapsed selection exists and schedules the read as before. Scroll and resize schedule the read only while such a selection exists, so a selection that scrolls keeps its button in place.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm install --frozen-lockfileandpnpm checkon this branch (based onorigin/staging154a33092) exited 0.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)UI evidence (if applicable)
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.