runbox7 icon indicating copy to clipboard operation
runbox7 copied to clipboard

refactor(list): Detangle canvastable, messagedisplay, virtualtable

Open castaway opened this issue 5 months ago • 1 comments

An initial start on blending the new messagelist via virtual table, into the existing MessageDisplay based "whats displayed" management:

  • The MessageDisplay object is now held by the main app object (as canvastable.ts should be considered deprecated)
  • MessageDisplay now stores the current state of the column sort/ order variables
  • MessageDisplay has all copies of the "rows" (we do seem to have rather a lot of row list copies somehow) - ideally displayRows would be the content that actually goes onto the page, eg [items]=messagedisplay.displayRows in the template, however I am not yet understanding the purpose of the rowsSubject (another copy?) not the debouncedRows$ which isn't referenced anywhere?
  • enrichRow created/moved into the MessageDisplay
  • Re-introduces the bulk-download, using the renderedRange change to fetch the content of the scrolled-to messages if not previously fetched
  • renderedRange code, since it already fetches the messagecontents, assigns the text to the plaintext field and calls enrichRow to assign it
  • updateRows/enrichRows - the former is gone, the latter now only exists to manage the initial load of rows, ideally it should all be handled by renderedRange updates

Still Todo/Understand:

  • changed canvastable.rows.removeMessages calls to messagedisplay.removeMessages, but - how to actually update what is displayed in the list?
  • Ditto singleMailViewerClosed / clearOpenedRow - the MessageDisplay can manage the row, how to attach this to the models the virtualtable uses?
  • app.rowSelected + models for message selection/filtering etc should, imo, also live in the MessageDisplay class
  • Saving of column widths into preferences
  • Updating column widths when window is resized (proportionally)
  • Column style / naming management (the row data should contain "from" and "to" fields, it querying the app.selectedFolder to change its content is.... ugly)

Errors/Issues:

  • renderedRange - somehow I had to change the default start/end to 0,10 (from 0,0), and now its not filling out the rest of the available height with more data - where is that triggered?

castaway avatar Jul 24 '25 10:07 castaway

@castaway , the issue you are experiencing is likely due to the early return. In the virtual table we @Output events whenever the render range changes. Only the virtual scroll knows this and we pass it as an event to the component that manages the fetching of state which in our case is the app.component.ts.

https://github.com/runbox/runbox7/blob/shadowbas/feat-accessible-table/src/app/app.component.ts#L1499

EDIT: Another possibility is that between the renderRangeChange event and the rowsSubject emit we do not manage the state correctly or stop somewhere in that flow.

shadowbas avatar Jul 28 '25 09:07 shadowbas