Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 5 additions & 8 deletions assets/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# Asset provenance
# Asset provenance

`halation-mark.png` is the Halation logo (Java, 2026-10-22): a hand-drawn vector stroke,
`halation-mark.png` is the Halation logo (Java, 2026-10-22): a hand-drawn vector stroke (one continuous line: an arch, a dip and a hooked rise),
`docs/media/brand/source/halation-mark.svg`, rendered at 512 px by `tools/render-brand.js` (an identity asset, drawn for
this project). `halation-app-icon.png` is the window and taskbar icon from the same script: the mark on a flat
`#111111` rounded square. The static Home reference image is kept outside the source tree under ignored
`.tools/ui-rebuild-native/home-reference/`; it is composition guidance only and is not embedded in the application.

`halation-wordmark.svg` is the HALATION wordmark (one path, identity asset): Bodoni Moda (SIL OFL 1.1) at weight 600,
optical size 60, tracked 0.20 em, converted to outlines (Java's choice, 2026-10-22).
`halation-wordmark-glow.png` is the wordmark's halation glow (960 x 428, the wordmark plus 180 px around it), drawn
from the wordmark by `tools/render-wordmark-glow.js` with Java's settings (2026-10-22).
drawn for this project. `halation-wordmark-glow.png` is its soft white bloom, rendered by `tools/render-wordmark-glow.js`.
`drop-outline.svg` is the dashed outline of Home's drop zone, drawn for this crate.
`fonts/SchibstedGrotesk.ttf` (variable weight, © The Schibsted-Grotesk Project Authors) is the interface face and
`fonts/Italiana.ttf` (© Santiago Orozco, Reserved Font Name "Italiana", unmodified) the page-title face; both SIL Open
Font License 1.1, from the Google Fonts repository.
`fonts/Inter.ttf` is the Inter typeface (variable weight, Latin subset), SIL Open Font License 1.1, © The Inter
Project Authors (https://github.com/rsms/inter); the original app uses the same typeface.

`drape-loop.mp4`, `drape-tint.bin` and `drape-still.jpg` are recordings of the original Halation's Drape background:
a seamless two-minute loop of 1800 frames of 320 x 180 at 15 fps stored as lifted luma in H.264, the colour of each
Expand Down
Binary file added assets/halation-app-icon.ico
Binary file not shown.
Binary file modified assets/halation-app-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/halation-mark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions crates/halation-app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ diag-skia-vulkan = ["slint/renderer-skia-vulkan"]

[build-dependencies]
slint-build = { version = "=1.18.1", default-features = false, features = ["compat-1-18"] }
# The Windows executable's icon and version resources (build.rs); it finds rc.exe in the Windows SDK
embed-resource = "=3.0.11"

[dev-dependencies]
# Headless UI tests (layout bounds at small window sizes); test builds only, never part of the shipped binary.
Expand Down
29 changes: 29 additions & 0 deletions crates/halation-app/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ fn main() {
}

copy_assets();
embed_windows_icon();

let sha = git_output(&["rev-parse", "--short=12", "HEAD"])
.filter(|sha| !sha.is_empty())
Expand All @@ -36,6 +37,34 @@ fn main() {
.expect("the Slint UI must compile; fix the reported .slint diagnostics");
}

/// The window and taskbar icon (the mark on #111111, `tools/render-brand.js`) is also a resource of the executable:
/// Explorer and the taskbar read it before the window exists, and it is the icon of a shortcut or a pinned app.
fn embed_windows_icon() {
if std::env::var("CARGO_CFG_TARGET_OS").as_deref() != Ok("windows") {
return;
}
let icon = PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap_or_default())
.join("../../assets/halation-app-icon.ico");
if !icon.is_file() {
println!(
"cargo:warning=assets/halation-app-icon.ico is missing; run node tools/render-brand.js"
);
return;
}
println!("cargo:rerun-if-changed={}", icon.display());
let script = PathBuf::from(std::env::var_os("OUT_DIR").unwrap_or_default()).join("halation.rc");
// Forward slashes: rc.exe reads `\t` in a quoted path as an escape (and this tree lives under `\trrax`)
let source = format!(
"1 ICON \"{}\"\n",
icon.display().to_string().replace('\\', "/")
);
std::fs::write(&script, source).expect("the icon resource script must be written");
// Only the app binary carries the icon; test and benchmark executables do not need it.
embed_resource::compile_for(&script, ["halation-slint"], embed_resource::NONE)
.manifest_optional()
.expect("the icon resource must compile (rc.exe comes with the Windows SDK)");
}

/// Development builds run from `target/<profile>`: put a copy of the workspace's `assets/` next to the executable there,
/// as the installer does beside the installed one. Only changed files are copied.
fn copy_assets() {
Expand Down
1 change: 1 addition & 0 deletions crates/halation-app/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1438,6 +1438,7 @@ fn apply_motion(ui: &AppWindow, tokens: motion::Tokens) {
global.set_fade(ms(tokens.fade));
global.set_panel(ms(tokens.panel));
global.set_tip_wait(ms(tokens.tip_wait));
global.set_dock_light(ms(tokens.dock_light));
global.set_press_scale(tokens.press_scale);
}

Expand Down
4 changes: 4 additions & 0 deletions crates/halation-app/src/motion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ pub struct Tokens {
pub panel: Duration,
/// Hover time before a tooltip shows (a timer, not an animation: it paints nothing while it waits)
pub tip_wait: Duration,
/// The dock's pointer light appearing and leaving (the original's 320 ms `--spring`)
pub dock_light: Duration,
/// Scale of a pressed control, in percent
pub press_scale: f32,
}
Expand All @@ -37,6 +39,7 @@ const NORMAL: Tokens = Tokens {
fade: Duration::from_millis(80),
panel: Duration::from_millis(120),
tip_wait: Duration::from_millis(400),
dock_light: Duration::from_millis(320),
press_scale: 97.0,
};

Expand All @@ -51,6 +54,7 @@ pub fn tokens(reduced_motion: bool) -> Tokens {
trail: Duration::ZERO,
fade: Duration::ZERO,
panel: Duration::ZERO,
dock_light: Duration::ZERO,
press_scale: 100.0,
..NORMAL
}
Expand Down
29 changes: 26 additions & 3 deletions crates/halation-app/src/screenshot.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! `--screenshot <page> <width>x<height> <out.png>`: one headless snapshot of a page, for visual review without
//! `--screenshot <page> <width>x<height> <out.png>`: one headless snapshot of a page, for visual review without
//! opening a window or touching the desktop. Diagnostic builds only (`diag-screenshot`); the shipping build has none
//! of this code. It renders with Slint's software renderer into memory, so it approximates the layout of the real
//! Skia window (text and edges differ); each run says so. The page is set by property, no input is simulated.
Expand Down Expand Up @@ -192,10 +192,14 @@ fn profile_tools(out_dir: &Path, page: &str) -> PathBuf {
}

pub fn run(spec: ScreenshotSpec) -> Result<(), Box<dyn std::error::Error>> {
// home, home-open (sidebar open), settings, settings-<0..7> (a section)
// home, home-open (sidebar open), settings, settings-<0..7> (a section), home-pointer (a pointer over the strip's
// left half, for the dock's light), home-hover (a pointer at rest over the drop zone)
let (page, mode, section) = match spec.page.as_str() {
"home" => (0, 0, -1),
"home-open" => (0, 2, -1),
"home-pointer" => (0, 0, -2),
// A real pointer over the drop zone's middle: it must stay flat under it
"home-hover" => (0, 6, -1),
"settings" => (3, 0, -1),
"converter" => (4, 0, -1),
"converter-open" => (4, 2, -1),
Expand All @@ -209,7 +213,7 @@ pub fn run(spec: ScreenshotSpec) -> Result<(), Box<dyn std::error::Error>> {
Some(section) if (0..8).contains(&section) => (3, 0, section),
_ => {
return Err(format!(
"unknown page '{other}'; expected home, home-open, settings, settings-<0..7>, converter, converter-open, converter-ready, converter-audio or converter-video"
"unknown page '{other}'; expected home, home-open, home-pointer, home-hover, settings, settings-<0..7>, converter, converter-open, converter-ready, converter-audio or converter-video"
)
.into());
}
Expand Down Expand Up @@ -329,6 +333,25 @@ pub fn run(spec: ScreenshotSpec) -> Result<(), Box<dyn std::error::Error>> {
ui.set_settings_jump(section);
pump(&queue, Duration::from_millis(300));
}
if mode == 6 {
// A real pointer resting over the drop zone's middle (the built-in hover pipeline, no glow must answer it)
ui.window()
.dispatch_event(slint::platform::WindowEvent::PointerMoved {
position: slint::LogicalPosition::new(spec.width as f32 * 0.5, 680.0),
});
pump(&queue, Duration::from_millis(100));
ui.window()
.dispatch_event(slint::platform::WindowEvent::PointerMoved {
position: slint::LogicalPosition::new(spec.width as f32 * 0.5, 680.0),
});
pump(&queue, Duration::from_millis(600));
}
if section == -2 {
// A pointer resting over the tool strip's right half: the dock's light follows it (headless, no mouse to move)
ui.set_home_pointer_on(true);
ui.set_home_pointer_x(spec.width as f32 * 0.6);
pump(&queue, Duration::from_millis(400));
}

let (w, h) = (spec.width as usize, spec.height as usize);
let mut buffer = vec![Rgb8Pixel::new(0, 0, 0); w * h];
Expand Down
3 changes: 3 additions & 0 deletions crates/halation-app/tests/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,8 @@ fn reduced_motion_resolves_deterministically_to_zero_duration() {
assert!(normal.hover_in < normal.hover_out, "fast in, soft out");
assert!(normal.glide < normal.trail, "a moving pill stretches");
assert!(normal.press_scale < 100.0);
// The dock's light keeps the original strip's 320 ms reveal (docs/features/motion.md §4.4), longer than the rest
assert_eq!(normal.dock_light, Duration::from_millis(320));
for d in [
reduced.hover_in,
reduced.hover_out,
Expand All @@ -419,6 +421,7 @@ fn reduced_motion_resolves_deterministically_to_zero_duration() {
reduced.trail,
reduced.fade,
reduced.panel,
reduced.dock_light,
] {
assert_eq!(d, Duration::ZERO);
}
Expand Down
7 changes: 7 additions & 0 deletions crates/halation-app/ui/app.slint
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ export component AppWindow inherits Window {
in-out property <int> library-mode: 0;
// The sidebar open with labels; closed it shows icons only (planning/active/ui-redesign.md §6)
in-out property <bool> rail-open: false;
// Home's tool strip: where the pointer is (window x) and whether it is over the strip, for the dock's light
// (headless snapshots set them; in the real window only Home's items report them)
in-out property <length> home-pointer-x: 0px;
in-out property <bool> home-pointer-on: false;
// Settings category to open at (headless snapshots)
in property <int> settings-jump: -1;
// Settings category shown (the top bar's search changes it)
Expand Down Expand Up @@ -214,6 +218,9 @@ export component AppWindow inherits Window {
tools: root.active-tools;
recent: root.recent;
library-loaded: root.library-loaded;
// Two-way: the headless snapshots place the pointer they cannot move (like `settings-jump`)
pointer-x <=> root.home-pointer-x;
pointer-on <=> root.home-pointer-on;
tool-activated(id) => { root.tool-activated(id); }
choose-reference => { root.choose-reference(); }
file-dropped(data) => { root.file-dropped(data); }
Expand Down
35 changes: 35 additions & 0 deletions crates/halation-app/ui/components/dock-light.slint
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Theme } from "../theme.slint";
import { Motion, Curve } from "../motion.slint";

// The dock's pointer light, from the original Home's tool strip: a soft white band that follows the pointer along the
// dock, plus the same light catching the dock's edge near it. It is a gradient, never a blur or a shadow. `at` is the
// pointer's position along the dock, in this component's coordinates; `on` is true while the pointer is over the dock.
// The light fades by its colours' alpha, not by `opacity` (no layer; docs/features/motion.md §2).
export component DockLight inherits Rectangle {
in property <length> at: root.width / 2;
in property <bool> on: false;
in property <length> radius: Theme.radius;
// 90 px, the original's `radial-gradient(90px circle …)`
in property <length> reach: 90px;
// 80 px for the edge ring, as the original's `::after` mask
in property <length> edge-reach: 80px;
property <float> shown: root.on ? 1 : 0;
animate shown { duration: Motion.dock-light; easing: Curve.ease; }
// `--glow-dock: rgba(255,255,255,.08)` and `--glow-dock-edge: rgba(255,255,255,.42)`
property <color> fill: Theme.text.transparentize(1 - 0.08 * root.shown);
property <color> edge: Theme.text.transparentize(1 - 0.42 * root.shown);

Rectangle {
width: 100%;
height: 100%;
border-radius: root.radius;
background: @radial-gradient(circle root.reach at root.at root.height / 2, root.fill 0%, transparent 72%);
}
Rectangle {
width: 100%;
height: 100%;
border-radius: root.radius;
border-width: 1px;
border-color: @radial-gradient(circle root.edge-reach at root.at root.height / 2, root.edge 0%, transparent 70%);
}
}
2 changes: 2 additions & 0 deletions crates/halation-app/ui/motion.slint
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ export global Motion {
in-out property <duration> panel: 120ms;
// A Timer, not an animation delay: a delay repaints every frame while it waits
in-out property <duration> tip-wait: 400ms;
// The dock's pointer light: the original's `--spring` (320 ms) fade in and out
in-out property <duration> dock-light: 320ms;
in-out property <percent> press-scale: 97%;

// Fast in, soft out
Expand Down
Loading
Loading