Give the people panel the pane on a narrow window
Beside the backlog the panel is 150 points wide, which on a phone-width window is half of everything there is: the names ellipsised to three letters while the conversation next to them had 240. So where the window is too narrow to hold the chats list and a conversation at once, it is too narrow to hold a conversation and a column of names — the panel takes the pane, full width, and the backlog stands down until the People switch turns it off. The message column stays in the row rather than vanishing from it, empty and asking for nothing: a column with no width that still fills the height would be handed half the row by `flexed`, which is the squash again with the scroll left in it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
553469e parent: 52bb072 modified
common/frq/screens/chat.cljc +37 -20 | @@ -1133,10 +1133,17 @@ | ||
| 1133 | 1133 | |
| 1134 | 1134 | The list is the server's — NAMES on the way in, kept up by the joins and |
| 1135 | 1135 | parts after it — so a channel this client has never been in has nothing to |
| 1136 | - show, and says so rather than showing an empty column." | |
| 1137 | - [name] | |
| 1136 | + show, and says so rather than showing an empty column. | |
| 1137 | + | |
| 1138 | + On a window too narrow to have shown the chats list and a conversation at | |
| 1139 | + once, it is too narrow to show a conversation and a 150-point column beside | |
| 1140 | + it either: the names ellipsised to three letters while the panel took half | |
| 1141 | + the screen. So there it is not a column beside the backlog — it is what the | |
| 1142 | + backlog's place holds, full width, until the switch above turns it off." | |
| 1143 | + [name narrow?] | |
| 1138 | 1144 | (let [people (actions/member-list name)] |
| 1139 | - [:vbox {:key :users :width-request users-width :fill-height true | |
| 1145 | + [:vbox {:key :users :width-request (when-not narrow? users-width) | |
| 1146 | + :fill-height true | |
| 1140 | 1147 | :reserve (below-messages) :spacing 8} |
| 1141 | 1148 | [:title-2 {:label (str "People " (count people))}] |
| 1142 | 1149 | [:scroll {:scroll-key (str "users-" name) |
| @@ -1151,7 +1158,11 @@ | ||
| 1151 | 1158 | (defn chat-screen [] |
| 1152 | 1159 | (let [name @cells/current |
| 1153 | 1160 | buffer (get @cells/channels name) |
| 1154 | - show-users? (and @cells/show-users? name (str/starts-with? name "#"))] | |
| 1161 | + show-users? (and @cells/show-users? name (str/starts-with? name "#")) | |
| 1162 | + ;; Beside the backlog only where there is room for both. On a narrow | |
| 1163 | + ;; window the panel is the pane, and the backlog stands down for as | |
| 1164 | + ;; long as it is up — see `users-panel`. | |
| 1165 | + narrow-people? (and show-users? (not (actions/wide?)))] | |
| 1155 | 1166 | ;; Not a :page — a page scrolls everything, which would carry the compose |
| 1156 | 1167 | ;; bar off the bottom with the backlog. The message list is the only thing |
| 1157 | 1168 | ;; that scrolls, bounded so what follows it keeps its room. |
| @@ -1239,26 +1250,32 @@ | ||
| 1239 | 1250 | ;; for the reconciler, and take the message list's scroll position with |
| 1240 | 1251 | ;; it every time the panel was toggled. |
| 1241 | 1252 | [:hbox {:spacing 8 :wrap false} |
| 1242 | - [:vbox {:key :messages :fill-height true | |
| 1243 | - :width-request (if show-users? (messages-width) 0)} | |
| 1244 | - [:scroll {:scroll-key (messages-scroll-key) | |
| 1245 | - :orientation :vertical | |
| 1246 | - :reserve (below-messages) | |
| 1247 | - :stick-to-bottom true | |
| 1248 | - :scroll-to-bottom @cells/jump-tick | |
| 1249 | - :on-change #(reset! cells/at-present? (= "end" %)) | |
| 1250 | - ;; The terminal's half of the same question, which arrives | |
| 1251 | - ;; as the offset the list moved to rather than as a place. | |
| 1252 | - ;; `scrolled!` is what turns one into the other. | |
| 1253 | - :on-scroll actions/scrolled!} | |
| 1254 | - (if (seq (:messages buffer)) | |
| 1255 | - (message-rows (:messages buffer)) | |
| 1256 | - [:dim-label {:label "Nothing here yet."}])]] | |
| 1253 | + ;; Empty and claiming nothing when the panel has taken the pane: a column | |
| 1254 | + ;; with no width and something filling it inside would still be handed | |
| 1255 | + ;; half the row, which is the squash with the scroll left in it. | |
| 1256 | + [:vbox {:key :messages :fill-height (not narrow-people?) | |
| 1257 | + :width-request (if (and show-users? (not narrow-people?)) | |
| 1258 | + (messages-width) | |
| 1259 | + 0)} | |
| 1260 | + (when-not narrow-people? | |
| 1261 | + [:scroll {:scroll-key (messages-scroll-key) | |
| 1262 | + :orientation :vertical | |
| 1263 | + :reserve (below-messages) | |
| 1264 | + :stick-to-bottom true | |
| 1265 | + :scroll-to-bottom @cells/jump-tick | |
| 1266 | + :on-change #(reset! cells/at-present? (= "end" %)) | |
| 1267 | + ;; The terminal's half of the same question, which arrives | |
| 1268 | + ;; as the offset the list moved to rather than as a place. | |
| 1269 | + ;; `scrolled!` is what turns one into the other. | |
| 1270 | + :on-scroll actions/scrolled!} | |
| 1271 | + (if (seq (:messages buffer)) | |
| 1272 | + (message-rows (:messages buffer)) | |
| 1273 | + [:dim-label {:label "Nothing here yet."}])])] | |
| 1257 | 1274 | ;; The wrapper takes no height of its own: the panel inside it is the |
| 1258 | 1275 | ;; column, and a fill-height wrapper around it would claim the strip the |
| 1259 | 1276 | ;; compose bar sits in whether or not the panel was showing. |
| 1260 | 1277 | [:vbox {:key :people-pane} |
| 1261 | - (when show-users? [users-panel name])]] | |
| 1278 | + (when show-users? [users-panel name narrow-people?])]] | |
| 1262 | 1279 | ;; Only while it is needed, and directly under the backlog: the way back |
| 1263 | 1280 | ;; to the present belongs next to the thing that puts you there, which is |
| 1264 | 1281 | ;; the conversation and not the overview. |
| @@ -1133,10 +1133,17 @@ | |||
| 1133 | 1133 | ||
| 1134 | The list is the server's — NAMES on the way in, kept up by the joins and | 1134 | The list is the server's — NAMES on the way in, kept up by the joins and |
| 1135 | parts after it — so a channel this client has never been in has nothing to | 1135 | parts after it — so a channel this client has never been in has nothing to |
| 1136 | - show, and says so rather than showing an empty column." | 1136 | + show, and says so rather than showing an empty column. |
| 1137 | - [name] | 1137 | + |
| 1138 | + On a window too narrow to have shown the chats list and a conversation at | ||
| 1139 | + once, it is too narrow to show a conversation and a 150-point column beside | ||
| 1140 | + it either: the names ellipsised to three letters while the panel took half | ||
| 1141 | + the screen. So there it is not a column beside the backlog — it is what the | ||
| 1142 | + backlog's place holds, full width, until the switch above turns it off." | ||
| 1143 | + [name narrow?] | ||
| 1138 | (let [people (actions/member-list name)] | 1144 | (let [people (actions/member-list name)] |
| 1139 | - [:vbox {:key :users :width-request users-width :fill-height true | 1145 | + [:vbox {:key :users :width-request (when-not narrow? users-width) |
| 1146 | + :fill-height true | ||
| 1140 | :reserve (below-messages) :spacing 8} | 1147 | :reserve (below-messages) :spacing 8} |
| 1141 | [:title-2 {:label (str "People " (count people))}] | 1148 | [:title-2 {:label (str "People " (count people))}] |
| 1142 | [:scroll {:scroll-key (str "users-" name) | 1149 | [:scroll {:scroll-key (str "users-" name) |
| @@ -1151,7 +1158,11 @@ | |||
| 1151 | (defn chat-screen [] | 1158 | (defn chat-screen [] |
| 1152 | (let [name @cells/current | 1159 | (let [name @cells/current |
| 1153 | buffer (get @cells/channels name) | 1160 | buffer (get @cells/channels name) |
| 1154 | - show-users? (and @cells/show-users? name (str/starts-with? name "#"))] | 1161 | + show-users? (and @cells/show-users? name (str/starts-with? name "#")) |
| 1162 | + ;; Beside the backlog only where there is room for both. On a narrow | ||
| 1163 | + ;; window the panel is the pane, and the backlog stands down for as | ||
| 1164 | + ;; long as it is up — see `users-panel`. | ||
| 1165 | + narrow-people? (and show-users? (not (actions/wide?)))] | ||
| 1155 | ;; Not a :page — a page scrolls everything, which would carry the compose | 1166 | ;; Not a :page — a page scrolls everything, which would carry the compose |
| 1156 | ;; bar off the bottom with the backlog. The message list is the only thing | 1167 | ;; bar off the bottom with the backlog. The message list is the only thing |
| 1157 | ;; that scrolls, bounded so what follows it keeps its room. | 1168 | ;; that scrolls, bounded so what follows it keeps its room. |
| @@ -1239,26 +1250,32 @@ | |||
| 1239 | ;; for the reconciler, and take the message list's scroll position with | 1250 | ;; for the reconciler, and take the message list's scroll position with |
| 1240 | ;; it every time the panel was toggled. | 1251 | ;; it every time the panel was toggled. |
| 1241 | [:hbox {:spacing 8 :wrap false} | 1252 | [:hbox {:spacing 8 :wrap false} |
| 1242 | - [:vbox {:key :messages :fill-height true | 1253 | + ;; Empty and claiming nothing when the panel has taken the pane: a column |
| 1243 | - :width-request (if show-users? (messages-width) 0)} | 1254 | + ;; with no width and something filling it inside would still be handed |
| 1244 | - [:scroll {:scroll-key (messages-scroll-key) | 1255 | + ;; half the row, which is the squash with the scroll left in it. |
| 1245 | - :orientation :vertical | 1256 | + [:vbox {:key :messages :fill-height (not narrow-people?) |
| 1246 | - :reserve (below-messages) | 1257 | + :width-request (if (and show-users? (not narrow-people?)) |
| 1247 | - :stick-to-bottom true | 1258 | + (messages-width) |
| 1248 | - :scroll-to-bottom @cells/jump-tick | 1259 | + 0)} |
| 1249 | - :on-change #(reset! cells/at-present? (= "end" %)) | 1260 | + (when-not narrow-people? |
| 1250 | - ;; The terminal's half of the same question, which arrives | 1261 | + [:scroll {:scroll-key (messages-scroll-key) |
| 1251 | - ;; as the offset the list moved to rather than as a place. | 1262 | + :orientation :vertical |
| 1252 | - ;; `scrolled!` is what turns one into the other. | 1263 | + :reserve (below-messages) |
| 1253 | - :on-scroll actions/scrolled!} | 1264 | + :stick-to-bottom true |
| 1254 | - (if (seq (:messages buffer)) | 1265 | + :scroll-to-bottom @cells/jump-tick |
| 1255 | - (message-rows (:messages buffer)) | 1266 | + :on-change #(reset! cells/at-present? (= "end" %)) |
| 1256 | - [:dim-label {:label "Nothing here yet."}])]] | 1267 | + ;; The terminal's half of the same question, which arrives |
| 1268 | + ;; as the offset the list moved to rather than as a place. | ||
| 1269 | + ;; `scrolled!` is what turns one into the other. | ||
| 1270 | + :on-scroll actions/scrolled!} | ||
| 1271 | + (if (seq (:messages buffer)) | ||
| 1272 | + (message-rows (:messages buffer)) | ||
| 1273 | + [:dim-label {:label "Nothing here yet."}])])] | ||
| 1257 | ;; The wrapper takes no height of its own: the panel inside it is the | 1274 | ;; The wrapper takes no height of its own: the panel inside it is the |
| 1258 | ;; column, and a fill-height wrapper around it would claim the strip the | 1275 | ;; column, and a fill-height wrapper around it would claim the strip the |
| 1259 | ;; compose bar sits in whether or not the panel was showing. | 1276 | ;; compose bar sits in whether or not the panel was showing. |
| 1260 | [:vbox {:key :people-pane} | 1277 | [:vbox {:key :people-pane} |
| 1261 | - (when show-users? [users-panel name])]] | 1278 | + (when show-users? [users-panel name narrow-people?])]] |
| 1262 | ;; Only while it is needed, and directly under the backlog: the way back | 1279 | ;; Only while it is needed, and directly under the backlog: the way back |
| 1263 | ;; to the present belongs next to the thing that puts you there, which is | 1280 | ;; to the present belongs next to the thing that puts you there, which is |
| 1264 | ;; the conversation and not the overview. | 1281 | ;; the conversation and not the overview. |