Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/app/src/pages/session/file-tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createEffect, createMemo, Match, on, onCleanup, Switch } from "solid-js"
import { createStore } from "solid-js/store"
import { Dynamic } from "solid-js/web"
import { createMediaQuery } from "@solid-primitives/media"
import type { FileSearchHandle } from "@opencode-ai/ui/file"
import { useFileComponent } from "@opencode-ai/ui/context/file"
import { cloneSelectedLineRange, previewSelectedLines } from "@opencode-ai/ui/pierre/selection-bridge"
Expand Down Expand Up @@ -56,6 +57,7 @@ export function FileTabContent(props: { tab: string }) {
const file = useFile()
const comments = useComments()
const language = useLanguage()
const touch = createMediaQuery("(hover: none), (pointer: coarse)")
const prompt = usePrompt()
const fileComponent = useFileComponent()
const { sessionKey, tabs, view } = useSessionLayout()
Expand Down Expand Up @@ -398,20 +400,24 @@ export function FileTabContent(props: { tab: string }) {
cacheKey: cacheKey(),
}}
enableLineSelection
enableHoverUtility
enableHoverUtility={!touch()}
selectedLines={activeSelection()}
commentedLines={commentedLines()}
onRendered={() => {
queueRestore()
}}
annotations={commentsUi.annotations()}
renderAnnotation={commentsUi.renderAnnotation}
renderHoverUtility={commentsUi.renderHoverUtility}
renderHoverUtility={touch() ? undefined : commentsUi.renderHoverUtility}
onLineSelected={(range: SelectedLineRange | null) => {
commentsUi.onLineSelected(range)
}}
onLineNumberSelectionEnd={commentsUi.onLineNumberSelectionEnd}
onLineSelectionEnd={(range: SelectedLineRange | null) => {
if (touch() && range) {
commentsUi.onLineNumberSelectionEnd(range)
return
}
commentsUi.onLineSelectionEnd(range)
}}
search={search}
Expand Down
Loading