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

Only show core navigation elements (call/chat/notification/info) when a widget is maximised #7114

Merged
merged 95 commits into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
0a6c20c
add maximise widget functionality
toger5 Nov 8, 2021
a9a2c41
fix linter issues
toger5 Nov 8, 2021
cb4ae5f
fix style lint issues
toger5 Nov 8, 2021
e68c8f1
Update src/components/structures/RoomView.tsx
toger5 Nov 9, 2021
8608c59
fix typo
toger5 Nov 9, 2021
bb543a2
typo
toger5 Nov 9, 2021
4cc316d
Remove caps "AND "
toger5 Nov 10, 2021
4a3b48d
fix spelling
toger5 Nov 10, 2021
5d14783
improove readibility for continue in for
toger5 Nov 10, 2021
74f9b93
review fixes
toger5 Nov 10, 2021
cfbdf40
reuse already added icons
toger5 Nov 10, 2021
ffb0af8
more container comment fixes
toger5 Nov 10, 2021
1155ae9
fix app options button
toger5 Nov 10, 2021
cd9d193
remove error message
toger5 Nov 10, 2021
a76e7ec
fix issue not beeing able to maximise
toger5 Nov 10, 2021
04e0b42
remove maxmimisedDrawer
toger5 Nov 10, 2021
21b9549
fix centering and overflow of appDrawer
toger5 Nov 10, 2021
38f8cfe
fix hover label "Minimise widget"->"Close"
toger5 Nov 11, 2021
4aa18f7
right panel chat timeline
toger5 Nov 10, 2021
0df2b82
automatically switch to TimelineCard on maximise
toger5 Nov 10, 2021
bddb05f
fix style and compile errors
toger5 Nov 10, 2021
2ffd836
fix highlighting and labels
toger5 Nov 11, 2021
c3a6409
rename timelinePanel-> timelineCard
toger5 Nov 11, 2021
6fb6e6d
simplify previous phase access
toger5 Nov 11, 2021
98adc21
close right panel chat if no widget is maximised
toger5 Nov 11, 2021
7d8879f
fix linter
toger5 Nov 11, 2021
1fac898
only show core elements if a widget is maximised
toger5 Nov 11, 2021
1bff7f0
hide timeline card button
toger5 Nov 11, 2021
0831b60
review fixes
toger5 Nov 11, 2021
fdf7b9f
add jest test for WidgetLayoutStore
toger5 Nov 12, 2021
afef1d0
Merge branch 'develop' into toger5/maximised_widgets
toger5 Nov 12, 2021
b06490e
change accent-color
toger5 Nov 12, 2021
b3c6526
another try
toger5 Nov 12, 2021
03ec030
Merge branch 'develop' into toger5/maximised_widgets
toger5 Nov 12, 2021
a23931b
I think I have it now...(accent related commit)
toger5 Nov 12, 2021
0bcb881
fix room state always overriding user settings
toger5 Nov 15, 2021
b1ef33b
fix container border width
toger5 Nov 15, 2021
ba4d09c
change icons, change border width
toger5 Nov 15, 2021
26d5cd1
Merge branch 'toger5/widget_container_border_width' into toger5/maxim…
toger5 Nov 15, 2021
2a8bba6
use $container-border-width where needed
toger5 Nov 15, 2021
6f3a1c0
fix style lint
toger5 Nov 15, 2021
fa35b44
add !important for widget card AppTileFullWidth
toger5 Nov 15, 2021
7f0c5d6
fix bug where a widget can be open twice
toger5 Nov 15, 2021
a8d2e5e
review fixes
toger5 Nov 15, 2021
3743b74
fix awkward ternary stack
toger5 Nov 15, 2021
c6e9c82
Merge branch 'develop' into toger5/maximised_widgets
toger5 Nov 15, 2021
704ddc8
remove the now deprecated collapse button url after merge
toger5 Nov 15, 2021
0b9a544
Merge branch 'toger5/maximised_widgets' into toger5/maximised_widgets…
toger5 Nov 16, 2021
ad183fb
fix styling and move TimelineCard to the views
toger5 Nov 16, 2021
d3218f3
Merge branch 'develop' into toger5/maximised_widgets_rightPanel_timeline
toger5 Nov 16, 2021
6e1f1fe
clean up TimelinCard class
toger5 Nov 16, 2021
585ffa8
fix maximised state being loaded correctly
toger5 Nov 16, 2021
583d754
enable Read Receipts and sendReadReceiptOnLoad for timelineCard
toger5 Nov 17, 2021
d782c06
Merge branch 'develop' into toger5/maximised_widgets_rightPanel_timeline
toger5 Nov 17, 2021
f8c1388
Merge branch 'toger5/maximised_widgets_rightPanel_timeline' into toge…
toger5 Nov 17, 2021
d66a411
Update src/components/structures/RightPanel.tsx
toger5 Nov 17, 2021
6aa2e9b
fix position of dispatcher
toger5 Nov 17, 2021
596af16
fix header styles (make them prettier and simpler)
toger5 Nov 17, 2021
90e331f
fix up event tile
toger5 Nov 17, 2021
8dfa940
rename RightPanelPhases.TimelineCard -> Timeline
toger5 Nov 17, 2021
89b6266
Merge remote-tracking branch 'origin/toger5/maximised_widgets_rightPa…
toger5 Nov 17, 2021
304e788
fix style
toger5 Nov 17, 2021
d6ad1ae
code cleanup for previous phase logic
toger5 Nov 17, 2021
658eb7e
Merge branch 'toger5/maximised_widgets_rightPanel_timeline' into toge…
toger5 Nov 17, 2021
65c752d
remove artifacts from the previousPhase logic.
toger5 Nov 17, 2021
756630e
Merge branch 'toger5/maximised_widgets_rightPanel_timeline' into toge…
toger5 Nov 17, 2021
5a3cf2b
remove unecassary imports
toger5 Nov 17, 2021
d6e80f1
Merge branch 'toger5/maximised_widgets_rightPanel_timeline' into toge…
toger5 Nov 17, 2021
20ff205
Merge branch 'develop' into toger5/maximised_widgets_rightPanel_timeline
toger5 Nov 18, 2021
3acb7a3
fix settings layout path
toger5 Nov 18, 2021
786cff8
timeline panel header fixups
toger5 Nov 18, 2021
842150c
only enable new back button behaviour if feature enabled
toger5 Nov 18, 2021
23e9fb3
Merge branch 'toger5/maximised_widgets_rightPanel_timeline' into toge…
toger5 Nov 18, 2021
f8ae27e
prevent double timeline
toger5 Nov 18, 2021
6e4bcf0
Merge branch 'toger5/maximised_widgets_rightPanel_timeline' into toge…
toger5 Nov 18, 2021
03262fe
coreElementOnly -> excludedRighPanelPhaseButtons
toger5 Nov 19, 2021
77b9c03
disable RR's
toger5 Nov 19, 2021
d097136
remove unread indicator fragments HeaderButton
toger5 Nov 19, 2021
1e3b157
dont go to room info when widget gets closed
toger5 Nov 19, 2021
7999cdf
styling stuff
toger5 Nov 19, 2021
92d8895
solve "never show two timelines" more properly
toger5 Nov 19, 2021
d5a0652
hello linter ;)
toger5 Nov 19, 2021
10f4143
fix typo(s)
toger5 Nov 19, 2021
1bf0704
Update src/components/structures/RoomView.tsx
toger5 Nov 19, 2021
f03de71
Update src/components/structures/RoomView.tsx
toger5 Nov 19, 2021
bd0d989
Merge branch 'develop' into toger5/maximised_widgets_rightPanel_timeline
toger5 Nov 22, 2021
e881053
Merge branch 'toger5/maximised_widgets_rightPanel_timeline' into toge…
toger5 Nov 22, 2021
4f4b185
remove unused var (showNewMessages)
toger5 Nov 22, 2021
9251b03
add comment about RR's
toger5 Nov 22, 2021
7ea9f54
Merge branch 'toger5/maximised_widgets_rightPanel_timeline' into toge…
toger5 Nov 22, 2021
d21dc8f
fix feature flag check
toger5 Nov 24, 2021
bfdb6d1
remove viewInRoom button if a widget is maximised
toger5 Nov 29, 2021
c2f854b
Merge branch 'toger5/maximised_widgets_rightPanel_timeline' into toge…
toger5 Nov 29, 2021
0bd570d
Merge branch 'develop' into toger5/maximised_widgets_only_core_nav
toger5 Nov 29, 2021
c5e23f0
Fix tricky way to still get two timelines
toger5 Nov 29, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions src/components/structures/RoomView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2179,7 +2179,21 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
// TODO-video MainSplitContentType.Video:
// break;
}

let excludedRightPanelPhaseButtons = [RightPanelPhases.Timeline];
let onAppsClick = this.onAppsClick;
let onForgetClick = this.onForgetClick;
let onSearchClick = this.onSearchClick;
if (this.state.mainSplitContentType === MainSplitContentType.MaximisedWidget) {
// Disable phase buttons and action button to have a simplified header when a widget is maximised
// and enable (not disable) the RightPanelPhases.Timeline button
excludedRightPanelPhaseButtons = [
RightPanelPhases.ThreadPanel,
RightPanelPhases.PinnedMessages,
];
onAppsClick = null;
onForgetClick = null;
onSearchClick = null;
}
return (
<RoomContext.Provider value={this.state}>
<main className={mainClasses} ref={this.roomView} onKeyDown={this.onReactKeyDown}>
Expand All @@ -2192,12 +2206,13 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
searchInfo={searchInfo}
oobData={this.props.oobData}
inRoom={myMembership === 'join'}
onSearchClick={this.onSearchClick}
onForgetClick={(myMembership === "leave") ? this.onForgetClick : null}
onSearchClick={onSearchClick}
onForgetClick={(myMembership === "leave") ? onForgetClick : null}
e2eStatus={this.state.e2eStatus}
onAppsClick={this.state.hasPinnedWidgets ? this.onAppsClick : null}
onAppsClick={this.state.hasPinnedWidgets ? onAppsClick : null}
appsShown={this.state.showApps}
onCallPlaced={this.onCallPlaced}
excludedRightPanelPhaseButtons={excludedRightPanelPhaseButtons}
/>
<MainSplit panel={rightPanel} resizeNotifier={this.props.resizeNotifier}>
<div className="mx_RoomView_body">
Expand Down
7 changes: 7 additions & 0 deletions src/components/structures/ThreadView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ import { _t } from '../../languageHandler';
import ThreadListContextMenu from '../views/context_menus/ThreadListContextMenu';
import RightPanelStore from '../../stores/RightPanelStore';
import SettingsStore from '../../settings/SettingsStore';
import { WidgetLayoutStore } from '../../stores/widgets/WidgetLayoutStore';

interface IProps {
room: Room;
Expand Down Expand Up @@ -209,6 +210,12 @@ export default class ThreadView extends React.Component<IProps, IState> {
if (!SettingsStore.getValue("feature_maximised_widgets")) {
previousPhase = RightPanelPhases.ThreadPanel;
}

// change the previous phase to the threadPanel in case there is no maximised widget anymore
if (!WidgetLayoutStore.instance.hasMaximisedWidget(this.props.room)) {
previousPhase = RightPanelPhases.ThreadPanel;
}

// Make sure the previous Phase is always one of the two: Timeline or ThreadPanel
if (![RightPanelPhases.ThreadPanel, RightPanelPhases.Timeline].includes(previousPhase)) {
previousPhase = RightPanelPhases.ThreadPanel;
Expand Down
49 changes: 33 additions & 16 deletions src/components/views/right_panel/RoomHeaderButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ const TimelineCardHeaderButton = ({ room, isHighlighted, onClick }) => {

interface IProps {
room?: Room;
excludedRightPanelPhaseButtons?: Array<RightPanelPhases>;
}

@replaceableComponent("views.right_panel.RoomHeaderButtons")
Expand Down Expand Up @@ -150,38 +151,54 @@ export default class RoomHeaderButtons extends HeaderButtons<IProps> {
};

public renderButtons() {
return <>
const rightPanelPhaseButtons: Map<RightPanelPhases, any> = new Map();

rightPanelPhaseButtons.set(RightPanelPhases.PinnedMessages,
<PinnedMessagesHeaderButton
room={this.props.room}
isHighlighted={this.isPhase(RightPanelPhases.PinnedMessages)}
onClick={this.onPinnedMessagesClicked}
/>
onClick={this.onPinnedMessagesClicked} />,
);
rightPanelPhaseButtons.set(RightPanelPhases.Timeline,
<TimelineCardHeaderButton
room={this.props.room}
isHighlighted={this.isPhase(RightPanelPhases.Timeline)}
onClick={this.onTimelineCardClicked}
/>
{ SettingsStore.getValue("feature_thread") && <HeaderButton
name="threadsButton"
title={_t("Threads")}
onClick={this.onThreadsPanelClicked}
isHighlighted={this.isPhase(RoomHeaderButtons.THREAD_PHASES)}
analytics={['Right Panel', 'Threads List Button', 'click']}
/> }
onClick={this.onTimelineCardClicked} />,
);
rightPanelPhaseButtons.set(RightPanelPhases.ThreadPanel,
SettingsStore.getValue("feature_thread")
? <HeaderButton
name="threadsButton"
title={_t("Threads")}
onClick={this.onThreadsPanelClicked}
isHighlighted={this.isPhase(RoomHeaderButtons.THREAD_PHASES)}
analytics={['Right Panel', 'Threads List Button', 'click']} />
: null,
);
rightPanelPhaseButtons.set(RightPanelPhases.NotificationPanel,
<HeaderButton
name="notifsButton"
title={_t('Notifications')}
isHighlighted={this.isPhase(RightPanelPhases.NotificationPanel)}
onClick={this.onNotificationsClicked}
analytics={['Right Panel', 'Notification List Button', 'click']}
/>
analytics={['Right Panel', 'Notification List Button', 'click']} />,
);
rightPanelPhaseButtons.set(RightPanelPhases.RoomSummary,
<HeaderButton
name="roomSummaryButton"
title={_t('Room Info')}
isHighlighted={this.isPhase(ROOM_INFO_PHASES)}
onClick={this.onRoomSummaryClicked}
analytics={['Right Panel', 'Room Summary Button', 'click']}
/>
analytics={['Right Panel', 'Room Summary Button', 'click']} />,
);

return <>
{
Array.from(rightPanelPhaseButtons.keys()).map((phase) =>
( this.props.excludedRightPanelPhaseButtons.includes(phase)
? null
: rightPanelPhaseButtons.get(phase)))
}
</>;
}
}
5 changes: 4 additions & 1 deletion src/components/views/rooms/RoomHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import { SearchScope } from './SearchBar';
import { ContextMenuTooltipButton } from '../../structures/ContextMenu';
import RoomContextMenu from "../context_menus/RoomContextMenu";
import { contextMenuBelow } from './RoomTile';
import { RightPanelPhases } from '../../../stores/RightPanelStorePhases';

export interface ISearchInfo {
searchTerm: string;
Expand All @@ -57,6 +58,7 @@ interface IProps {
e2eStatus: E2EStatus;
appsShown: boolean;
searchInfo: ISearchInfo;
excludedRightPanelPhaseButtons?: Array<RightPanelPhases>;
}

interface IState {
Expand All @@ -68,6 +70,7 @@ export default class RoomHeader extends React.Component<IProps, IState> {
static defaultProps = {
editing: false,
inRoom: false,
excludedRightPanelPhaseButtons: [],
};

constructor(props, context) {
Expand Down Expand Up @@ -263,7 +266,7 @@ export default class RoomHeader extends React.Component<IProps, IState> {
{ searchStatus }
{ topicElement }
{ rightRow }
<RoomHeaderButtons room={this.props.room} />
<RoomHeaderButtons room={this.props.room} excludedRightPanelPhaseButtons={this.props.excludedRightPanelPhaseButtons} />
</div>
</div>
);
Expand Down