Admin tables scroll inside their own wrapper, not the whole card: the logs wrap generalizes to .admin-table-wrap around every admin-table (users, per-user sessions, logs), gaining overflow-x auto while the card's overflow-x goes away, so on a phone the heading, filters and invite row stay put while the table's action column scrolls into reach — and the invite form wraps, its email input holding a 220px floor instead of squishing to nothing
Browse files at this commitfbf69cad63c6828e65b8f08ba1af93f87effc3f6Parent: bf2e0543 changed files +30 -17
- crates/im-web/assets/main.css +7 -6
- crates/im-web/src/admin.rs +5 -3
- style/main.scss +18 -8
crates/im-web/assets/main.cssmodified+7 -6
| @@ -867,7 +867,6 @@ a.wordmark-home { | |||
| 867 | display: flex; | 867 | display: flex; |
| 868 | flex-direction: column; | 868 | flex-direction: column; |
| 869 | gap: 16px; | 869 | gap: 16px; |
| 870 | - overflow-x: auto; | ||
| 871 | } | 870 | } |
| 872 | 871 | ||
| 873 | .logs-filters { | 872 | .logs-filters { |
| @@ -895,8 +894,9 @@ body:has(.log-list) .admin-card:has(.log-list) { | |||
| 895 | min-height: 0; | 894 | min-height: 0; |
| 896 | } | 895 | } |
| 897 | 896 | ||
| 898 | -.log-list-wrap { | 897 | +.admin-table-wrap { |
| 899 | min-height: 0; | 898 | min-height: 0; |
| 899 | + overflow-x: auto; | ||
| 900 | overflow-y: auto; | 900 | overflow-y: auto; |
| 901 | } | 901 | } |
| 902 | 902 | ||
| @@ -973,15 +973,19 @@ body:has(.log-list) .admin-card:has(.log-list) { | |||
| 973 | 973 | ||
| 974 | .admin-invite { | 974 | .admin-invite { |
| 975 | display: flex; | 975 | display: flex; |
| 976 | + flex-wrap: wrap; | ||
| 976 | gap: 8px; | 977 | gap: 8px; |
| 977 | align-items: stretch; | 978 | align-items: stretch; |
| 978 | --control-h: 36px; | 979 | --control-h: 36px; |
| 979 | } | 980 | } |
| 980 | .admin-invite .auth-input { | 981 | .admin-invite .auth-input { |
| 981 | - flex: 1; | ||
| 982 | height: var(--control-h); | 982 | height: var(--control-h); |
| 983 | box-sizing: border-box; | 983 | box-sizing: border-box; |
| 984 | } | 984 | } |
| 985 | +.admin-invite input.auth-input { | ||
| 986 | + flex: 1; | ||
| 987 | + min-width: 220px; | ||
| 988 | +} | ||
| 985 | .admin-invite select.admin-role { | 989 | .admin-invite select.admin-role { |
| 986 | flex: 0 0 auto; | 990 | flex: 0 0 auto; |
| 987 | width: auto; | 991 | width: auto; |
| @@ -1120,9 +1124,6 @@ input[type=checkbox] { | |||
| 1120 | .admin-shell { | 1124 | .admin-shell { |
| 1121 | padding: 16px 12px 32px; | 1125 | padding: 16px 12px 32px; |
| 1122 | } | 1126 | } |
| 1123 | - .admin-invite { | ||
| 1124 | - flex-wrap: wrap; | ||
| 1125 | - } | ||
| 1126 | } | 1127 | } |
| 1127 | .dd-native { | 1128 | .dd-native { |
| 1128 | display: none; | 1129 | display: none; |
crates/im-web/src/admin.rsmodified+5 -3
| @@ -249,9 +249,9 @@ fn sessions_row( | |||
| 249 | } | 249 | } |
| 250 | format!( | 250 | format!( |
| 251 | concat!( | 251 | concat!( |
| 252 | - r#"<table class="admin-table"><thead><tr>"#, | 252 | + r#"<div class="admin-table-wrap"><table class="admin-table"><thead><tr>"#, |
| 253 | r#"<th>{device}</th><th>{address}</th><th>{signed_in}</th><th>{last_seen}</th><th></th>"#, | 253 | r#"<th>{device}</th><th>{address}</th><th>{signed_in}</th><th>{last_seen}</th><th></th>"#, |
| 254 | - r#"</tr></thead><tbody>{rows}</tbody></table>"# | 254 | + r#"</tr></thead><tbody>{rows}</tbody></table></div>"# |
| 255 | ), | 255 | ), |
| 256 | device = t(lang, Key::DeviceLabel), | 256 | device = t(lang, Key::DeviceLabel), |
| 257 | address = t(lang, Key::AddressLabel), | 257 | address = t(lang, Key::AddressLabel), |
| @@ -377,10 +377,12 @@ async fn users_section( | |||
| 377 | r#"<div class="admin-card"> | 377 | r#"<div class="admin-card"> |
| 378 | <div class="auth-title">{title}</div> | 378 | <div class="auth-title">{title}</div> |
| 379 | {invited_html} | 379 | {invited_html} |
| 380 | + <div class="admin-table-wrap"> | ||
| 380 | <table class="admin-table"> | 381 | <table class="admin-table"> |
| 381 | <thead><tr><th>{email}</th><th>{name}</th><th></th><th></th></tr></thead> | 382 | <thead><tr><th>{email}</th><th>{name}</th><th></th><th></th></tr></thead> |
| 382 | <tbody>{rows}</tbody> | 383 | <tbody>{rows}</tbody> |
| 383 | </table> | 384 | </table> |
| 385 | + </div> | ||
| 384 | <form method="post" action="/admin/invite" class="admin-invite"> | 386 | <form method="post" action="/admin/invite" class="admin-invite"> |
| 385 | <input class="auth-input auth-input-mono" type="email" name="email" placeholder="person@example.com" required> | 387 | <input class="auth-input auth-input-mono" type="email" name="email" placeholder="person@example.com" required> |
| 386 | <select class="auth-input admin-role" name="role"> | 388 | <select class="auth-input admin-role" name="role"> |
| @@ -779,7 +781,7 @@ async fn logs_section(cx: &Cx, lang: i18n::Lang) -> Result<String, topcoat::Erro | |||
| 779 | format!(r#"<div class="muted">{}</div>"#, t(lang, Key::LogsEmpty)) | 781 | format!(r#"<div class="muted">{}</div>"#, t(lang, Key::LogsEmpty)) |
| 780 | } else { | 782 | } else { |
| 781 | format!( | 783 | format!( |
| 782 | - r#"<div class="log-list-wrap"><table class="admin-table log-list" data-rows="{limit}" data-section="logs"> | 784 | + r#"<div class="admin-table-wrap"><table class="admin-table log-list" data-rows="{limit}" data-section="logs"> |
| 783 | <thead><tr><th>{when}</th><th>{what}</th><th>{who}</th><th>{detail}</th></tr></thead> | 785 | <thead><tr><th>{when}</th><th>{what}</th><th>{who}</th><th>{detail}</th></tr></thead> |
| 784 | <tbody>{rows}</tbody> | 786 | <tbody>{rows}</tbody> |
| 785 | </table></div>"#, | 787 | </table></div>"#, |
style/main.scssmodified+18 -8
| @@ -884,9 +884,6 @@ a.wordmark-home { | |||
| 884 | display: flex; | 884 | display: flex; |
| 885 | flex-direction: column; | 885 | flex-direction: column; |
| 886 | gap: 16px; | 886 | gap: 16px; |
| 887 | - // Logs/users tables are wider than a phone; the card scrolls sideways | ||
| 888 | - // instead of pushing the whole page out. | ||
| 889 | - overflow-x: auto; | ||
| 890 | } | 887 | } |
| 891 | 888 | ||
| 892 | // The logs filter row: five small fields in one wrapping line; a page turn's | 889 | // The logs filter row: five small fields in one wrapping line; a page turn's |
| @@ -922,8 +919,13 @@ body:has(.log-list) { | |||
| 922 | .admin-card:has(.log-list) { min-height: 0; } | 919 | .admin-card:has(.log-list) { min-height: 0; } |
| 923 | } | 920 | } |
| 924 | 921 | ||
| 925 | -.log-list-wrap { | 922 | +// Every admin table rides a wrapper that scrolls it sideways itself, so the |
| 923 | +// card never does and a section's heading and filters stay put. min-height: | ||
| 924 | +// 0 is what lets the logs fit shrink the wrap below its content, so the | ||
| 925 | +// vertical scroll also stays inside it instead of reaching the page. | ||
| 926 | +.admin-table-wrap { | ||
| 926 | min-height: 0; | 927 | min-height: 0; |
| 928 | + overflow-x: auto; | ||
| 927 | overflow-y: auto; | 929 | overflow-y: auto; |
| 928 | } | 930 | } |
| 929 | 931 | ||
| @@ -996,18 +998,27 @@ body:has(.log-list) { | |||
| 996 | 998 | ||
| 997 | .admin-invite { | 999 | .admin-invite { |
| 998 | display: flex; | 1000 | display: flex; |
| 1001 | + flex-wrap: wrap; | ||
| 999 | gap: 8px; | 1002 | gap: 8px; |
| 1000 | align-items: stretch; | 1003 | align-items: stretch; |
| 1001 | - // One control height for the whole row — email, role and Invite all stand | 1004 | + // One control height for the whole row — email, role and Invite stand on |
| 1002 | - // on the same line, the way izlek's member-invite row does. | 1005 | + // the same line while there is room, the way izlek's member-invite row |
| 1006 | + // does; on a phone the email drops to its own line instead. | ||
| 1003 | --control-h: 36px; | 1007 | --control-h: 36px; |
| 1004 | 1008 | ||
| 1005 | .auth-input { | 1009 | .auth-input { |
| 1006 | - flex: 1; | ||
| 1007 | height: var(--control-h); | 1010 | height: var(--control-h); |
| 1008 | box-sizing: border-box; | 1011 | box-sizing: border-box; |
| 1009 | } | 1012 | } |
| 1010 | 1013 | ||
| 1014 | + // The email field keeps a floor wide enough to read the placeholder in; | ||
| 1015 | + // when the row cannot fit that floor, it wraps. The role select shares | ||
| 1016 | + // the input skin but not the floor, so this stays input-scoped. | ||
| 1017 | + input.auth-input { | ||
| 1018 | + flex: 1; | ||
| 1019 | + min-width: 220px; | ||
| 1020 | + } | ||
| 1021 | + | ||
| 1011 | // The role picker: same field skin as the inputs, just narrower — izlek's | 1022 | // The role picker: same field skin as the inputs, just narrower — izlek's |
| 1012 | // invite row uses a select here too, not a checkbox. `select`-scoped so the | 1023 | // invite row uses a select here too, not a checkbox. `select`-scoped so the |
| 1013 | // enhancement's trigger button (which wears the same classes) keeps only | 1024 | // enhancement's trigger button (which wears the same classes) keeps only |
| @@ -1158,7 +1169,6 @@ input[type="checkbox"] { accent-color: var(--accent); } | |||
| 1158 | 1169 | ||
| 1159 | @media (max-width: 720px) { | 1170 | @media (max-width: 720px) { |
| 1160 | .admin-shell { padding: 16px 12px 32px; } | 1171 | .admin-shell { padding: 16px 12px 32px; } |
| 1161 | - .admin-invite { flex-wrap: wrap; } | ||
| 1162 | } | 1172 | } |
| 1163 | 1173 | ||
| 1164 | // --- Themed dropdown (izlek's dropdown, on im's tokens) -------------------- | 1174 | // --- Themed dropdown (izlek's dropdown, on im's tokens) -------------------- |