chore: replace pixel metrics with rem-based sizing across ui
Rust / build (macos-latest, stable) (push) Canceled after 0s
Rust / build (ubuntu-latest, stable) (push) Canceled after 0s
Rust / build (windows-latest, stable) (push) Canceled after 0s

This commit is contained in:
2026-11-19 15:47:50 +07:00
parent 5a597f43c4
commit a0f69b6450
74 changed files with 897 additions and 1090 deletions
+6 -7
View File
@@ -7,12 +7,12 @@ use nostr::prelude::{EventId, PublicKey};
use signed_core::GitEvent;
use signed_state::RepoStore;
use ui::avatar::Avatar;
use ui::common::{Sizable as _, h_flex, v_flex};
use ui::common::{Sizable as _, StyledExt as _, h_flex, v_flex};
use ui::empty_state::EmptyState;
use ui::input::InputState;
use ui::layout::panel::Panel;
use ui::scroll_area::ScrollArea;
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
use ui::theme::ActiveTheme as _;
use utils::relative_time;
use crate::issues::helpers::{comment_form, comments_section, issue_roots, sidebar_section};
@@ -147,7 +147,8 @@ impl Render for IssueDetailView {
div()
.flex_1()
.min_w_0()
.typeset(TextRole::Headline, cx)
.text_sm()
.font_semibold()
.child(title),
),
)
@@ -160,7 +161,7 @@ impl Render for IssueDetailView {
.child(
h_flex()
.gap_2()
.typeset(TextRole::Body, cx)
.text_base()
.child(
h_flex()
.gap_1()
@@ -187,9 +188,7 @@ impl Render for IssueDetailView {
.child(SharedString::from(age)),
),
)
.child(
div().typeset(TextRole::Body, cx).child(content),
),
.child(div().text_base().child(content)),
)
.child(comments_section(
&self.store,
+8 -13
View File
@@ -9,10 +9,10 @@ use signed_state::RepoStore;
use ui::avatar::Avatar;
use ui::badge::{Badge, BadgeVariant};
use ui::button::Button;
use ui::common::{Sizable as _, h_flex, v_flex};
use ui::common::{Sizable as _, StyledExt as _, h_flex, v_flex};
use ui::icons::{Icon, IconRole};
use ui::input::{Input, InputState};
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
use ui::theme::ActiveTheme as _;
use ui::tooltip::Tooltip;
use utils::relative_time;
@@ -129,12 +129,7 @@ pub(crate) fn sidebar_section(
.picture(profile.picture())
.small(),
)
.child(
div()
.typeset(TextRole::Body, cx)
.text_ellipsis()
.child(name),
)
.child(div().text_base().text_ellipsis().child(name))
.into_any_element()
})),
)
@@ -146,7 +141,7 @@ pub(crate) fn sidebar_section(
if labels.is_empty() {
this.child(
div()
.typeset(TextRole::Body, cx)
.text_base()
.text_color(cx.theme().colors.muted_foreground)
.child("None yet."),
)
@@ -173,7 +168,7 @@ pub(crate) fn comments_section(
v_flex()
.gap_4()
.child(div().typeset(TextRole::Caption2, cx).child(title))
.child(div().text_xs().font_medium().child(title))
.children(comments.iter().map(|comment| {
let profile = directory.read(cx).profile(&comment.pubkey, cx);
let author = profile.name();
@@ -189,7 +184,7 @@ pub(crate) fn comments_section(
.child(
h_flex()
.gap_2()
.typeset(TextRole::Body, cx)
.text_base()
.child(
h_flex()
.gap_1()
@@ -212,7 +207,7 @@ pub(crate) fn comments_section(
.child(SharedString::from(age)),
),
)
.child(div().typeset(TextRole::Body, cx).child(content))
.child(div().text_base().child(content))
}))
.into_any_element()
}
@@ -241,7 +236,7 @@ pub(crate) fn comment_form(
.child(
h_flex()
.gap_1()
.typeset(TextRole::Caption, cx)
.text_xs()
.text_color(cx.theme().colors.muted_foreground)
.child(
Icon::named(IconRole::Markdown)
+3 -3
View File
@@ -17,7 +17,7 @@ use ui::icons::{Icon, IconRole};
use ui::layout::panel::Panel;
use ui::scrollbar::Scrollbar;
use ui::segmented::{Segmented, SegmentedOption};
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
use ui::theme::ActiveTheme as _;
use utils::relative_time;
use self::detail::IssueDetailView;
@@ -252,7 +252,7 @@ impl Render for IssuesView {
.gap_1()
.child(
div()
.typeset(TextRole::Body, cx)
.text_base()
.text_ellipsis()
.whitespace_nowrap()
.child(title),
@@ -260,7 +260,7 @@ impl Render for IssuesView {
.child(
h_flex()
.gap_2()
.typeset(TextRole::Caption, cx)
.text_xs()
.child(
h_flex()
.gap_1()
+2 -2
View File
@@ -8,7 +8,7 @@ use ui::common::v_flex;
use ui::dialog::{Dialog, DialogHandle};
use ui::field::Field;
use ui::input::{Input, InputState};
use ui::theme::{ActiveTheme as _, TextRole, Typeset as _};
use ui::theme::ActiveTheme as _;
pub struct NewIssueDialog {
handle: DialogHandle,
@@ -58,7 +58,7 @@ impl Render for NewIssueDialog {
.gap_3()
.child(
div()
.typeset(TextRole::Body, cx)
.text_base()
.text_color(cx.theme().colors.muted_foreground)
.child("Report a bug, ask a question, or propose a change."),
)