Github user squito commented on a diff in the pull request:

    https://github.com/apache/spark/pull/7910#discussion_r43515521
  
    --- Diff: core/src/main/resources/org/apache/spark/ui/static/table.js ---
    @@ -30,3 +30,75 @@ function stripeSummaryTable() {
            }
         });
     }
    +
    +function toggleThreadStackTrace(threadId, forceAdd) {
    +    var stackTrace = $("#" + threadId + "_stacktrace")
    +    if (stackTrace.length == 0) {
    +        var stackTraceText = $('#' + threadId + "_td_stacktrace").html()
    +        var threadCell = $("#thread_" + threadId + "_tr")
    +        threadCell.after("<tr id=\"" + threadId +"_stacktrace\" 
class=\"accordion-body\"><td colspan=\"3\"><pre>" +
    +            stackTraceText +  "</pre></td></tr>")
    +    } else {
    +        if (!forceAdd) {
    +            stackTrace.remove()
    +        }
    +    }
    +}
    +
    +// expandOrCollapse - true: expand, false: collapse
    +function expandOrCollapseAllThreadStackTrace(expandOrCollapse, 
toggleButton) {
    --- End diff --
    
    so I am totally unqualified to be judging javascript code, so feel free to 
reject this suggestion -- but to me it kinda seems like this really two 
different functions based on `expandOrCollapse`.  The callsite always 
statically knows the value of that param, so it doesn't help to put them 
together.  Might be cleaner to separate them out?  Also it seems like its never 
called with `true, false`, so then you could eliminate that option.
    
    (But again, totally up to your judgement, I have an incomplete 
understanding of what is going on here ...)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to