compact_1 #5

Merged
gru merged 1 commits from compact_v into master 2026-05-25 08:09:47 +02:00
8 changed files with 90 additions and 6 deletions

View File

@@ -54,6 +54,7 @@ CREATE TABLE IF NOT EXISTS user_preferences (
table_columns_json TEXT,
keyboard_json TEXT,
mobile_mode INTEGER DEFAULT 0,
compact_torrent_list_enabled INTEGER DEFAULT 0,
peers_refresh_seconds INTEGER DEFAULT 0,
port_check_enabled INTEGER DEFAULT 0,
footer_items_json TEXT,
@@ -504,6 +505,7 @@ MIGRATIONS = [
"ALTER TABLE users ADD COLUMN is_active INTEGER DEFAULT 1",
"ALTER TABLE users ADD COLUMN updated_at TEXT",
"ALTER TABLE user_preferences ADD COLUMN mobile_mode INTEGER DEFAULT 0",
"ALTER TABLE user_preferences ADD COLUMN compact_torrent_list_enabled INTEGER DEFAULT 0",
"ALTER TABLE user_preferences ADD COLUMN peers_refresh_seconds INTEGER DEFAULT 0",
"ALTER TABLE user_preferences ADD COLUMN port_check_enabled INTEGER DEFAULT 0",
"ALTER TABLE user_preferences ADD COLUMN bootstrap_theme TEXT DEFAULT 'default'",

View File

@@ -346,6 +346,7 @@ def save_preferences(data: dict, user_id: int | None = None):
disk_monitor_stop_enabled = data.get("disk_monitor_stop_enabled")
disk_monitor_stop_threshold = data.get("disk_monitor_stop_threshold")
interface_scale = data.get("interface_scale")
compact_torrent_list_enabled = data.get("compact_torrent_list_enabled")
detail_panel_height = data.get("detail_panel_height")
torrent_sort_json = data.get("torrent_sort_json")
active_filter = data.get("active_filter")
@@ -392,6 +393,9 @@ def save_preferences(data: dict, user_id: int | None = None):
if scale < 80: scale = 80
if scale > 140: scale = 140
conn.execute("UPDATE user_preferences SET interface_scale=?, updated_at=? WHERE user_id=?", (scale, now, user_id))
if compact_torrent_list_enabled is not None:
# Note: Compact torrent list is a visual-only preference for desktop and mobile list density.
conn.execute("UPDATE user_preferences SET compact_torrent_list_enabled=?, updated_at=? WHERE user_id=?", (1 if compact_torrent_list_enabled else 0, now, user_id))
if footer_items_json is not None:
# Note: Store only JSON objects so footer visibility can be extended without schema churn.
value = footer_items_json if isinstance(footer_items_json, str) else json.dumps(footer_items_json)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -4894,3 +4894,81 @@ body,
}
}
/* Compact torrent list density */
body.compact-torrent-list .torrent-table {
font-size: 0.82rem;
}
body.compact-torrent-list .torrent-table tbody tr {
height: 24px;
}
body.compact-torrent-list .torrent-table > :not(caption) > * > * {
padding-bottom: 0.08rem;
padding-top: 0.08rem;
}
body.compact-torrent-list .torrent-table .badge,
body.compact-torrent-list .torrent-table .chip {
font-size: 0.68rem;
padding: 0.08rem 0.34rem;
}
body.compact-torrent-list .torrent-table .row-check {
height: 0.8rem;
width: 0.8rem;
}
body.compact-torrent-list .torrent-table .torrent-progress {
height: 11px;
min-width: 76px;
}
body.compact-torrent-list .torrent-table .torrent-progress > span {
font-size: 8px;
}
body.compact-torrent-list .mobile-list {
padding: 0.35rem;
}
body.compact-torrent-list .mobile-card {
border-radius: 0.55rem;
font-size: 0.82rem;
margin-bottom: 0.35rem;
padding: 0.42rem;
}
body.compact-torrent-list .mobile-card-header {
gap: 0.35rem;
}
body.compact-torrent-list .mobile-card .name {
font-size: 0.88rem;
line-height: 1.16;
}
body.compact-torrent-list .mobile-card .small {
font-size: 0.72rem;
line-height: 1.18;
}
body.compact-torrent-list .mobile-actions {
gap: 0.22rem;
margin-top: 0.28rem;
}
body.compact-torrent-list .mobile-actions .btn-xs,
body.compact-torrent-list .mobile-details-btn {
--bs-btn-padding-x: 0.28rem;
--bs-btn-padding-y: 0.08rem;
--bs-btn-font-size: 0.68rem;
}
body.compact-torrent-list .mobile-progress {
margin-top: 0.28rem;
}
body.compact-torrent-list .mobile-progress .torrent-progress {
height: 10px;
}

File diff suppressed because one or more lines are too long