From 3019970cadc1696961cffacbc6ea930830a807f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ahmet=20Kaan=20G=C3=BCm=C3=BC=C5=9F?= Date: Mon, 31 Aug 2026 04:21:27 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20fix(profile):=20a=20face=20at=20?= =?UTF-8?q?its=20own=20size,=20and=20every=20fact=20in=20a=20named=20cell?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The profile page put a 92px picture on the screen and the browser drew it at 18. The Instrument skin sizes `.avatar` from a `[data-ui]` scope, which outweighs a lone class, so every size modifier on that skin had quietly collapsed to 18px — the comment avatars too, for as long as the skin has existed. The three sizes are written `.avatar.avatar-lg` now, which is the weight the skin rule already had, and the picture leads the page at 92px. The rest of the page was two lines of text hanging in a box. The name and the chips sit beside the picture; underneath, every fact is a named cell in one ruled row — EMAIL, JOINED, LAST SEEN and, for anybody who was invited, INVITED BY, which is a link to the person who let them in. The counts are four bordered cells with the number leading. Recent activity is ruled rows: what they did, the card's key, its title as a link to the card, the day. And a face now leads to the person it belongs to: the comment author's picture and name, and an assignee chip in the task modal, both go to `/people/{id}` — the members table and the user menu already did. Board cards are left alone deliberately: the card is itself a link, and an anchor inside an anchor is not markup, it is a card that stops opening. The board's project filter and the card's tag picker are typed into now (`data-search`, the same pickers the logs page has). A workspace with thirty projects is not a list to scroll past. --- crates/izlek-web/src/board.rs | 2 +- crates/izlek-web/src/detail.rs | 14 ++- crates/izlek-web/src/i18n.rs | 9 ++ crates/izlek-web/src/people.rs | 128 ++++++++++++++------- crates/izlek-web/tests/http.rs | 86 ++++++++++++++ style/main.scss | 201 ++++++++++++++++++++++++++++++--- 6 files changed, 373 insertions(+), 67 deletions(-) diff --git a/crates/izlek-web/src/board.rs b/crates/izlek-web/src/board.rs index cafa4dc..bf024f5 100644 --- a/crates/izlek-web/src/board.rs +++ b/crates/izlek-web/src/board.rs @@ -630,7 +630,7 @@ pub async fn board_page(cx: &Cx, user: &User) -> Result {
(t(lang, Key::Project)) - for tag in &tags { diff --git a/crates/izlek-web/src/detail.rs b/crates/izlek-web/src/detail.rs index 676bfb1..46029c3 100644 --- a/crates/izlek-web/src/detail.rs +++ b/crates/izlek-web/src/detail.rs @@ -1365,8 +1365,10 @@ async fn assignee_chip( view! { cx => - (crate::layout::avatar(cx, person, "avatar-sm").await?) - (person.display_name.clone()) + + (crate::layout::avatar(cx, person, "avatar-sm").await?) + (person.display_name.clone()) + if may_write { @@ -1641,10 +1643,12 @@ async fn comment_row(cx: &Cx, comment: &Comment, zone: UtcOffset) -> Result { view! { cx =>
- (crate::layout::avatar(cx, &comment.author, "avatar-lg").await?) + + (crate::layout::avatar(cx, &comment.author, "avatar-lg").await?) +
- (comment.author.display_name.clone()) + (comment.author.display_name.clone()) (moment_label_in(comment.at, zone))
(comment.body.clone())
@@ -1879,7 +1883,7 @@ pub async fn task_modal(cx: &Cx, task_id: &str, confirm_delete: bool, tab: Tab) if may_write { - for tag in &tags { } diff --git a/crates/izlek-web/src/i18n.rs b/crates/izlek-web/src/i18n.rs index db32717..ce13d76 100644 --- a/crates/izlek-web/src/i18n.rs +++ b/crates/izlek-web/src/i18n.rs @@ -348,6 +348,9 @@ pub enum Key { TasksCreatedLabel, CommentsLabel, RecentActivity, + JoinedLabel, + LastSeenLabel, + InvitedByLabel, MailBatchLabel, } @@ -989,6 +992,12 @@ pub fn t(lang: Lang, key: Key) -> &'static str { (CommentsLabel, Tr) => "Yorumlar", (RecentActivity, En) => "Recent activity", (RecentActivity, Tr) => "Son etkinlik", + (JoinedLabel, En) => "JOINED", + (JoinedLabel, Tr) => "KATILDI", + (LastSeenLabel, En) => "LAST SEEN", + (LastSeenLabel, Tr) => "SON GÖRÜLME", + (InvitedByLabel, En) => "INVITED BY", + (InvitedByLabel, Tr) => "DAVET EDEN", (MailBatchLabel, En) => "Mail delay (minutes)", (MailBatchLabel, Tr) => "Posta gecikmesi (dakika)", } diff --git a/crates/izlek-web/src/people.rs b/crates/izlek-web/src/people.rs index 2bba9e8..789ab86 100644 --- a/crates/izlek-web/src/people.rs +++ b/crates/izlek-web/src/people.rs @@ -19,16 +19,14 @@ use crate::server::{accounts, require_user}; path_param!(user_id); -/// The account line the members table renders, read the same way here: a -/// named state (owner, invited) while there is nothing newer to say, and the -/// last-seen day once there is. -fn account_line(lang: Lang, is_owner: bool, has_signed_in: bool, last_day: Option) -> String { - if is_owner { - t(lang, Key::OwnerStatus).to_string() - } else if !has_signed_in { +/// What the account itself is doing: the owner reads as the owner, somebody +/// who has never chosen a password reads as invited, and everybody else is +/// the day they were last here. +fn last_seen(lang: Lang, has_signed_in: bool, last_day: Option) -> String { + if !has_signed_in { t(lang, Key::InvitedStatus).to_string() } else if let Some(day) = last_day { - crate::i18n::last_seen_label(lang, &day) + day } else { t(lang, Key::ActiveStatus).to_string() } @@ -82,14 +80,20 @@ async fn people_page(cx: &Cx) -> Result { .owner() .await? .is_some_and(|owner| owner.id == person.id); - let account = account_line( + let joined = izlek_core::board::day_label(person.created_at.to_offset(zone).date()); + let seen = last_seen( lang, - is_owner, person.has_signed_in(), person .last_signed_in_at .map(|at| izlek_core::board::day_label(at.to_offset(zone).date())), ); + // Who let them in, as a name that leads to that person's own page. The + // first account was invited by nobody. + let inviter = match &person.invited_by { + Some(id) => store.user(id).await?, + None => None, + }; let role_key = match person.role { izlek_core::Role::Admin => Key::RoleAdminOption, izlek_core::Role::Member => Key::RoleMemberOption, @@ -117,52 +121,90 @@ async fn people_page(cx: &Cx) -> Result {
-
-
- (crate::layout::avatar(cx, &who, "avatar-lg").await?) -

(person.display_name.clone())

- (t(lang, role_key)) +
+
+ (crate::layout::avatar(cx, &who, "avatar-xl").await?) +
+

(person.display_name.clone())

+
+ (t(lang, role_key)) + if is_owner { + (t(lang, Key::OwnerStatus)) + } +
+
if mine { - (t(lang, Key::EditLabel)) + (t(lang, Key::EditLabel)) }
-
-

(person.email.clone())

-

(account)

-
+
+
+
(t(lang, Key::EmailLabel))
+
(person.email.clone())
+
+
+
(t(lang, Key::JoinedLabel))
+
(joined)
+
+
+
(t(lang, Key::LastSeenLabel))
+
(seen)
+
+ if let Some(inviter) = inviter { +
+
(t(lang, Key::InvitedByLabel))
+
(inviter.display_name.clone())
+
+ } +
-
-
-
(t(lang, Key::TasksOpenLabel))
(stats.assigned_open)
-
(t(lang, Key::TasksDoneLabel))
(stats.assigned_done)
-
(t(lang, Key::TasksCreatedLabel))
(stats.created)
-
(t(lang, Key::CommentsLabel))
(stats.comments)
-
-
+
+
+
(stats.assigned_open)
+
(t(lang, Key::TasksOpenLabel))
+
+
+
(stats.assigned_done)
+
(t(lang, Key::TasksDoneLabel))
+
+
+
(stats.created)
+
(t(lang, Key::TasksCreatedLabel))
+
+
+
(stats.comments)
+
(t(lang, Key::CommentsLabel))
+
+

(t(lang, Key::RecentActivity))

-
- if feed.is_empty() { -

(t(lang, Key::NothingYet))

+ if feed.is_empty() { +

(t(lang, Key::NothingYet))

+ } +
    + for line in feed { +
  • + (kind_word(lang, &line.kind)) + if let Some(task_id) = line.task_id.clone() { + + if let Some(key) = line.task_key.clone() { + (key) + } + (line.title.clone().unwrap_or_default()) + + } else { + (line.title.clone().unwrap_or_default()) + } + (izlek_core::board::day_label(line.at.to_offset(zone).date())) +
  • } -
      - for line in feed { -
    • - (kind_word(lang, &line.kind)) - if let Some(title) = line.title { - (title) - } - (izlek_core::board::day_label(line.at.to_offset(zone).date())) -
    • - } -
    -
+
diff --git a/crates/izlek-web/tests/http.rs b/crates/izlek-web/tests/http.rs index 8742e27..70a83bf 100644 --- a/crates/izlek-web/tests/http.rs +++ b/crates/izlek-web/tests/http.rs @@ -7647,6 +7647,92 @@ async fn a_member_may_read_another_members_profile_name_address_and_counts() { } } +/// Every fact on a profile sits in a named cell, and the person who let this +/// member in is a link to their own page rather than a name in prose. +#[tokio::test] +async fn a_profile_names_its_fields_and_links_the_person_who_invited_them() { + let app = App::open().await; + let admin_cookie = admin(&app).await; + invited(&app, &admin_cookie, "mem@izlek.sh", "Mem Ber", Role::Member).await; + let mem_id = user_id(&app, "mem@izlek.sh").await; + let admin_id = app + .store + .users(&app.workspace_id().await) + .await + .unwrap() + .into_iter() + .find(|user| user.role == Role::Admin) + .unwrap() + .id; + + let page = app.get(&format!("/people/{mem_id}"), Some(&admin_cookie)).await; + let html = String::from_utf8(page.bytes).unwrap(); + for label in ["EMAIL", "JOINED", "LAST SEEN", "INVITED BY"] { + assert!(html.contains(label), "the {label} field is not on the page: {html}"); + } + assert!( + html.contains(&format!(r#"href="/people/{admin_id}""#)), + "the inviter is not a way to their own page: {html}" + ); + assert!( + html.contains("avatar-xl"), + "the profile picture is not the page's own size: {html}" + ); + + // The first account was invited by nobody, so it carries no such cell. + let owner = app.get(&format!("/people/{admin_id}"), Some(&admin_cookie)).await; + let owner_html = String::from_utf8(owner.bytes).unwrap(); + assert!( + !owner_html.contains("INVITED BY"), + "the owner was invited by somebody: {owner_html}" + ); +} + +/// A face or a name in the task modal leads to the person it names. +#[tokio::test] +async fn a_comment_author_and_an_assignee_lead_to_their_profiles() { + let app = App::open().await; + let admin_cookie = admin(&app).await; + invited(&app, &admin_cookie, "mem@izlek.sh", "Mem Ber", Role::Member).await; + let mem_id = user_id(&app, "mem@izlek.sh").await; + let workspace_id = app.workspace_id().await; + let board = app.store.board(&workspace_id).await.unwrap().unwrap(); + let open = app.store.columns(&board.id).await.unwrap()[0].id.clone(); + let task = a_task_by(&app, &board.id, &open, "Hold the door", &mem_id).await; + app.store.assign_task(&task, &mem_id).await.unwrap(); + app.store + .add_comment(&task, &mem_id, "a note", time::OffsetDateTime::now_utc()) + .await + .unwrap(); + + let page = app + .get(&format!("/?task={task}&tab=comments"), Some(&admin_cookie)) + .await; + let html = String::from_utf8(page.bytes).unwrap(); + assert!( + html.matches(&format!(r#"href="/people/{mem_id}""#)).count() >= 2, + "the comment's author and the assignee do not both lead anywhere: {html}" + ); +} + +/// The board's project filter is typed into, like the pickers on the logs +/// page: a workspace with many tags is not a list to scroll. +#[tokio::test] +async fn the_project_filter_is_written_into() { + let app = App::open().await; + let admin_cookie = admin(&app).await; + let page = app.get("/", Some(&admin_cookie)).await; + let html = String::from_utf8(page.bytes).unwrap(); + let filter = html + .split(" * { flex: none; } } -.people-stats { +// A face or a name that leads to the person it names. The chrome stays the +// chrome — the link exists to be clicked, not to look like one. +.person-link { + display: inline-flex; + align-items: center; + gap: inherit; + color: inherit; + text-decoration: none; + min-width: 0; + + &:hover { text-decoration: underline; } +} + +.person-card { + overflow: hidden; +} + +// The head is the identity: a picture big enough to be a picture, the name, +// what the workspace calls this person, and — on your own page only — the way +// to the one screen that can change any of it. +.person-head { display: flex; - flex-wrap: wrap; - gap: 28px; + align-items: center; + gap: 18px; + padding: 22px 22px 20px; +} + +.person-heading { + display: flex; + flex-direction: column; + gap: 8px; + min-width: 0; +} + +.person-name { margin: 0; + font-family: var(--font-display); + font-size: 22px; + font-weight: 600; + line-height: 1.1; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.person-marks { + display: flex; + align-items: center; + gap: 6px; +} + +.person-edit { + margin-left: auto; + flex: none; +} + +// Every fact sits in a named cell instead of floating as a line of text. The +// cells share the panel's own hairlines, so the block reads as one table +// rather than as paragraphs that happen to be near each other. +.person-fields { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); + margin: 0; + border-top: 1px solid var(--border); +} + +.person-field { + padding: 12px 22px 14px; + min-width: 0; + border-right: 1px solid var(--border); + + &:last-child { border-right: none; } dt { - font-size: 11px; - letter-spacing: 0.08em; - text-transform: uppercase; + font-size: 10px; + letter-spacing: 0.09em; color: var(--muted); } + dd { + margin: 4px 0 0; + font-size: 13px; + color: var(--ink); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } +} + +.person-field dd.person-address { + font-family: var(--font-mono); + font-size: 12px; +} + +// The hover tooltip names a face that is standing beside its own name. +.person-head .avatar[data-name]:hover::after { content: none; } + +// Four counts, four boxes. The number leads and the label sits under it, so a +// column reads as one thing rather than as a word with a digit beside it. +.person-stats { + display: grid; + grid-template-columns: repeat(4, 1fr); + margin: 0; + + @media (max-width: 620px) { + grid-template-columns: repeat(2, 1fr); + } +} + +.person-stat { + padding: 16px 22px 18px; + border-right: 1px solid var(--border); + + &:last-child { border-right: none; } + dd { margin: 0; - font-size: 20px; - font-weight: 600; + font-family: var(--font-mono); + font-size: 26px; + font-weight: 500; + line-height: 1.1; font-variant-numeric: tabular-nums; } + + dt { + margin-top: 6px; + font-size: 10px; + letter-spacing: 0.09em; + text-transform: uppercase; + color: var(--muted); + } } -.people-feed { +.person-feed { list-style: none; margin: 0; padding: 0; +} + +.person-line { display: flex; - flex-direction: column; + align-items: baseline; + gap: 12px; + padding: 9px 18px; + border-top: 1px solid var(--border); + min-width: 0; + + &:first-child { border-top: none; } + &:hover { background: var(--surface-muted); } +} + +.person-verb { + flex: none; + width: 88px; + font-size: 11px; + letter-spacing: 0.06em; + text-transform: uppercase; + color: var(--muted); +} + +.person-task { + display: flex; + align-items: baseline; gap: 8px; + min-width: 0; + color: inherit; + text-decoration: none; - li { - display: flex; - align-items: baseline; - gap: 10px; - } + &:hover .person-title { text-decoration: underline; } +} + +.person-key { + flex: none; + font-family: var(--font-mono); + font-size: 11px; + color: var(--muted); +} + +.person-title { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + font-size: 13px; } -.people-feed-day { +.person-day { margin-left: auto; flex: none; white-space: nowrap;