-
Notifications
You must be signed in to change notification settings - Fork 297
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
Restyle data viewer and add slice data panel #4805
Conversation
Codecov Report
@@ Coverage Diff @@
## main #4805 +/- ##
======================================
+ Coverage 73% 76% +2%
======================================
Files 407 401 -6
Lines 26816 26583 -233
Branches 3874 3854 -20
======================================
+ Hits 19800 20306 +506
+ Misses 5411 4671 -740
- Partials 1605 1606 +1
|
…microsoft/vscode-jupyter into joyceerhl/fix-dataviewer-styles
…to joyceerhl/fix-dataviewer-styles
…to joyceerhl/fix-dataviewer-styles
Should probably give a courtesy heads up to the AML extension team that we're changing the dataset preview UI. |
…to joyceerhl/fix-dataviewer-styles
@@ -0,0 +1,656 @@ | |||
@font-face { |
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.
Did you copy this from somewhere? If so we need to add a license for it to the ThirdPartyRespository.txt
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.
It's the seti icons that VS Code ships. Needed this for the language icon in the breadcrumbs at the top of the data viewer. This is the one that VS Code has: https://github.com/microsoft/vscode/blob/main/extensions/theme-seti/ThirdPartyNotices.txt
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.
Do we add the license manually, or is there a component governance autogeneration step somewhere? And do we need to add it to both ThirdPartyNotices-Distribution as well as ThirdPartyNotices-Repository?
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.
Updated Repository notice and manually added this dependency to AzDO CG
@@ -1914,6 +1914,7 @@ | |||
}, | |||
"dependencies": { | |||
"@enonic/fnv-plus": "^1.3.0", | |||
"@fluentui/react": "^7.160.1", |
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.
Are you actually using this? I thought you dropped it?
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.
I tried to use this wherever I could, so yes I am using this in places where it was easier to reuse + override styles than it was to write my own.
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.
yay for using fluentui/react.... its awesome..
@@ -68,6 +68,8 @@ export interface IDataFrameInfo { | |||
maximumRowChunkSize?: number; | |||
type?: string; | |||
originalVariableType?: string; | |||
name?: string; | |||
fileName?: string; |
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.
Would be nice to have come comments. What's FileName
here?
The rest seem to make sense, as they are associated with a variable.
// Results should be the updated variable. | ||
return results | ||
? { | ||
...targetVariable, | ||
...JSON.parse(results.result), | ||
maximumRowChunkSize: MaximumRowChunkSizeForDebugger | ||
maximumRowChunkSize: MaximumRowChunkSizeForDebugger, | ||
fileName |
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.
Isn't this the name of the file where the frame is. Not sure fileName
is meaningful enough.
Initially i thought it could be the file path for a data frame (source where it was loaded from).
After looking at this code I now konw this is the file path from the frame.
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.
I.e. i'd consider re-naming the property (still not clear why we need this & why its associated with the variable - hopefully i'll see this being used later in the code).
@@ -233,6 +264,8 @@ export class MainPanel extends React.Component<IMainPanelProps, IMainPanelState> | |||
const indexColumn = variable.indexColumn ? variable.indexColumn : 'index'; | |||
const originalVariableType = this.state.originalVariableType ?? variable.type; | |||
const originalVariableShape = this.state.originalVariableShape ?? variable.shape; | |||
const variableName = this.state.variableName ?? variable.name; | |||
const fileName = this.state.fileName ?? variable.fileName; |
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.
Yeah, its weird for a variable to have a file name. I'd prefer this to be sent as a separate entity.
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.
Is it really that weird though? The variable must've been declared somewhere. I think it should definitely be renamed but it doesn't seem that weird to me to have backingFileName
or similar as an attribute associated with the variable info.
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.
It is weird, if you look at the debugger prototcol or others, variables are not attached to a file name. We have a file name that can contains a context & that context then contains a list of variables & that list contains the individual variable.
I.e. the mapping is at a much higher level & this seem wrong to me.
But don't want to block this PR for that.
I.e. the request object (sending request to kernel for variables) should already know the file name that is active.
Also if we're displaying variables for Notebooks, would we display the file name as some internal python file
or the name of the notebook? Today run by line works in webview, if we use run by line & display the variables, what do you see in the file name (breadcrumb)?
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.
Not worth blocking PR
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.
But i'd test this with run by line & the others, not sure the name of the file would be as expected/required. I.e. in notebooks I'd always expect to see the name of the notebook if anything.
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.
The request we send to the kernel doesn't ask for the filename. The filename property is only included on the variable at the point when we send the variable info to the UI for display.
For webview notebooks the file name is the name of the notebook, e.g.
. This is taken from notebook.identity.path
.
For RBL I initially went with debugLocation
because notebook.identity
is not available when debugging a Python file, but this doesn't work for RBL, the filename would've been '<ipython input>'. Changed debuggerVariables.ts to use the notebook.identity.path when it's available (which it is for Run By Line), and use the debugLocation when it's not (i.e. debugging a Python file). Good catch :)
@@ -3,11 +3,26 @@ | |||
'use strict'; | |||
|
|||
import * as React from 'react'; | |||
import { IIconProps, initializeIcons, SearchBox } from '@fluentui/react'; | |||
|
|||
initializeIcons(); |
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.
I thought this needs to be done one place, if thats the case then I'd move it to the entry point of our UI (so that we dont' have multiples of these)
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.
Moved to index.tsx, thanks!
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.
Everything looks ok, except for the fileName
, not sure it should be part of the variable entity.
If anything I'd try to create a separate object that contains those two such as or similarl/better...
type StackVariable = {
variabel: IDataVariable;
stackFileName: string;
}
…to joyceerhl/fix-dataviewer-styles
Made a couple more changes and fixes. Main difference is we are now generating a numeric (as opposed to guid) index column in the UI (as opposed to in our Python scripts) for all data, even if the data already contains an index column. This is to avoid breaking AML with the new filter button changes. AML preview datasets now look like this: |
For #305
package-lock.json
has been regenerated by runningnpm install
(if dependencies have changed).