modified
src/frq/app.jolt +10 -3 | @@ -165,9 +165,16 @@ | ||
| 165 | 165 | [:button {:label "Join" |
| 166 | 166 | :kind :primary |
| 167 | 167 | :on-click #(do (s/join! @s/join-input) (reset! s/join-input ""))}]]] |
| 168 | - [:entry {:text @s/search | |
| 169 | - :placeholder "Search channels" | |
| 170 | - :on-change #(reset! s/search %)}] | |
| 168 | + ;; The clear button only shows while there is something to clear: an | |
| 169 | + ;; empty box has nothing to undo, and a dead button beside it reads as | |
| 170 | + ;; one that stopped working. | |
| 171 | + [:hbox {:spacing 6} | |
| 172 | + [:entry {:text @s/search | |
| 173 | + :width-request 380 | |
| 174 | + :placeholder "Search channels" | |
| 175 | + :on-change #(reset! s/search %)}] | |
| 176 | + (when (seq @s/search) | |
| 177 | + [:button {:label "✕" :on-click #(reset! s/search "")}])] | |
| 171 | 178 | (if (seq buffers) |
| 172 | 179 | (for [b buffers] [conversation-row b]) |
| 173 | 180 | [:card {} [:dim-label {:label "No conversations yet — join a channel."}]]) |
| @@ -165,9 +165,16 @@ | |||
| 165 | [:button {:label "Join" | 165 | [:button {:label "Join" |
| 166 | :kind :primary | 166 | :kind :primary |
| 167 | :on-click #(do (s/join! @s/join-input) (reset! s/join-input ""))}]]] | 167 | :on-click #(do (s/join! @s/join-input) (reset! s/join-input ""))}]]] |
| 168 | - [:entry {:text @s/search | 168 | + ;; The clear button only shows while there is something to clear: an |
| 169 | - :placeholder "Search channels" | 169 | + ;; empty box has nothing to undo, and a dead button beside it reads as |
| 170 | - :on-change #(reset! s/search %)}] | 170 | + ;; one that stopped working. |
| 171 | + [:hbox {:spacing 6} | ||
| 172 | + [:entry {:text @s/search | ||
| 173 | + :width-request 380 | ||
| 174 | + :placeholder "Search channels" | ||
| 175 | + :on-change #(reset! s/search %)}] | ||
| 176 | + (when (seq @s/search) | ||
| 177 | + [:button {:label "✕" :on-click #(reset! s/search "")}])] | ||
| 171 | (if (seq buffers) | 178 | (if (seq buffers) |
| 172 | (for [b buffers] [conversation-row b]) | 179 | (for [b buffers] [conversation-row b]) |
| 173 | [:card {} [:dim-label {:label "No conversations yet — join a channel."}]]) | 180 | [:card {} [:dim-label {:label "No conversations yet — join a channel."}]]) |