-
Notifications
You must be signed in to change notification settings - Fork 94
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
Feature/multiple sessions tab view #6373
Conversation
E2E Tests 🚀 |
width: 100%; | ||
} | ||
|
||
.positron-console .console-tab-list { |
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 flex properties should only be applied when the feature flag is on. This css class is conditionally applied if the feature flag is on.
</div> | ||
} | ||
</ActionBarRegion> | ||
{!multiSessionsEnabled && |
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.
We no longer need to show this menu button since the console tab list does the same thing.
@@ -46,6 +61,37 @@ export const ConsoleCore = (props: ConsoleCoreProps) => { | |||
return () => disposables.dispose(); | |||
}); | |||
|
|||
// Console Width Effect | |||
useEffect(() => { |
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.
This useEffect's only purpose is to set the initial width for the console pane/console tab list as well as handle resizing the console pane/console tab list when the parent container width changes.
The tricky bit of additional work that needs to be handled here is gracefully resizing the console pane and console tab list when the overall width of the container changes because a user increased the width of the secondary side bar (where the variables/plots panes live).
I had some gnarlier logic in this useEffect to try and resolve that but couldn't get it working in all scenarios. I'm keeping this useEffect simple for now and am tracking this as polish work in the epic that can be revisited after the core functionality is in.
@softwarenerd This may be a great task to pair on as follow up since you've dealt with these issues before!
readonly positronConsoleInstance: IPositronConsoleInstance; | ||
} | ||
|
||
export const ConsoleInstanceState = ({ positronConsoleInstance }: ConsoleInstanceStateProps) => { |
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.
This component just renders the icon that maps to the state the session is in. Instead of relying on the session's runtime state value, I am using the state value from the console instance we create. The console instance's state is almost a 1-to-1 map and is probably more relevant to the user than just the session state.
I can imagine if the console is busy and blocks interaction for some reason, we may want to indicate that with this icon.
That being said, if this seems wrong and we think that we should be showing the runtime session state, I can change this pretty easily!
<img | ||
className='icon' | ||
src={`data:image/svg+xml;base64,${positronConsoleInstance.session.runtimeMetadata.base64EncodedIconSvg}`} | ||
/> |
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 mockup has us rendering a grayscale version of the icon but I didn't feel inclined to make an icon mapping to languages when we have access to the runtime language icon.
2663aef
to
91933a8
Compare
I've started adding a test to cover much of this new functionality. However, I've run into a couple issues:
|
hcDark: '#2eb77c', | ||
hcLight: '#2eb77c' | ||
}, localize('positronConsole.stateIconIdle', "Positron console idle state icon color.")); | ||
|
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'm a little worried about hard-coded colors when it comes to strange themes that a user might use.
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 completely agree! We will probably need to change these colors and do something more reasonable but for now I figured this would be okay. I have added a note in my clean up list on the epic to revisit this.
I am open to changing this but I couldn't find any existing vs code vars to lean on 😢
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.
Overall looks good! Tested and works flawlessly with my changes to the interpreter dropdown.
|
||
// Initialize the width for the console pane and console tab list if it hasn't been | ||
if (consoleWidth === 0) { | ||
setConsoleTabListWidth(MAXIMUM_CONSOLE_TAB_LIST_WIDTH) |
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.
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 am using 2/5ths as the default to match the look and feel of the Terminal tab list!
We could make the default tab list size smaller by default, maybe 1/5 if we feel strongly about it?
I'm not inclined to add breakpoints to Positron since all of the panes and sidebars can be resized by the user - the value of adding breakpoints is pretty low with resizing as an option.
I think @softwarenerd mentioned that we could store the window size and pane/sidebar sizes the user has set so that Positron loads up with those layout configurations. That would be the way to go, but we haven't added that yet.
Description
Addresses #6160
This change introduces the new console tab list view in the console pane behind the
positron.mulitpleConsoleSessions
feature flag. The console tab list follows the tab list pattern for accessibility: https://www.w3.org/WAI/ARIA/apg/patterns/tabs/examples/tabs-automatic/This issue does not address #6199 which is related since the console tab list can be resized. The console tab list resizing behavior can definitely use some improvement but can be tackled as polish.
Release Notes
New Features
Bug Fixes
QA Notes
Please see testing notes under #6160
Screenshots
Resize Console Pane
Screen.Recording.2025-02-18.at.8.31.34.PM.mov
Switch Sessions
Screen.Recording.2025-02-14.at.4.21.01.PM.mov