-
Notifications
You must be signed in to change notification settings - Fork 1
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
Use element home screen to create new chats by default #38
Conversation
…e. remove submenu dropdown and replace it with onClick function making use of elements home screen. add css rules to make modal view from element usable on mobile
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.
Quick question before going into details of the code changes: Can we not make this happen with CSS media queries only?
Detecting the device type with JS is something we never did in any previous React applicatio (and I have a feeling that we never should do), when we have the option to change things with CSS only.
pages/chat/[[...roomId]].js
Outdated
) } | ||
|
||
{ (deviceType !== 'mobile' || (deviceType === 'mobile' && roomId) || (deviceType === 'mobile' && !isRoomListVisible)) && <IframeLayout.IframeWrapper> | ||
<IframeLayout.IframeHeader> |
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.
…. Add loading spinner while iframe is loading to prevent displaying nothing in the iframe view for a long time
…ded, rename function
…lick parsed. fix logic of loading spinner
12059c3
to
c15679f
Compare
chore: display chats in service tables
…unt instead of debug value
# Conflicts: # lib/auth/MatrixAuthProvider.js # pages/chat/[[...roomId]].js
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.
@aofn There are a few things that I can use your help on. I've left comments on the diff.
* @returns {Promise<Object>} A promise that resolves to the created room or space. | ||
* @throws {Error} If there was an error creating the room or space. | ||
*/ | ||
async createRoom(name, isSpace, topic, joinRule, type, template, parentId) { | ||
async createRoom(name, isSpace, topic, joinRule, type, template, parentId, application, visibility, historyVisible, encrypted) { |
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.
Where are we making use of any of these new parameters?
If we don't use them, let's not add them.
I guess this is a leftover from some previous concepts?
@@ -169,7 +180,8 @@ class MatrixAuthProvider { | |||
const medienhausMetaEvent = { | |||
type: type, | |||
template: template, | |||
version: '0.4', | |||
application: application, |
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.
What's the difference between template
and application
?
At the same time, like I said above: I think we don't actually make use of this new "application" parameter anywhere. So let's remove it again?
<ServiceTable> | ||
<ServiceTable.Body> | ||
{ otherRooms && otherRooms.map((room) => { | ||
return <ServiceTable key={room.roomId}><SidebarListEntry key={room.roomId} room={room} selected={room.roomId === roomId} /></ServiceTable>; |
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.
<DefaultLayout.IframeHeaderButtonWrapper> | ||
{ roomId && <> | ||
<CopyToClipboard text={roomId} /> | ||
<TextButton title={t('Leave room and remove from my library')} onClick={() => handleLeave(roomId)}> |
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.
- Missing translation
- One does not really remove a chat from a library, or? This sounds off to me...
The style hack is needed because setting 'display' to 'none' creates an error. | ||
Element performs a few compatability checks before onLoaded fires. | ||
Therefore, Element throws an error, saying the current browser is not supported. | ||
Setting the height to 0px centers the loading spinner before the iframe is ready. |
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.
hm not sure why the loading spinner didn't show up for you.
Generally I think we really need to show a loading spinner before the iframe is ready. It just feels like a bug sometimes, otherwise.
I've opened an issue for this in the meantime #119
.mx_Dialog_fixedWidth { width: 100% } | ||
.mx_Dropdown_menu { max-width: 100% } | ||
|
||
#mx_JoinRuleDropdown__public { display: none } |
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.
Let's add comments to each of these lines on what they intend to do.
This is especially helpful for later; we do not control if/how/when Element changes their markup. So we might need to make adjustments to all of these CSS rules whenever we update Element. Therefore it's important to remember everything these lines intend to do, so one can later double-check if they still do what they are supposed to do.
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.
Also, if the intention of this specific line is to disallow creating public rooms: Why is it inside a @media ${breakpoints.phoneOnly} {
? Do we only want to disallow creating public rooms on smartphones? If so, why?
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.
|
||
/* More breathing room in the main timeline of a chat */ | ||
.mx_RoomView_timeline_rr_enabled .mx_EventTile[data-layout=group] .mx_EventTile_line, |
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.
Why did you remove these?
Alright, I've basically re-implemented the same feature within a few lines of code over in #115. But maybe it might be easier to close this PR and start from |
This was discussed in #38 (comment)
Closing this; all handled... what I commented on in my last remark was done in 921d60f |
Displays elements home screen by default on desktop browsers and allows toggling on mobile view.
Allowing users to create DM's and group chats.