-
-
Notifications
You must be signed in to change notification settings - Fork 830
Hide RoomStatusBar when it displays nothing #615
Conversation
Notify RoomView of when RoomStatusBar has a size of '0' or not '0' via onHidden and onVisible props.
|
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"; |
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.
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; |
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'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...
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 assuming that 2s felt ok then?
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.
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; |
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.
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?
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.
Well they're kind-of dimensional, but in a topological way... So it's an ordering on size but not proportional to size.
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.
yup what @lukebarnard1 said. Could still use constants, though.
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.
Constants it is!
lgtm, other than the "not resetting when changing room" thing. |
lgtm other than timing tweak |
Conflicts: src/components/structures/RoomView.js
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 ?