Files
luma-home/src/scroll-preview.rs
T
Kaloyan DanchevandClaude Opus 4.6 cbea5a322f
CI / Identify a merged version PR (push) Canceled after 0s
CI / Rust checks, rendering, and native package (push) Canceled after 0s
CI / Publish release and Homebrew feed (push) Canceled after 0s
Release PR / Maintain Version Packages PR (push) Canceled after 0s
Merge Luma launcher fork into monorepo
Move trampoline files (boot-hook, watcher, overlay) into trampoline/
subdirectory. Add upstream Luma v2.3.1 source at repo root with our
additions:

- Page::Ha (4th nav tab) with placeholder empty state
- HA tab config schema and default entity mapping (ha-home/)
- Nav keys renamed: "home" → "start", new "ha" tab between Apps and Settings
- All state.rs/view.rs/main.rs/tests.rs updated for 4-tab navigation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-10-24 11:52:55 +03:00

41 lines
1.1 KiB
Rust

//! Explicit manual scroll preview. Never used as a TV inventory fallback.
use crate::{i18n::Language, model::Inventory};
const PREFIX: &str = "com.luma.scroll-preview.";
pub fn is_placeholder(id: &str) -> bool {
id.starts_with(PREFIX)
}
pub fn append(inventory: &mut Inventory, count: usize, language: Language) {
if count == 0 {
return;
}
let templates = inventory.apps.clone();
if templates.is_empty() {
eprintln!("Luma scroll preview: no real apps to use as artwork templates");
return;
}
let mut added = 0;
for index in 0..count {
let id = format!("{PREFIX}{index:03}");
if inventory.apps.iter().any(|app| app.id == id) {
continue;
}
let mut app = templates[index % templates.len()].clone();
app.id = id;
app.title = format!(
"{} {:03} · {}",
language.t("scrollTestApp"),
index + 1,
app.title
);
inventory.apps.push(app);
added += 1;
}
eprintln!(
"Luma scroll preview: {added} placeholder apps appended to {} real apps",
templates.len()
);
}