pinakes-ui: streamline sidebar design

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I0176fa480e5ba40eea5a39685a4f97896a6a6964
This commit is contained in:
raf 2026-02-03 10:25:31 +03:00
commit 278bcaa4b0
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
25 changed files with 1805 additions and 1686 deletions

View file

@ -65,7 +65,9 @@ pub fn Settings(
label { class: "form-label", "Backend" }
span { class: "tooltip-trigger",
"?"
span { class: "tooltip-text", "The storage backend used by the server (SQLite or PostgreSQL)." }
span { class: "tooltip-text",
"The storage backend used by the server (SQLite or PostgreSQL)."
}
}
}
span { class: "info-value badge badge-neutral", "{config.backend}" }
@ -75,7 +77,9 @@ pub fn Settings(
label { class: "form-label", "Server Address" }
span { class: "tooltip-trigger",
"?"
span { class: "tooltip-text", "The address and port the server is listening on." }
span { class: "tooltip-text",
"The address and port the server is listening on."
}
}
}
span { class: "info-value mono", "{host_port}" }
@ -85,7 +89,9 @@ pub fn Settings(
label { class: "form-label", "Database Path" }
span { class: "tooltip-trigger",
"?"
span { class: "tooltip-text", "File path to the SQLite database, or connection info for PostgreSQL." }
span { class: "tooltip-text",
"File path to the SQLite database, or connection info for PostgreSQL."
}
}
}
span { class: "info-value mono", "{db_path}" }
@ -102,7 +108,9 @@ pub fn Settings(
}
span { class: "tooltip-trigger",
"?"
span { class: "tooltip-text", "Directories that Pinakes scans for media files. Only existing directories can be added." }
span { class: "tooltip-text",
"Directories that Pinakes scans for media files. Only existing directories can be added."
}
}
}
div { class: "settings-card-body",
@ -194,7 +202,9 @@ pub fn Settings(
label { class: "form-label", "File Watching" }
span { class: "tooltip-trigger",
"?"
span { class: "tooltip-text", "When enabled, Pinakes monitors root directories for new, modified, or deleted files in real time using filesystem events." }
span { class: "tooltip-text",
"When enabled, Pinakes monitors root directories for new, modified, or deleted files in real time using filesystem events."
}
}
}
div {
@ -204,8 +214,7 @@ pub fn Settings(
on_toggle_watch.call(!watch_enabled);
}
},
div {
class: if watch_enabled { "toggle-track active" } else { "toggle-track" },
div { class: if watch_enabled { "toggle-track active" } else { "toggle-track" },
div { class: "toggle-thumb" }
}
}
@ -217,7 +226,9 @@ pub fn Settings(
label { class: "form-label", "Poll Interval" }
span { class: "tooltip-trigger",
"?"
span { class: "tooltip-text", "How often (in seconds) Pinakes polls for file changes when watch mode is not available or as a fallback." }
span { class: "tooltip-text",
"How often (in seconds) Pinakes polls for file changes when watch mode is not available or as a fallback."
}
}
}
if *editing_poll.read() {
@ -242,7 +253,8 @@ pub fn Settings(
poll_error.set(None);
}
_ => {
poll_error.set(Some("Enter a positive integer (seconds).".to_string()));
poll_error
.set(Some("Enter a positive integer (seconds).".to_string()));
}
}
}
@ -307,7 +319,9 @@ pub fn Settings(
label { class: "form-label", "Ignore Patterns" }
span { class: "tooltip-trigger",
"?"
span { class: "tooltip-text", "Glob patterns for files and directories to skip during scanning. One pattern per line." }
span { class: "tooltip-text",
"Glob patterns for files and directories to skip during scanning. One pattern per line."
}
}
}
if *editing_patterns.read() {
@ -359,7 +373,9 @@ pub fn Settings(
class: "patterns-textarea",
placeholder: "One pattern per line, e.g.:\n*.tmp\n.git/**\nnode_modules/**",
}
p { class: "text-muted text-sm", "Enter one glob pattern per line. Empty lines are ignored." }
p { class: "text-muted text-sm",
"Enter one glob pattern per line. Empty lines are ignored."
}
}
} else {
if config.scanning.ignore_patterns.is_empty() {
@ -397,7 +413,7 @@ pub fn Settings(
let handler = on_update_ui_config;
move |e: Event<FormData>| {
if let Some(ref h) = handler {
h.call(serde_json::json!({"theme": e.value()}));
h.call(serde_json::json!({ "theme" : e.value() }));
}
}
},
@ -412,7 +428,9 @@ pub fn Settings(
label { class: "form-label", "Default View" }
span { class: "tooltip-trigger",
"?"
span { class: "tooltip-text", "The view shown when the application starts." }
span { class: "tooltip-text",
"The view shown when the application starts."
}
}
}
select {
@ -421,7 +439,7 @@ pub fn Settings(
let handler = on_update_ui_config;
move |e: Event<FormData>| {
if let Some(ref h) = handler {
h.call(serde_json::json!({"default_view": e.value()}));
h.call(serde_json::json!({ "default_view" : e.value() }));
}
}
},
@ -436,7 +454,9 @@ pub fn Settings(
label { class: "form-label", "Default Page Size" }
span { class: "tooltip-trigger",
"?"
span { class: "tooltip-text", "Number of items shown per page by default." }
span { class: "tooltip-text",
"Number of items shown per page by default."
}
}
}
select {
@ -444,10 +464,9 @@ pub fn Settings(
onchange: {
let handler = on_update_ui_config;
move |e: Event<FormData>| {
if let Some(ref h) = handler
&& let Ok(size) = e.value().parse::<usize>() {
h.call(serde_json::json!({"default_page_size": size}));
}
if let Some(ref h) = handler && let Ok(size) = e.value().parse::<usize>() {
h.call(serde_json::json!({ "default_page_size" : size }));
}
}
},
option { value: "24", "24" }
@ -463,7 +482,9 @@ pub fn Settings(
label { class: "form-label", "Default View Mode" }
span { class: "tooltip-trigger",
"?"
span { class: "tooltip-text", "Whether to show items in a grid or table layout." }
span { class: "tooltip-text",
"Whether to show items in a grid or table layout."
}
}
}
select {
@ -472,7 +493,7 @@ pub fn Settings(
let handler = on_update_ui_config;
move |e: Event<FormData>| {
if let Some(ref h) = handler {
h.call(serde_json::json!({"default_view_mode": e.value()}));
h.call(serde_json::json!({ "default_view_mode" : e.value() }));
}
}
},
@ -487,7 +508,9 @@ pub fn Settings(
label { class: "form-label", "Auto-play Media" }
span { class: "tooltip-trigger",
"?"
span { class: "tooltip-text", "Automatically start playback when opening audio or video." }
span { class: "tooltip-text",
"Automatically start playback when opening audio or video."
}
}
}
{
@ -498,11 +521,10 @@ pub fn Settings(
class: "toggle",
onclick: move |_| {
if let Some(ref h) = handler {
h.call(serde_json::json!({"auto_play_media": !autoplay}));
h.call(serde_json::json!({ "auto_play_media" : ! autoplay }));
}
},
div {
class: if autoplay { "toggle-track active" } else { "toggle-track" },
div { class: if autoplay { "toggle-track active" } else { "toggle-track" },
div { class: "toggle-thumb" }
}
}
@ -516,7 +538,9 @@ pub fn Settings(
label { class: "form-label", "Show Thumbnails" }
span { class: "tooltip-trigger",
"?"
span { class: "tooltip-text", "Display thumbnail previews in library and search views." }
span { class: "tooltip-text",
"Display thumbnail previews in library and search views."
}
}
}
{
@ -527,11 +551,10 @@ pub fn Settings(
class: "toggle",
onclick: move |_| {
if let Some(ref h) = handler {
h.call(serde_json::json!({"show_thumbnails": !show_thumbs}));
h.call(serde_json::json!({ "show_thumbnails" : ! show_thumbs }));
}
},
div {
class: if show_thumbs { "toggle-track active" } else { "toggle-track" },
div { class: if show_thumbs { "toggle-track active" } else { "toggle-track" },
div { class: "toggle-thumb" }
}
}