From f347019cf86bf8243fb643c949fa804ce6c6a0c4 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 4 Jun 2020 21:37:10 -0600 Subject: [PATCH 1/4] Remove obviously questionable color choices --- res/css/views/rooms/_RoomSublist2.scss | 1 - src/components/views/rooms/RoomSublist2.tsx | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/res/css/views/rooms/_RoomSublist2.scss b/res/css/views/rooms/_RoomSublist2.scss index abc3133fc1..1dfaf3fb1a 100644 --- a/res/css/views/rooms/_RoomSublist2.scss +++ b/res/css/views/rooms/_RoomSublist2.scss @@ -18,5 +18,4 @@ limitations under the License. .mx_RoomList2 .mx_RoomSubList_labelContainer { z-index: 12; - background-color: purple; } diff --git a/src/components/views/rooms/RoomSublist2.tsx b/src/components/views/rooms/RoomSublist2.tsx index cc56f92769..3aa1ea3566 100644 --- a/src/components/views/rooms/RoomSublist2.tsx +++ b/src/components/views/rooms/RoomSublist2.tsx @@ -247,7 +247,7 @@ export default class RoomSublist2 extends React.Component { visibleTiles.splice(visibleTiles.length - 1, 1, (
{_t("Show %(n)s more rooms", {n: numMissing})} From 0694637b06af0288b268deec4e271b4026395640 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 4 Jun 2020 21:38:06 -0600 Subject: [PATCH 2/4] Remove debug --- src/components/views/rooms/RoomSublist2.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/views/rooms/RoomSublist2.tsx b/src/components/views/rooms/RoomSublist2.tsx index 3aa1ea3566..a64f4bf6ba 100644 --- a/src/components/views/rooms/RoomSublist2.tsx +++ b/src/components/views/rooms/RoomSublist2.tsx @@ -226,7 +226,6 @@ export default class RoomSublist2 extends React.Component { if (localStorage.getItem("mx_rl_mathfn")) { nVisible = Math[localStorage.getItem("mx_rl_mathfn")](layout.visibleTiles); } - console.log({nVisible}) const visibleTiles = tiles.slice(0, nVisible); // If we're hiding rooms, show a 'show more' button to the user. This button From e90e70bd77f9de1ad408a8f714c60b2ccec62d4c Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 4 Jun 2020 21:43:33 -0600 Subject: [PATCH 3/4] Misc cleanup --- res/css/views/rooms/_RoomList.scss | 4 ---- res/css/views/rooms/_RoomSublist2.scss | 2 +- src/components/views/rooms/RoomSublist2.tsx | 7 ++----- src/i18n/strings/en_EN.json | 2 +- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/res/css/views/rooms/_RoomList.scss b/res/css/views/rooms/_RoomList.scss index 7abf86cb0e..c23c19699d 100644 --- a/res/css/views/rooms/_RoomList.scss +++ b/res/css/views/rooms/_RoomList.scss @@ -15,10 +15,6 @@ See the License for the specific language governing permissions and limitations under the License. */ -.mx_RoomList2_resizer { - cursor: ns-resize; -} - .mx_RoomList.mx_RoomList2 { overflow-y: auto; } diff --git a/res/css/views/rooms/_RoomSublist2.scss b/res/css/views/rooms/_RoomSublist2.scss index 1dfaf3fb1a..9ab1785566 100644 --- a/res/css/views/rooms/_RoomSublist2.scss +++ b/res/css/views/rooms/_RoomSublist2.scss @@ -17,5 +17,5 @@ limitations under the License. @import "../../../../node_modules/react-resizable/css/styles.css"; .mx_RoomList2 .mx_RoomSubList_labelContainer { - z-index: 12; + z-index: 12; } diff --git a/src/components/views/rooms/RoomSublist2.tsx b/src/components/views/rooms/RoomSublist2.tsx index a64f4bf6ba..548166815f 100644 --- a/src/components/views/rooms/RoomSublist2.tsx +++ b/src/components/views/rooms/RoomSublist2.tsx @@ -239,17 +239,15 @@ export default class RoomSublist2 extends React.Component { // we +1 to account for the room we're about to hide with our 'show more' button const numMissing = (tiles.length - visibleTiles.length) + 1; - // TODO: Copy TBD // TODO: CSS TBD - // TODO: Show N more instead of infinity more? - // TODO: Safely use the same height of a tile, not hardcoded hacks + // TODO: Make this an actual tile visibleTiles.splice(visibleTiles.length - 1, 1, (
- {_t("Show %(n)s more rooms", {n: numMissing})} + {_t("Show %(n)s more", {n: numMissing})}
)); } @@ -260,7 +258,6 @@ export default class RoomSublist2 extends React.Component { axis="y" minConstraints={[-1, minTilesPx]} maxConstraints={[-1, maxTilesPx]} - draggableOpts={{grid: [-1, 1]}} resizeHandles={handles} onResize={this.onResize} className="mx_RoomSublist2_resizeBox" diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 884192b22a..0aa4c3779e 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1136,7 +1136,7 @@ "Jump to first unread room.": "Jump to first unread room.", "Jump to first invite.": "Jump to first invite.", "Add room": "Add room", - "Show %(n)s more rooms": "Show %(n)s more rooms", + "Show %(n)s more": "Show %(n)s more", "Options": "Options", "%(count)s unread messages including mentions.|other": "%(count)s unread messages including mentions.", "%(count)s unread messages including mentions.|one": "1 unread mention.", From 1f11298aa327d15067ea0b14d10ecd6d50c14d3e Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Thu, 4 Jun 2020 21:45:32 -0600 Subject: [PATCH 4/4] Annotate hacky math --- src/components/views/rooms/RoomSublist2.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/views/rooms/RoomSublist2.tsx b/src/components/views/rooms/RoomSublist2.tsx index 548166815f..e20a36d6ce 100644 --- a/src/components/views/rooms/RoomSublist2.tsx +++ b/src/components/views/rooms/RoomSublist2.tsx @@ -222,6 +222,7 @@ export default class RoomSublist2 extends React.Component { handles = []; // no handles, we're at a minimum } + // TODO: Remove Math hacks let nVisible = Math.floor(layout.visibleTiles); if (localStorage.getItem("mx_rl_mathfn")) { nVisible = Math[localStorage.getItem("mx_rl_mathfn")](layout.visibleTiles);