You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "FrankChen021 (via GitHub)" <gi...@apache.org> on 2026/10/15 10:33:25 UTC

[I] Web console: line numbers on sub-query run markers repeat after each edit (druid)

FrankChen021 opened a new issue, #20605:
URL: https://github.com/apache/druid/issues/20605

   ### Affected Version
   
   master, since #20507.
   
   ### Description
   
   In the workbench SQL editor, the line number of a line that has (or had) a sub-query "run" marker repeats its digits after each edit. For example, line 6 shows `6666666` and line 14 shows `1414`.
   
   ![Duplicated line numbers in the workbench editor](https://github.com/FrankChen021/druid/blob/issue-assets/issue-assets/codemirror-gutter-duplicated-line-numbers.png?raw=true)
   
   To reproduce: in the workbench, write a few queries separated by blank lines so they get "run" markers, then keep typing. The numbers on the marker lines grow by one copy per edit. Lines that never had a marker are not affected.
   
   #### Cause
   
   `SubQueryMarker.toDOM()` in `web-console/src/views/workbench-view/flexible-query-input/sub-query-markers.ts` returns a `DocumentFragment` with two nodes, the run button and the line number text:
   
   ```ts
   const fragment = document.createDocumentFragment();
   fragment.append(button, String(this.lineNumber));
   return fragment;
   ```
   
   CodeMirror assumes one DOM node per gutter marker: when it replaces a marker, `GutterElement.setMarkers` removes only the first node (`domPos.remove()`). The run button is removed, but the old number text node stays. The `subQueries` state field rebuilds the markers on every document change, so a marker line gains one more copy of its number with each edit.
   
   #### Suggested fix
   
   Return a single element, so CodeMirror removes the number with the button:
   
   ```ts
   const element = document.createElement('span');
   element.append(button, String(this.lineNumber));
   return element;
   ```
   
   @vogievetsky, this came in with #20507. Could you take a look?
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [I] Web console: line numbers on sub-query run markers repeat after each edit (druid)

Posted by "rishi-rana (via GitHub)" <gi...@apache.org>.
rishi-rana commented on issue #20605:
URL: https://github.com/apache/druid/issues/20605#issuecomment-6354793150

   I'd like to pick this up — the suggested fix in the issue (return a single element from `SubQueryMarker.toDOM()` instead of a `DocumentFragment`) matches the CodeMirror behavior described. Will open a PR shortly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org