Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Hide RoomStatusBar when it displays nothing #615

Merged
merged 9 commits into from
Jan 23, 2017

Conversation

lukebarnard1
Copy link
Contributor

@lukebarnard1 lukebarnard1 commented Jan 13, 2017

Notify RoomView of when RoomStatusBar has a size of '0' or not '0' via onHidden and onVisible props.

Should fix element-hq/element-web#1991 ?

Luke Barnard and others added 2 commits January 13, 2017 16:46
Notify RoomView of when RoomStatusBar has a size of '0' or not '0' via onHidden and onVisible props.
@lukebarnard1
Copy link
Contributor Author

lukebarnard1 commented Jan 18, 2017

  • This needs animation and debounce added to prevent jittering timeline
  • Bug: StatusBar is expanded when you swap to a new room

Animation can be done entirely with CSS, debouncing is now done onHidden, which has been set to 2000ms. This will keep the status bar displayed for at most 2000ms before it becomes unexpanded.
@@ -1667,6 +1683,13 @@ module.exports = React.createClass({
</div>
);
}
let statusBarAreaClass = "mx_RoomView_statusArea mx_fadable mx_max_height_animated mx_margin_top_animated";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mx_max_height_animated and mx_margin_top_animated are not needed..

@@ -20,6 +20,8 @@ var dis = require("../../dispatcher");
var WhoIsTyping = require("../../WhoIsTyping");
var MatrixClientPeg = require("../../MatrixClientPeg");

const HIDE_DEBOUNCE_MS = 2000;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd guess we want to wait at least 10s before the statusbar gets bored and hides itself again, but will have a play with it first...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming that 2s felt ok then?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it felt way too short to me - kept yoyoing like crazy. Suggest 10s.

// indicate other sizes.
_getSize: function(state, props) {
if (state.syncState === "ERROR" || state.whoisTypingString) {
return 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whilst we're at it, can we get rid of these confusing numeric literals and use constants, just to make it clear we're using them as flags and they don't have numeric significance (e.g. ordering or dimensionality)? Unless i'm misunderstanding what @richvdh was aiming for here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well they're kind-of dimensional, but in a topological way... So it's an ordering on size but not proportional to size.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup what @lukebarnard1 said. Could still use constants, though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Constants it is!

@ara4n
Copy link
Member

ara4n commented Jan 18, 2017

lgtm, other than the "not resetting when changing room" thing.

@ara4n
Copy link
Member

ara4n commented Jan 20, 2017

lgtm other than timing tweak

@lukebarnard1 lukebarnard1 merged commit a06ecb8 into develop Jan 23, 2017
@lukebarnard1 lukebarnard1 deleted the luke/feature-hide-empty-status-bar branch January 23, 2017 15:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New Status Bar behaviour (hide status bar by default)
3 participants