Browse Source

Added big dot (●) indicator for current session in modal (#3980)

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <[email protected]>
Co-authored-by: Aiden Cline <[email protected]>
opencode-agent[bot] 3 months ago
parent
commit
49e4cfb286

+ 5 - 0
packages/opencode/src/cli/cmd/tui/component/dialog-session-list.tsx

@@ -20,6 +20,10 @@ export function DialogSessionList() {
 
   const deleteKeybind = "ctrl+d"
 
+  const currentSessionID = createMemo(() => 
+    route.data.type === "session" ? route.data.sessionID : undefined
+  )
+
   const options = createMemo(() => {
     const today = new Date().toDateString()
     return sync.data.session
@@ -50,6 +54,7 @@ export function DialogSessionList() {
       title="Sessions"
       options={options()}
       limit={50}
+      current={currentSessionID()}
       onMove={() => {
         setToDelete(undefined)
       }}

+ 5 - 0
packages/opencode/src/cli/cmd/tui/ui/dialog-select.tsx

@@ -273,6 +273,11 @@ function Option(props: {
   const { theme } = useTheme()
   return (
     <>
+      <Show when={props.current && !props.active}>
+        <text flexShrink={0} fg={theme.primary} marginRight={0.5}>
+          ●
+        </text>
+      </Show>
       <text
         flexGrow={1}
         fg={props.active ? theme.background : props.current ? theme.primary : theme.text}