Skip to content
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

Merged
merged 3 commits into from
Feb 10, 2022
Merged

Fix StatusBar extension API #4838

merged 3 commits into from
Feb 10, 2022

Conversation

Nokel81
Copy link
Collaborator

@Nokel81 Nokel81 commented Feb 8, 2022

  • 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 base

Signed-off-by: Sebastian Malton [email protected]

- 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]>
@Nokel81 Nokel81 added bug Something isn't working area/extension Something to related to the extension api labels Feb 8, 2022
@Nokel81 Nokel81 added this to the 5.4.0 milestone Feb 8, 2022
@Nokel81 Nokel81 requested a review from a team as a code owner February 8, 2022 19:21
@Nokel81 Nokel81 requested review from jakolehm and jansav and removed request for a team February 8, 2022 19:21
Copy link
Contributor

@jim-docker jim-docker left a 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?

Comment on lines +20 to +42
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>
);

});
Copy link
Collaborator Author

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]>
jim-docker
jim-docker previously approved these changes Feb 9, 2022
Copy link
Contributor

@jim-docker jim-docker left a 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]>
@aleksfront
Copy link
Contributor

Fixed styling issues, @jim-docker ptal once more.
link with icon
status bar line

@jim-docker
Copy link
Contributor

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

@Nokel81 Nokel81 merged commit 8480b2a into master Feb 10, 2022
@Nokel81 Nokel81 deleted the fix/status-bar branch February 10, 2022 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/extension Something to related to the extension api bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants