substance / archivist-composer

A composer for interviews, used by the archivist project
MIT License
2 stars 0 forks source link

Scrollbar only updates when changes are propagated through writer state change #28

Closed michael closed 9 years ago

michael commented 9 years ago

but not when doc updates.. e.g. when you split or join an entity reference.. it doesn't get reflected at scrollbar.

is it legitimate to bind to document:changed events in content_panel?

michael commented 9 years ago

just tried: but this only half-works. problem is that scrollbar is paramatrized with array of highlighted nodes:

  $$(Scrollbar, {
    id: "content-scrollbar",
    contextId: writerCtrl.getState().contextId,
    highlights: writerCtrl.getHighlightedNodes(),
    ref: "scrollbar"
  }),

however this only gets affected on a real doc state change. i could only pass the function writerCtrl.getHighlightedNodes instead of its results, but then the scrollbar is no longer a writer-independent thing.

michael commented 9 years ago

Mhh.. i think it's ok here to provide a function. However again the problematic of two different invalidation scenarios is striking us:

state change propagations vs. local document change causing a rerender.