Repository navigation
fix(conversation): show the map only while the conversation scrolls - #167
Open
pratikbuilds wants to merge 1 commit into
Open
pratikbuilds wants to merge 1 commit into
pratikbuilds wants to merge 1 commit into
Conversation
ConversationMap hid only below two turns, so two short turns that fit the view still got a rail with nowhere to jump to. The engine now tracks whether the content is taller than the view on every resize, not counting the room `settle` reserves after a sent item, and the map renders only then. useConversation() exposes it as `overflowing`, and Conversation carries `data-overflowing`, so a host can give the column room for the rail only while it shows. Toggling that room cannot flicker: the padding makes the content taller when the map appears and shorter when it goes, which keeps each state. When the rail goes while a tick has focus, focus moves to the log, and a preview open then does not come back with the rail.
Contributor
|
Triage: Pass No changes needed from you. A maintainer will review this pull request. |
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
ConversationMapnow renders only while the conversation is taller than its view, so a short chat that fits on screen gets no rail with nowhere to jump to.contentOverflowsinlib/conversation-scroll.ts). The spacesettlereserves after a sent item does not count, so a fitting chat padded out by its reserve still fits. There is 1px of slack for subpixel rounding.useConversation()gainsoverflowing, andConversationcarriesdata-overflowingwhile the content overflows. A host can give the column room for the rail only then, e.g.[&[data-overflowing]_[data-slot=conversation-column]]:pl-12onConversation. Both are additive; nothing existing changes shape. Both arefalseon the server and while noConversationContentis mounted.FewTurnspane is resizable and pads its column ondata-overflowing, so it shows the map coming and going.Overlap with #145
#145 also moves focus and clears the preview when the map hides (for fewer than two turns). Both touch the same effects in
conversation-map.tsx. Whichever lands second needs a rebase; the behaviour is the same.Verification
bun run check(891 tests),bun run buildandbun run dep-guardpass.overflowingresetting when the log unmounts, and focus moving to the log when the rail goes.FewTurnsat 480px fits, with no map and 16px of padding. Shrunk to 160px it scrolls, and shows two ticks with 48px of padding. Grown back, both go again.ManyTurnskeeps its 150 ticks.Follow-up in Builder after a release: bump
@corbits/react-ui, and move the column padding fromdata-mappedontodata-overflowing(corbitsdev/corbits-builder#154).Closes #166