-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to hide chosen columns in diagnostics panel #159
Conversation
Cool! Maybe on this PR: This is definitely something that we would start to want to save in the settings. I guess the schema could be like:
Hiding a column would remove it from the list, showing would put it back. In the future, they could even be reorderable. It's helpful to have a lenient schema... what if we discover new columns that need adding later? Probably on this PR: A nit on the UI: multi-level menus only triggerable by right-click are a discoverability/accessibility nightmare... you've already built something, so keep it there, for sure! But perhaps as a lead-in to stuff down the road, have a small Not on this PR: Each row could eventually have a The header-level button might then eventually reveal something like:
|
Also, it might be beneficial to make a review of existing practices in other editors so that we know what the users expect. Another quick thought: if we were to use three dots, what about the vertical arrangement (⋮) if these were to be placed in each row? |
@bollwyvl I am not sure about the yarn lock file, if the way the new dependency ((still) @phosphor/menu) got addedd looks strange to you feel free to correct me and teach how to do it better |
@@ -185,82 +277,58 @@ export class DiagnosticsListing extends VDomRenderer<DiagnosticsListing.Model> { | |||
data: diagnostic_data, | |||
key: virtual_document.uri + ',' + i, | |||
document: virtual_document, | |||
cell_nr: cell_nr | |||
cell_nr: cell_nr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's an nr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A leftover of my native language ;) number. Will expand the abbreviation.
|
||
return ( | ||
<table className={'lsp-diagnostics-listing'}> | ||
<table className={DIAGNOSTICS_LISTING_CLASS}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. I'm a big fan of squooshing all of them into a single file someplace, e.g. css.ts
rather than strewing them all over the place.
Right. But trying to keep configurability in mind can save headaches down the line.
For the reasons mentioned elsewhere, more vertical height usually is a bummer. If it grows to a lot of things that need lots of explanation, perhaps. For example, if there was a filter box that let you add
If we're talking one button that reveals one flat menu, I'll take 24px of horizontal off vs 24px off vertical any day.
I think for complex sortable/filterable table, it's reasonable to have an escape hatch that lets you hide "table junk" until a user is ready for more complexity.
Incoming...
Ooh, look at that unicode. Good one. But yeah, that or something. I think people are pretty well trained at this point.
If you add new deps, and also since a release recently went out, it's fine. Since a release recently went out, and you're changing something, it would be fine to rebuild it. |
Agreed, my "waste of space comment" was about my previous idea of having multiple buttons, your proposal is totally fine! I will still advocate the use of toolbar for coherence with other widgets in the JupyterLab, but I see a very important use case for #160 - if we decide to allow to dock the diagnostics listing in a sidebar panel then we might want not to have the toolbar and here it is a big advantage to have it as proposed. PS. I am going to work on improving the completion now (a few hours this week and even more next week), also maybe "quick-fix" feature as those seem more urgent right now. |
Allows choosing which columns to display/hide in the diagnostic panel, using a context menu action.
References
Closes #149
Code changes
Greatly simplifies the
DiagnosticListing.render()
function body by moving the column-specific code to a newly createdColumn
class (not exported). A new interfaceIListingContext
facilitates this transition.User-facing changes
Backwards-incompatible changes
None.
Chores