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

Function useAnnotationRerender

packages/session-ui/src/components/file.tsx:454–467  ·  view source on GitHub ↗
(opts: {
  viewer: Viewer
  current: () => AnnotationTarget<A> | undefined
  annotations: () => A[]
})

Source from the content-addressed store, hash-verified

452}
453
454function useAnnotationRerender<A>(opts: {
455 viewer: Viewer
456 current: () => AnnotationTarget<A> | undefined
457 annotations: () => A[]
458}) {
459 createEffect(() => {
460 opts.viewer.rendered()
461 const active = opts.current()
462 if (!active) return
463 active.setLineAnnotations(opts.annotations())
464 active.rerender()
465 requestAnimationFrame(() => opts.viewer.find.refresh({ reset: true }))
466 })
467}
468
469function notifyRendered(opts: {
470 viewer: Viewer

Callers 2

TextViewerFunction · 0.85
DiffViewerFunction · 0.85

Calls 2

refreshMethod · 0.80
currentMethod · 0.45

Tested by

no test coverage detected