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

Commit

Permalink
Merge pull request #4850 from matrix-org/travis/room-list/todo-cleanup
Browse files Browse the repository at this point in the history
Clean up TODO comments for new room list
  • Loading branch information
turt2live authored Jun 29, 2020
2 parents 0059d44 + 175ade8 commit bb9ae7b
Show file tree
Hide file tree
Showing 25 changed files with 117 additions and 93 deletions.
2 changes: 1 addition & 1 deletion res/css/structures/_LeftPanel2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// TODO: Rename to mx_LeftPanel during replacement of old component
// TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14231

$tagPanelWidth: 70px; // only applies in this file, used for calculations

Expand Down
2 changes: 2 additions & 0 deletions res/css/views/rooms/_RoomBreadcrumbs2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14231

.mx_RoomBreadcrumbs2 {
width: 100%;

Expand Down
2 changes: 1 addition & 1 deletion res/css/views/rooms/_RoomSublist2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// TODO: Rename to mx_RoomSublist during replacement of old component
// TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14231

.mx_RoomSublist2 {
// The sublist is a column of rows, essentially
Expand Down
5 changes: 3 additions & 2 deletions res/css/views/rooms/_RoomTile2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

// TODO: Rename to mx_RoomTile during replacement of old component
// TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14231

// Note: the room tile expects to be in a flexbox column container
.mx_RoomTile2 {
Expand Down Expand Up @@ -96,7 +96,8 @@ limitations under the License.
// TODO: [Notifications] Use mx_RoomTile2_notificationsButton, similar to the following approach:
// https://github.com/matrix-org/matrix-react-sdk/blob/2180a56074f3698fc0241c309a72ba6cad802d1c/res/css/views/rooms/_RoomSublist2.scss#L48-L76
// You'll need to do the same down below on the &:hover selector for the tile.
// ... also remove this 4 line TODO comment.
// See https://github.com/vector-im/riot-web/issues/13961.
// ... also remove this 5 line TODO comment.
.mx_RoomTile2_menuButton,
.mx_RoomTile2_notificationsButton {
width: 0;
Expand Down
25 changes: 8 additions & 17 deletions src/components/structures/LeftPanel2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ import { UPDATE_EVENT } from "../../stores/AsyncStore";
import ResizeNotifier from "../../utils/ResizeNotifier";
import SettingsStore from "../../settings/SettingsStore";

// TODO: Remove banner on launch: https://github.com/vector-im/riot-web/issues/14231
// TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14231

/*******************************************************************
* CAUTION *
*******************************************************************
Expand All @@ -45,7 +48,7 @@ interface IProps {
}

interface IState {
searchFilter: string; // TODO: Move search into room list?
searchFilter: string;
showBreadcrumbs: boolean;
showTagPanel: boolean;
}
Expand All @@ -54,12 +57,7 @@ export default class LeftPanel2 extends React.Component<IProps, IState> {
private listContainerRef: React.RefObject<HTMLDivElement> = createRef();
private tagPanelWatcherRef: string;

// TODO: Properly support TagPanel
// TODO: Properly support searching/filtering
// TODO: Properly support breadcrumbs
// TODO: a11y
// TODO: actually make this useful in general (match design proposals)
// TODO: Fadable support (is this still needed?)
// TODO: a11y: https://github.com/vector-im/riot-web/issues/14180

constructor(props: IProps) {
super(props);
Expand Down Expand Up @@ -138,7 +136,7 @@ export default class LeftPanel2 extends React.Component<IProps, IState> {
}
}

// TODO: Apply this on resize, init, etc for reliability
// TODO: Improve header reliability: https://github.com/vector-im/riot-web/issues/14232
private onScroll = (ev: React.MouseEvent<HTMLDivElement>) => {
const list = ev.target as HTMLDivElement;
this.handleStickyHeaders(list);
Expand All @@ -150,11 +148,6 @@ export default class LeftPanel2 extends React.Component<IProps, IState> {
};

private renderHeader(): React.ReactNode {
// TODO: Update when profile info changes
// TODO: Presence
// TODO: Breadcrumbs toggle
// TODO: Menu button

let breadcrumbs;
if (this.state.showBreadcrumbs) {
breadcrumbs = (
Expand All @@ -173,8 +166,6 @@ export default class LeftPanel2 extends React.Component<IProps, IState> {
}

private renderSearchExplore(): React.ReactNode {
// TODO: Collapsed support

return (
<div className="mx_LeftPanel2_filterContainer">
<RoomSearch onQueryUpdate={this.onSearch} isMinimized={this.props.isMinimized} />
Expand All @@ -195,7 +186,7 @@ export default class LeftPanel2 extends React.Component<IProps, IState> {
</div>
);

// TODO: Improve props for RoomList2
// TODO: Determine what these onWhatever handlers do: https://github.com/vector-im/riot-web/issues/14180
const roomList = <RoomList2
onKeyDown={() => {/*TODO*/}}
resizeNotifier={null}
Expand All @@ -206,7 +197,7 @@ export default class LeftPanel2 extends React.Component<IProps, IState> {
isMinimized={this.props.isMinimized}
/>;

// TODO: Conference handling / calls
// TODO: Conference handling / calls: https://github.com/vector-im/riot-web/issues/14177

const containerClasses = classNames({
"mx_LeftPanel2": true,
Expand Down
2 changes: 2 additions & 0 deletions src/components/structures/RoomSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import { Key } from "../../Keyboard";
import AccessibleButton from "../views/elements/AccessibleButton";
import { Action } from "../../dispatcher/actions";

// TODO: Remove banner on launch: https://github.com/vector-im/riot-web/issues/14231

/*******************************************************************
* CAUTION *
*******************************************************************
Expand Down
2 changes: 1 addition & 1 deletion src/components/structures/UserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export default class UserMenu extends React.Component<IProps, IState> {
ev.preventDefault();
ev.stopPropagation();

// TODO: Archived room view (deferred)
// TODO: Archived room view: https://github.com/vector-im/riot-web/issues/14038
console.log("TODO: Show archived rooms");
};

Expand Down
5 changes: 4 additions & 1 deletion src/components/views/rooms/NotificationBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export const NOTIFICATION_STATE_UPDATE = "update";
export enum NotificationColor {
// Inverted (None -> Red) because we do integer comparisons on this
None, // nothing special
Bold, // no badge, show as unread // TODO: This goes away with new notification structures
// TODO: Remove bold with notifications: https://github.com/vector-im/riot-web/issues/14227
Bold, // no badge, show as unread
Grey, // unread notified messages
Red, // unread pings
}
Expand Down Expand Up @@ -141,6 +142,8 @@ export default class NotificationBadge extends React.PureComponent<IProps, IStat
}
}

// TODO: Clean up these state classes: https://github.com/vector-im/riot-web/issues/14153

export class StaticNotificationState extends EventEmitter implements INotificationState {
constructor(public symbol: string, public count: number, public color: NotificationColor) {
super();
Expand Down
9 changes: 7 additions & 2 deletions src/components/views/rooms/RoomBreadcrumbs2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ import { Room } from "matrix-js-sdk/src/models/room";
import defaultDispatcher from "../../../dispatcher/dispatcher";
import Analytics from "../../../Analytics";
import { UPDATE_EVENT } from "../../../stores/AsyncStore";
import { CSSTransition, TransitionGroup } from "react-transition-group";
import { CSSTransition } from "react-transition-group";

// TODO: Remove banner on launch: https://github.com/vector-im/riot-web/issues/14231
// TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14231

/*******************************************************************
* CAUTION *
Expand Down Expand Up @@ -86,7 +89,9 @@ export default class RoomBreadcrumbs2 extends React.PureComponent<IProps, IState
};

public render(): React.ReactElement {
// TODO: Decorate crumbs with icons
// TODO: Decorate crumbs with icons: https://github.com/vector-im/riot-web/issues/14040
// TODO: Scrolling: https://github.com/vector-im/riot-web/issues/14040
// TODO: Tooltips: https://github.com/vector-im/riot-web/issues/14040
const tiles = BreadcrumbsStore.instance.rooms.map((r, i) => {
return (
<AccessibleButton
Expand Down
9 changes: 7 additions & 2 deletions src/components/views/rooms/RoomList2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ import { ActionPayload } from "../../../dispatcher/payloads";
import { NameFilterCondition } from "../../../stores/room-list/filters/NameFilterCondition";
import { ListLayout } from "../../../stores/room-list/ListLayout";

// TODO: Remove banner on launch: https://github.com/vector-im/riot-web/issues/14231
// TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14231

/*******************************************************************
* CAUTION *
*******************************************************************
Expand Down Expand Up @@ -120,6 +123,8 @@ const TAG_AESTHETICS: {
isInvite: false,
defaultHidden: false,
},

// TODO: Replace with archived view: https://github.com/vector-im/riot-web/issues/14038
[DefaultTagID.Archived]: {
sectionLabel: _td("Historical"),
isInvite: false,
Expand Down Expand Up @@ -174,11 +179,11 @@ export default class RoomList2 extends React.Component<IProps, IState> {
for (const orderedTagId of TAG_ORDER) {
if (COMMUNITY_TAGS_BEFORE_TAG === orderedTagId) {
// Populate community invites if we have the chance
// TODO
// TODO: Community invites: https://github.com/vector-im/riot-web/issues/14179
}
if (CUSTOM_TAGS_BEFORE_TAG === orderedTagId) {
// Populate custom tags if needed
// TODO
// TODO: Custom tags: https://github.com/vector-im/riot-web/issues/14091
}

const orderedRooms = this.state.sublists[orderedTagId] || [];
Expand Down
31 changes: 9 additions & 22 deletions src/components/views/rooms/RoomSublist2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ import RoomListStore from "../../../stores/room-list/RoomListStore2";
import { ListAlgorithm, SortAlgorithm } from "../../../stores/room-list/algorithms/models";
import { TagID } from "../../../stores/room-list/models";

// TODO: Remove banner on launch: https://github.com/vector-im/riot-web/issues/14231
// TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14231

/*******************************************************************
* CAUTION *
*******************************************************************
Expand All @@ -59,12 +62,7 @@ interface IProps {
isMinimized: boolean;
tagId: TagID;

// TODO: Collapsed state
// TODO: Group invites
// TODO: Calls
// TODO: forceExpand?
// TODO: Header clicking
// TODO: Spinner support for historical
// TODO: Account for https://github.com/vector-im/riot-web/issues/14179
}

interface IState {
Expand All @@ -89,7 +87,7 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
}

private get numTiles(): number {
// TODO: Account for group invites
// TODO: Account for group invites: https://github.com/vector-im/riot-web/issues/14179
return (this.props.rooms || []).length;
}

Expand Down Expand Up @@ -268,17 +266,12 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
}

private renderHeader(): React.ReactElement {
// TODO: Title on collapsed
// TODO: Incoming call box

return (
<RovingTabIndexWrapper inputRef={this.headerButton}>
{({onFocus, isActive, ref}) => {
// TODO: Use onFocus
// TODO: Use onFocus: https://github.com/vector-im/riot-web/issues/14180
const tabIndex = isActive ? 0 : -1;

// TODO: Collapsed state

const badge = <NotificationBadge forceCount={true} notification={this.state.notificationState}/>;

let addRoomButton = null;
Expand Down Expand Up @@ -309,7 +302,7 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
</div>
);

// TODO: a11y (see old component)
// TODO: a11y (see old component): https://github.com/vector-im/riot-web/issues/14180
// Note: the addRoomButton conditionally gets moved around
// the DOM depending on whether or not the list is minimized.
// If we're minimized, we want it below the header so it
Expand Down Expand Up @@ -343,15 +336,12 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
}

public render(): React.ReactElement {
// TODO: Proper rendering
// TODO: Error boundary
// TODO: Error boundary: https://github.com/vector-im/riot-web/issues/14185

const tiles = this.renderTiles();

const classes = classNames({
// TODO: Proper collapse support
'mx_RoomSublist2': true,
'mx_RoomSublist2_collapsed': false, // len && isCollapsed
'mx_RoomSublist2_hasMenuOpen': this.state.menuDisplayed,
'mx_RoomSublist2_minimized': this.props.isMinimized,
});
Expand All @@ -360,9 +350,6 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
if (tiles.length > 0) {
const layout = this.props.layout; // to shorten calls

// TODO: Lazy list rendering
// TODO: Whatever scrolling magic needs to happen here

const nVisible = Math.floor(layout.visibleTiles);
const visibleTiles = tiles.slice(0, nVisible);

Expand Down Expand Up @@ -457,7 +444,7 @@ export default class RoomSublist2 extends React.Component<IProps, IState> {
);
}

// TODO: onKeyDown support
// TODO: onKeyDown support: https://github.com/vector-im/riot-web/issues/14180
return (
<div
className={classes}
Expand Down
29 changes: 8 additions & 21 deletions src/components/views/rooms/RoomTile2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ import { DefaultTagID, TagID } from "../../../stores/room-list/models";
import { MessagePreviewStore } from "../../../stores/room-list/MessagePreviewStore";
import RoomTileIcon from "./RoomTileIcon";

// TODO: Remove banner on launch: https://github.com/vector-im/riot-web/issues/14231
// TODO: Rename on launch: https://github.com/vector-im/riot-web/issues/14231

/*******************************************************************
* CAUTION *
*******************************************************************
Expand All @@ -51,9 +54,7 @@ interface IProps {
isMinimized: boolean;
tag: TagID;

// TODO: Allow falsifying counts (for invites and stuff)
// TODO: Transparency? Was this ever used?
// TODO: Incoming call boxes?
// TODO: Incoming call boxes: https://github.com/vector-im/riot-web/issues/14177
}

interface IState {
Expand All @@ -67,16 +68,7 @@ export default class RoomTile2 extends React.Component<IProps, IState> {
private roomTileRef: React.RefObject<HTMLDivElement> = createRef();
private generalMenuButtonRef: React.RefObject<HTMLButtonElement> = createRef();

// TODO: Custom status
// TODO: Lock icon
// TODO: Presence indicator
// TODO: e2e shields
// TODO: Handle changes to room aesthetics (name, join rules, etc)
// TODO: scrollIntoView?
// TODO: hover, badge, etc
// TODO: isSelected for hover effects
// TODO: Context menu
// TODO: a11y
// TODO: a11y: https://github.com/vector-im/riot-web/issues/14180

constructor(props: IProps) {
super(props);
Expand Down Expand Up @@ -108,7 +100,7 @@ export default class RoomTile2 extends React.Component<IProps, IState> {
private onTileClick = (ev: React.KeyboardEvent) => {
dis.dispatch({
action: 'view_room',
// TODO: Support show_room_tile in new room list
// TODO: Support show_room_tile in new room list: https://github.com/vector-im/riot-web/issues/14233
show_room_tile: true, // make sure the room is visible in the list
room_id: this.props.room.roomId,
clear_search: (ev && (ev.key === Key.ENTER || ev.key === Key.SPACE)),
Expand Down Expand Up @@ -231,10 +223,8 @@ export default class RoomTile2 extends React.Component<IProps, IState> {
}

public render(): React.ReactElement {
// TODO: Collapsed state
// TODO: Invites
// TODO: a11y proper
// TODO: Render more than bare minimum
// TODO: Invites: https://github.com/vector-im/riot-web/issues/14198
// TODO: a11y proper: https://github.com/vector-im/riot-web/issues/14180

const classes = classNames({
'mx_RoomTile2': true,
Expand All @@ -256,9 +246,6 @@ export default class RoomTile2 extends React.Component<IProps, IState> {
if (typeof name !== 'string') name = '';
name = name.replace(":", ":\u200b"); // add a zero-width space to allow linewrapping after the colon

// TODO: Support collapsed state properly
// TODO: Tooltip?

let messagePreview = null;
if (this.props.showMessagePreview && !this.props.isMinimized) {
// The preview store heavily caches this info, so should be safe to hammer.
Expand Down
Loading

0 comments on commit bb9ae7b

Please sign in to comment.