fix(app): on cancel comment unhighlight lines (#14103)

This commit is contained in:
Filip
2026-02-24 15:55:17 +01:00
committed by GitHub
parent 0d0d0578eb
commit c6d8e7624d

View File

@@ -371,6 +371,12 @@ export function FileTabContent(props: { tab: string }) {
}) })
} }
const cancelCommenting = () => {
const p = path()
if (p) file.setSelectedLines(p, null)
setNote("commenting", null)
}
createEffect( createEffect(
on( on(
() => state()?.loaded, () => state()?.loaded,
@@ -484,7 +490,7 @@ export function FileTabContent(props: { tab: string }) {
value={note.draft} value={note.draft}
selection={formatCommentLabel(range())} selection={formatCommentLabel(range())}
onInput={(value) => setNote("draft", value)} onInput={(value) => setNote("draft", value)}
onCancel={() => setCommenting(null)} onCancel={cancelCommenting}
onSubmit={(value) => { onSubmit={(value) => {
const p = path() const p = path()
if (!p) return if (!p) return
@@ -498,7 +504,7 @@ export function FileTabContent(props: { tab: string }) {
setTimeout(() => { setTimeout(() => {
if (!document.activeElement || !current.contains(document.activeElement)) { if (!document.activeElement || !current.contains(document.activeElement)) {
setCommenting(null) cancelCommenting()
} }
}, 0) }, 0)
}} }}