-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
core: make sidebar resizable #5219
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* Copyright 2021 The TensorFlow Authors. All Rights Reserved. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
==============================================================================*/ | ||
|
||
export {sideBarWidthChanged} from './actions'; | ||
export {LayoutModule} from './views/layout_module'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,8 @@ export interface CoreState { | |
// For now, we want them here for Polymer interop states reasons, too. | ||
polymerInteropRuns: Run[]; | ||
polymerInteropRunSelection: Set<RunId>; | ||
// Number between 0 and 100. | ||
sideBarWidthInPercent: number; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I originally expected to see the value stored under metrics/, since it is specific to Time Series UI. Having it under core/ makes sense when under the assumption that there will not be other resizable layouts. Would it be better to move this field, the reducer, selector, etc to metrics/ as "(get)metricsRunSidebarWidth", if we want other features besides metrics/ to have persisted sidebar widths? e.g. maybe the Hparams dashboard remembers its own sidebar width separately in the future. If not, could we at least add comments to here and in the selector definition that mention it is specific to Time Series' run sidebar? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This component is expected to be used by other plugins as the description indicates. For instance, I want this to be usable in npmi plugin which I have in a follow up change. I think it makes sense for all sidebar widths to be linked thus this state remains in the Core plugin. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for clarifying, I see where this is going now. This setting and the tb-layout component isn't to be used to make any resizable sidebar, (e.g. not to be used for cases like the Time Series settings pane), but specifically only for replacing the top-level layout for each plugin dashboard. |
||
} | ||
|
||
/* | ||
|
@@ -97,4 +99,5 @@ export const initialState: CoreState = { | |
}, | ||
polymerInteropRuns: [], | ||
polymerInteropRunSelection: new Set(), | ||
sideBarWidthInPercent: 30, | ||
}; |
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.
If we plan to ever have another resizable layout in the UI later on, which also needs its width persisted, it would be reasonable to separately store their widths. To prevent future ambiguity as to which sidebar this setting refers to, would it reasonable to name this property something specific like
metricsRunSidebarWidth
?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 think my comment below makes this obsolete.