MCPcopy Create free account
hub / github.com/anomalyco/opencode / reviewDiffTop

Function reviewDiffTop

packages/app/src/pages/session.tsx:1165–1179  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

1163 }
1164
1165 const reviewDiffTop = (path: string) => {
1166 const root = tree.reviewScroll
1167 if (!root) return
1168
1169 const id = reviewDiffId(path)
1170 if (!id) return
1171
1172 const el = document.getElementById(id)
1173 if (!(el instanceof HTMLElement)) return
1174 if (!root.contains(el)) return
1175
1176 const a = el.getBoundingClientRect()
1177 const b = root.getBoundingClientRect()
1178 return a.top - b.top + root.scrollTop
1179 }
1180
1181 const scrollToReviewDiff = (path: string) => {
1182 const root = tree.reviewScroll

Callers 2

scrollToReviewDiffFunction · 0.85
attemptFunction · 0.85

Calls 1

reviewDiffIdFunction · 0.85

Tested by

no test coverage detected