From bf8d6a376cc64e59d9a653308e02012ff73458c8 Mon Sep 17 00:00:00 2001 From: Chili Palmer Date: Sat, 4 Apr 2026 22:17:19 +0200 Subject: [PATCH] fix: more text widgets unicode-capable now --- RUST_EXECUTION_BACKLOG.md | 2 +- crates/bds-ui/src/views/panel.rs | 14 ++++++++------ crates/bds-ui/src/views/project_selector.rs | 14 +++++++++----- crates/bds-ui/src/views/sidebar.rs | 6 +++++- crates/bds-ui/src/views/status_bar.rs | 8 ++++---- crates/bds-ui/src/views/tab_bar.rs | 5 +++-- crates/bds-ui/src/views/welcome.rs | 3 +++ 7 files changed, 33 insertions(+), 19 deletions(-) diff --git a/RUST_EXECUTION_BACKLOG.md b/RUST_EXECUTION_BACKLOG.md index c9148e1..ff7d510 100644 --- a/RUST_EXECUTION_BACKLOG.md +++ b/RUST_EXECUTION_BACKLOG.md @@ -151,7 +151,7 @@ Rules: ### `bds-ui/views` -- sidebar post filtering: text search box, status filter, tag/category filter dropdown — wired to existing `search_posts_filtered()` engine. The 500 post limit applies after filtering. +- sidebar post filtering: text search box, status filter, tag/category filter dropdowns, language filter, year/month selectors, date range picker — wired to existing `PostSearchFilters` / `search_posts_filtered()` in bds-core. The 500 post limit applies AFTER filtering, not before. - dashboard - post editor (bds-editor with markdown + YAML frontmatter highlighting) - translation editor (bds-editor) diff --git a/crates/bds-ui/src/views/panel.rs b/crates/bds-ui/src/views/panel.rs index 3127023..7fec68d 100644 --- a/crates/bds-ui/src/views/panel.rs +++ b/crates/bds-ui/src/views/panel.rs @@ -1,4 +1,5 @@ use iced::widget::{button, column, container, row, scrollable, text, Space}; +use iced::widget::text::Shaping; use iced::{Alignment, Background, Border, Color, Element, Length, Theme}; use bds_core::i18n::UiLocale; @@ -70,17 +71,17 @@ pub fn view( let muted = Color::from_rgb(0.50, 0.50, 0.55); // Tab header - let tasks_btn = button(text(t(locale, "common.tasks")).size(12)) + let tasks_btn = button(text(t(locale, "common.tasks")).size(12).shaping(Shaping::Advanced)) .on_press(Message::SetPanelTab(PanelTab::Tasks)) .padding([4, 8]) .style(if panel_tab == PanelTab::Tasks { tab_active } else { tab_inactive }); - let output_btn = button(text(t(locale, "panel.output")).size(12)) + let output_btn = button(text(t(locale, "panel.output")).size(12).shaping(Shaping::Advanced)) .on_press(Message::SetPanelTab(PanelTab::Output)) .padding([4, 8]) .style(if panel_tab == PanelTab::Output { tab_active } else { tab_inactive }); - let close_btn = button(text("\u{2715}").size(12)) + let close_btn = button(text("\u{2715}").size(12).shaping(Shaping::Advanced)) .on_press(Message::TogglePanel) .padding([4, 6]) .style(close_btn_style); @@ -99,7 +100,7 @@ pub fn view( let content: Element<'static, Message> = match panel_tab { PanelTab::Tasks => { if task_snapshots.is_empty() { - container(text(t(locale, "tasks.noActive")).size(12).color(muted)) + container(text(t(locale, "tasks.noActive")).size(12).shaping(Shaping::Advanced).color(muted)) .padding(8) .into() } else { @@ -120,7 +121,7 @@ pub fn view( progress_str, phase_str, ); - text(status_text).size(11).color(Color::from_rgb(0.70, 0.70, 0.75)).into() + text(status_text).size(11).shaping(Shaping::Advanced).color(Color::from_rgb(0.70, 0.70, 0.75)).into() }) .collect(); scrollable( @@ -133,7 +134,7 @@ pub fn view( } PanelTab::Output => { if output_entries.is_empty() { - container(text(t(locale, "panel.noOutput")).size(12).color(muted)) + container(text(t(locale, "panel.noOutput")).size(12).shaping(Shaping::Advanced).color(muted)) .padding(8) .into() } else { @@ -142,6 +143,7 @@ pub fn view( .map(|entry| { text(entry.text.clone()) .size(11) + .shaping(Shaping::Advanced) .color(Color::from_rgb(0.70, 0.70, 0.75)) .into() }) diff --git a/crates/bds-ui/src/views/project_selector.rs b/crates/bds-ui/src/views/project_selector.rs index 7714585..080dd09 100644 --- a/crates/bds-ui/src/views/project_selector.rs +++ b/crates/bds-ui/src/views/project_selector.rs @@ -1,4 +1,5 @@ use iced::widget::{button, container, row, svg, text, Column, Space}; +use iced::widget::text::Shaping; use iced::{Background, Border, Color, Element, Length, Theme}; use bds_core::i18n::UiLocale; @@ -103,6 +104,7 @@ pub fn view( let header = container( text(t(locale, "projectSelector.projectsHeader")) .size(11) + .shaping(Shaping::Advanced) .color(Color::from_rgb(0.55, 0.55, 0.60)), ) .padding([4, 8]) @@ -118,14 +120,14 @@ pub fn view( let label = if is_active { row![ - text("\u{2713}").size(12).color(Color::from_rgb(0.40, 0.80, 0.40)), - text(name).size(12).color(Color::WHITE), + text("\u{2713}").size(12).shaping(Shaping::Advanced).color(Color::from_rgb(0.40, 0.80, 0.40)), + text(name).size(12).shaping(Shaping::Advanced).color(Color::WHITE), ] .spacing(6) } else { row![ Space::with_width(Length::Fixed(14.0)), - text(name).size(12).color(Color::from_rgb(0.80, 0.80, 0.85)), + text(name).size(12).shaping(Shaping::Advanced).color(Color::from_rgb(0.80, 0.80, 0.85)), ] .spacing(6) }; @@ -157,8 +159,8 @@ pub fn view( items.push( button( row![ - text("+").size(14).color(Color::from_rgb(0.55, 0.75, 0.95)), - text(t(locale, "projectSelector.newProject")).size(12), + text("+").size(14).shaping(Shaping::Advanced).color(Color::from_rgb(0.55, 0.75, 0.95)), + text(t(locale, "projectSelector.newProject")).size(12).shaping(Shaping::Advanced), ] .spacing(6), ) @@ -208,10 +210,12 @@ pub fn trigger_button(project_name: &str) -> Element<'static, Message> { let name = text(project_name.to_string()) .size(12) + .shaping(Shaping::Advanced) .color(Color::from_rgb(0.80, 0.80, 0.85)); let chevron = text("\u{25BE}") .size(10) + .shaping(Shaping::Advanced) .color(Color::from_rgb(0.55, 0.55, 0.60)); button( diff --git a/crates/bds-ui/src/views/sidebar.rs b/crates/bds-ui/src/views/sidebar.rs index 5e64257..168b679 100644 --- a/crates/bds-ui/src/views/sidebar.rs +++ b/crates/bds-ui/src/views/sidebar.rs @@ -1,4 +1,5 @@ use iced::widget::{button, column, container, scrollable, text, Space}; +use iced::widget::text::Shaping; use iced::{Background, Border, Color, Element, Length, Theme}; use bds_core::i18n::UiLocale; @@ -62,6 +63,7 @@ pub fn view( let header = text(header_text) .size(13) + .shaping(Shaping::Advanced) .color(Color::from_rgb(0.85, 0.85, 0.90)); let body: Element<'static, Message> = match sidebar_view { @@ -69,6 +71,7 @@ pub fn view( if posts.is_empty() { text(t(locale, placeholder_key(sidebar_view))) .size(12) + .shaping(Shaping::Advanced) .color(muted) .into() } else { @@ -81,7 +84,7 @@ pub fn view( bds_core::model::PostStatus::Archived => "\u{25A1} ", // □ }; let label = format!("{status_indicator}{}", p.title); - button(text(label).size(12)) + button(text(label).size(12).shaping(Shaping::Advanced)) .on_press(Message::OpenTab(Tab { id: p.id.clone(), tab_type: TabType::Post, @@ -102,6 +105,7 @@ pub fn view( _ => { text(t(locale, placeholder_key(sidebar_view))) .size(12) + .shaping(Shaping::Advanced) .color(muted) .into() } diff --git a/crates/bds-ui/src/views/status_bar.rs b/crates/bds-ui/src/views/status_bar.rs index cf46fc2..b7e9ee3 100644 --- a/crates/bds-ui/src/views/status_bar.rs +++ b/crates/bds-ui/src/views/status_bar.rs @@ -146,7 +146,7 @@ pub fn view( } else { format!("{phase_str}{progress_str}{extra}") }; - text(display).size(11).color(label_color).into() + text(display).size(11).shaping(Shaping::Advanced).color(label_color).into() } else { Space::with_width(0).into() }; @@ -180,11 +180,11 @@ pub fn view( .style(dropdown_trigger); let right = row![ - text(posts_label).size(11).color(label_color), - text(media_label).size(11).color(label_color), + text(posts_label).size(11).shaping(Shaping::Advanced).color(label_color), + text(media_label).size(11).shaping(Shaping::Advanced).color(label_color), airplane_btn, locale_trigger, - text("bDS").size(11).color(Color::from_rgb(0.45, 0.45, 0.50)), + text("bDS").size(11).shaping(Shaping::Advanced).color(Color::from_rgb(0.45, 0.45, 0.50)), ] .spacing(8) .align_y(Alignment::Center); diff --git a/crates/bds-ui/src/views/tab_bar.rs b/crates/bds-ui/src/views/tab_bar.rs index c9b16f4..c57b8bb 100644 --- a/crates/bds-ui/src/views/tab_bar.rs +++ b/crates/bds-ui/src/views/tab_bar.rs @@ -1,4 +1,5 @@ use iced::widget::{button, container, row, text, Space}; +use iced::widget::text::Shaping; use iced::{Background, Border, Color, Element, Length, Theme}; use crate::app::Message; @@ -88,8 +89,8 @@ pub fn view( let close_id = tab.id.clone(); let label = row![ - text(title_text).size(12), - button(text("\u{2715}").size(10)) + text(title_text).size(12).shaping(Shaping::Advanced), + button(text("\u{2715}").size(10).shaping(Shaping::Advanced)) .on_press(Message::CloseTab(close_id)) .padding(2) .style(close_style), diff --git a/crates/bds-ui/src/views/welcome.rs b/crates/bds-ui/src/views/welcome.rs index 247dc1e..8e9be76 100644 --- a/crates/bds-ui/src/views/welcome.rs +++ b/crates/bds-ui/src/views/welcome.rs @@ -1,4 +1,5 @@ use iced::widget::{column, container, text}; +use iced::widget::text::Shaping; use iced::{Background, Color, Element, Length, Theme}; use bds_core::i18n::UiLocale; @@ -14,9 +15,11 @@ pub fn view(locale: UiLocale) -> Element<'static, Message> { column![ text(title) .size(28) + .shaping(Shaping::Advanced) .color(Color::from_rgb(0.85, 0.85, 0.90)), text(subtitle) .size(14) + .shaping(Shaping::Advanced) .color(Color::from_rgb(0.55, 0.55, 0.60)), ] .spacing(12)