-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Fix StatusBar extension API #4838
Conversation
- Make sure that items are still on right side if no items are registered on left side - Make more injectable Signed-off-by: Sebastian Malton <[email protected]>
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 this a refactor or did you just rename some files?
const NonInjectedStatusBar = observer(({ items }: Dependencies & StatusBarProps) => { | ||
const { left, right } = items.get(); | ||
|
||
return ( | ||
<div className={styles.StatusBar}> | ||
<div className={styles.leftSide}> | ||
{left.map((Item, index) => ( | ||
<div className={styles.item} key={index}> | ||
<Item /> | ||
</div> | ||
))} | ||
</div> | ||
<div className={styles.rightSide}> | ||
{right.map((Item, index) => ( | ||
<div className={styles.item} key={index}> | ||
<Item /> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
|
||
}); |
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.
@jim-docker I mostly just renamed some files, but the main part of the bug fix is here and in src/renderer/components/status-bar/registered-status-bar-items.injectable.tsx
.
The bug was occurring because the old implementation assumed that there was always going to be an item on the left hand side (the active hotbar name). However, that was removed in #4679 which caused this bug to be noticed.
The solution that I have done here is to actually separate the left and the right sides in the DOM (that is what the next div
's are for) and use CSS to spread out those. Instead of spreading out the items themselves.
Signed-off-by: Sebastian Malton <[email protected]>
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.
minor issue, may have pre-existed, the right-most item must fight for focus with the window-resize operation:
Screen.Recording.2022-02-09.at.12.18.28.PM.mov
this is on mac. On linux it is OK.
Signed-off-by: Alex Andreev <[email protected]>
Fixed styling issues, @jim-docker ptal once more. |
Were you trying to fix the minor issue I mentioned? It's still there but I don't think it is a big deal. Looks good otherwise |
Make sure that items are still on right side if no items are
registered on left side
Make more injectable
Switch the naming to
StatusBar
to be more consistent within the code baseSigned-off-by: Sebastian Malton [email protected]