Skip to content

Conversation

@sevillal
Copy link

@sevillal sevillal commented May 28, 2020

For #12033

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR).
  • Title summarizes what is changing.
  • Has a news entry file (remember to thank yourself!).
  • Appropriate comments and documentation strings in the code.
  • Has sufficient logging.
  • Has telemetry for enhancements.
  • Unit tests & system/integration tests are added/updated.
  • Test plan is updated as appropriate.
  • package-lock.json has been regenerated by running npm install (if dependencies have changed).
  • The wiki is updated with any design decisions/details.

@sevillal sevillal marked this pull request as ready for review May 28, 2020 23:01

// Load the web panel using our current directory as we don't expect to load any other files
super.loadWebPanel(process.cwd()).catch(traceError);
private static trimTitle(title: string): string {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd let the UI (VSCode or webview) handle long titles (I.e. I'd remove this).

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, it would be better for webview or VSCode to handle this.

Do you know how likely is to have long titles? I mention it because originally Data Viewer is trimming the titles, looking at the code and doing some testing removing this will show long names in the tabs (tested up to 200 chars), not sure if this could represent a regression for some users?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rchiodo @IanMatthewHuff @DavidKutu What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dataviewer name is based off the variable, right? Pretty sure we put this in as longer variable names could eat up like half of your tab real estate as VSCode didn't do anything to shorten them. Speaking for myself, I'd go for just letting the long names through. Let VSCode deal with it and don't have to own any custom trimming. The argument against is that customer are not picking variable names the same way they pick file names and might not be expecting to have so big of a tab.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this would be the right spot though in any case. Some consumers might want to trim, others might not. They should be in charge of passing in the right length title that they want. I would think that the viewer should just show it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IanMatthewHuff agree, I will remove the trimming from DataViewer and if the decision is to still trim titles we can do it from the client.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Speaking for myself, I'd go for just letting the long names through. Let VSCode deal with it and don't have to own any custom trimming.

Agreed.

// Fill in our variable's beginning data
this.variable = await this.prepVariable(variable, notebook);
// Load the web panel using our current directory as we don't expect to load any other files
await super.loadWebPanel(process.cwd()).catch(traceError);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we swallowing errors here. Not sure this is the right thing to do.
How about changing from process.cwd to dataExplorereDir, makes it future proof as well, if we wanted to load soemthing.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DonJayamanne great comments :) thanks

  1. Error swallowing: hmm I think it is because this call was done from the constructor, I moved here to make sure the webpanel is loaded before calling setTitle and show. I never realized the error swallowing though, will remove it.

  2. Directory: Good point, just wondering if there is another reason why it was done like that. @rchiodo @IanMatthewHuff any thoughts?

Copy link

@rchiodo rchiodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕐

request.variable,
this._notebook!
);
const title: string = `${localize.DataScience.dataExplorerTitle()} - ${request.variable.name}`;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to keep the title trimming in (my vote is no) this would be where we would want to do it I think.

Copy link
Member

@IanMatthewHuff IanMatthewHuff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sevillal A couple of cleanup items, but really good work with this :). Glad to see some code sharing between the teams, and I appreciate you walking us through the architecture before the PR, was much easier to review that way.

1. Do not trim title in DataViewer
2. More strucuted type to represent rows responses from IDataViewerDataProvider. Created IRowsResponse type {data: any[]}
3. Change createion of JupyterVariableDataProvider through a Factory Class
4. Fix initialization lock/flag in jupyterVariableDataProvider to ensure only one execution
5. showDataViewer API return void
6. Cache dataFrameInfo in DataViewer to prevent multiple fetches
7. Fix automotter change in reactSlickGrid.txt imports
8. Move IDataViewer and IDataViewerFactory to data-viewing/types
Copy link

@rchiodo rchiodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@IanMatthewHuff
Copy link
Member

@karthiknadig This is Sergio from our team, so removing external contributor tag. Wasn't sure if you recognized his github name.

Copy link

@rchiodo rchiodo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@karthiknadig
Copy link
Member

@sevillal I added the External Contributor on this by mistake.

@sevillal
Copy link
Author

sevillal commented Jun 1, 2020

@rchiodo I don't have write permission in this repo and I am unable to merge (or edit the PR).

I have asked for permission earlier today and waiting for it to be granted in order to merge :).

@rchiodo rchiodo added the no-changelog No news entry required label Jun 1, 2020
@rchiodo rchiodo merged commit 722d81b into microsoft:master Jun 1, 2020
@rchiodo
Copy link

rchiodo commented Jun 1, 2020

No problem. Merged :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog No news entry required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants