forge
Explore
Log in

Don't you dare go Hollow

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 commit

fbf69cad63c6828e65b8f08ba1af93f87effc3f6Ahmet Kaan GümüşParent: bf2e054
crates/im-web/assets/main.cssmodified+7 -6
@@ -867,7 +867,6 @@ a.wordmark-home {
867867 display: flex;
868868 flex-direction: column;
869869 gap: 16px;
870- overflow-x: auto;
871870 }
872871
873872 .logs-filters {
@@ -895,8 +894,9 @@ body:has(.log-list) .admin-card:has(.log-list) {
895894 min-height: 0;
896895 }
897896
898-.log-list-wrap {
897+.admin-table-wrap {
899898 min-height: 0;
899+ overflow-x: auto;
900900 overflow-y: auto;
901901 }
902902
@@ -973,15 +973,19 @@ body:has(.log-list) .admin-card:has(.log-list) {
973973
974974 .admin-invite {
975975 display: flex;
976+ flex-wrap: wrap;
976977 gap: 8px;
977978 align-items: stretch;
978979 --control-h: 36px;
979980 }
980981 .admin-invite .auth-input {
981- flex: 1;
982982 height: var(--control-h);
983983 box-sizing: border-box;
984984 }
985+.admin-invite input.auth-input {
986+ flex: 1;
987+ min-width: 220px;
988+}
985989 .admin-invite select.admin-role {
986990 flex: 0 0 auto;
987991 width: auto;
@@ -1120,9 +1124,6 @@ input[type=checkbox] {
11201124 .admin-shell {
11211125 padding: 16px 12px 32px;
11221126 }
1123- .admin-invite {
1124- flex-wrap: wrap;
1125- }
11261127 }
11271128 .dd-native {
11281129 display: none;
crates/im-web/src/admin.rsmodified+5 -3
@@ -249,9 +249,9 @@ fn sessions_row(
249249 }
250250 format!(
251251 concat!(
252- r#"<table class="admin-table"><thead><tr>"#,
252+ r#"<div class="admin-table-wrap"><table class="admin-table"><thead><tr>"#,
253253 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>"#
255255 ),
256256 device = t(lang, Key::DeviceLabel),
257257 address = t(lang, Key::AddressLabel),
@@ -377,10 +377,12 @@ async fn users_section(
377377 r#"<div class="admin-card">
378378 <div class="auth-title">{title}</div>
379379 {invited_html}
380+ <div class="admin-table-wrap">
380381 <table class="admin-table">
381382 <thead><tr><th>{email}</th><th>{name}</th><th></th><th></th></tr></thead>
382383 <tbody>{rows}</tbody>
383384 </table>
385+ </div>
384386 <form method="post" action="/admin/invite" class="admin-invite">
385387 <input class="auth-input auth-input-mono" type="email" name="email" placeholder="person@example.com" required>
386388 <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
779781 format!(r#"<div class="muted">{}</div>"#, t(lang, Key::LogsEmpty))
780782 } else {
781783 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">
783785 <thead><tr><th>{when}</th><th>{what}</th><th>{who}</th><th>{detail}</th></tr></thead>
784786 <tbody>{rows}</tbody>
785787 </table></div>"#,
style/main.scssmodified+18 -8
@@ -884,9 +884,6 @@ a.wordmark-home {
884884 display: flex;
885885 flex-direction: column;
886886 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;
890887 }
891888
892889 // The logs filter row: five small fields in one wrapping line; a page turn's
@@ -922,8 +919,13 @@ body:has(.log-list) {
922919 .admin-card:has(.log-list) { min-height: 0; }
923920 }
924921
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 {
926927 min-height: 0;
928+ overflow-x: auto;
927929 overflow-y: auto;
928930 }
929931
@@ -996,18 +998,27 @@ body:has(.log-list) {
996998
997999 .admin-invite {
9981000 display: flex;
1001+ flex-wrap: wrap;
9991002 gap: 8px;
10001003 align-items: stretch;
1001- // One control height for the whole row — email, role and Invite all stand
1002- // on the same line, the way izlek's member-invite row does.
1004+ // One control height for the whole row — email, role and Invite stand on
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.
10031007 --control-h: 36px;
10041008
10051009 .auth-input {
1006- flex: 1;
10071010 height: var(--control-h);
10081011 box-sizing: border-box;
10091012 }
10101013
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+
10111022 // The role picker: same field skin as the inputs, just narrower — izlek's
10121023 // invite row uses a select here too, not a checkbox. `select`-scoped so the
10131024 // enhancement's trigger button (which wears the same classes) keeps only
@@ -1158,7 +1169,6 @@ input[type="checkbox"] { accent-color: var(--accent); }
11581169
11591170 @media (max-width: 720px) {
11601171 .admin-shell { padding: 16px 12px 32px; }
1161- .admin-invite { flex-wrap: wrap; }
11621172 }
11631173
11641174 // --- Themed dropdown (izlek's dropdown, on im's tokens) --------------------