forked from anomalyco/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add session bookmarking to group important sessions at the top #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
ariane-emory
wants to merge
24
commits into
dev
Choose a base branch
from
feat/session-bookmarks
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
- Add fallback to select most recently updated session when no active session exists - Merge search results with live session data to show bookmark changes immediately while filtering - Fixes issue where bookmarked session was selected by default instead of most recent activity - Fixes issue where bookmarked sessions didn't move between groups while filtering
- Store last_session_id in local KV store when using /new or session.new command - Use last_session_id as default selection when opening session list from home - Allows easily returning to the previous session by pressing Enter - Per-instance tracking prevents interference between multiple OpenCode instances - Falls back to most recently updated session if last_session_id is not found
Hook cannot be called inside onSelect callback. Use kv from component scope.
- Add scrollToValue(value) method to DialogSelectRef that finds the value's index and scrolls to it - Change initial current effect to use moveTo() for proper viewport scrolling - Call scrollToValue() after bookmark toggle to follow the session to its new position
- Use moveTo() instead of setStore() + scrollTo(0) in filter/current effect - moveTo() properly scrolls to the selected item's position - Remove redundant effect that only handled props.current
The scroll component wasn't ready when the effect first ran, causing moveTo() to return early. Using setTimeout(0) defers the scroll until after the component has rendered.
…kmark - Add 'center' parameter to moveTo() function - Pass center=true from effect (dialog open) and scrollToValue (bookmark toggle) - Keyboard navigation still uses edge-scroll behavior for smooth UX
ca4373c to
059ca29
Compare
Keep centering fix separate in fix/center-selected-session branch. This branch now only contains bookmark-specific changes.
- Add getEphemeral/setEphemeral methods to KV context for in-memory storage - Change app.tsx to use setEphemeral for last_session_id - Change dialog-session-list to use getEphemeral for last_session_id - Ephemeral storage is per-process, not persisted to disk - This ensures each opencode process has its own last_session_id - After program restart, the topmost session is selected
Resolved merge conflict by keeping both session-related routes from HEAD and command/log/agent routes from dev branch
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.
Resolves #101.