Skip to content

Commit 27000b8

Browse files
committed
comment: Record example reasons for not redrawing...
to help with future testing and debugging.
1 parent f874ecb commit 27000b8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Renderer/QueryRenderer.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,22 @@ class QueryRenderChild extends MarkdownRenderChild {
260260
// that we get correct values for isConnected and isShown().
261261
// (setTimeout(, 0) seemed to work too...)
262262
if (!this.containerEl.isConnected) {
263+
// Example reasons why we might not be "connected":
264+
// - This Tasks query block is contained with within another plugin's code block,
265+
// such as a Tabs plugin. The file is closed and that plugin has not correctly
266+
// tidied up, so we have not been deleted.
263267
this.queryResultsRenderer.query.debug(
264268
'[render] QueryRenderChild.render() Ignoring redraw request, as code block is not connected.',
265269
);
266270
return;
267271
}
268272

269273
if (!this.containerEl.isShown()) {
274+
// Example reasons why we might not be "shown":
275+
// - We are in a collapsed callout.
276+
// - We are in a note which is obscured by another note.
277+
// - We are in a Tabs plugin, in a tab which is not at the front.
278+
// - The user has not yet scrolled to this code block's position in the file.
270279
this.queryResultsRenderer.query.debug(
271280
'[render] QueryRenderChild.render() Ignoring redraw request, as code block is not shown.',
272281
);

0 commit comments

Comments
 (0)