write 0.1.1

A fullscreen, distraction-free, write-only Markdown editor that fades text away to silence the writer's inner editor.
mod app;

use eframe::egui;

fn main() -> eframe::Result {
    // Acquire today's session file + lock before opening a window. If another
    // `write` is already running today, exit quietly without flashing a window.
    let file = match app::open_session_file() {
        Ok(Some(file)) => file,
        Ok(None) => {
            eprintln!("write: another session already holds today's file; exiting.");
            return Ok(());
        }
        Err(e) => {
            eprintln!("write: {e}");
            std::process::exit(1);
        }
    };

    let native_options = eframe::NativeOptions {
        // Don't request fullscreen at build time: a bare `cargo run` binary isn't the
        // foreground app yet during window creation, so native fullscreen races, the
        // Space collapses, and focus bounces to Finder. Instead launch as a maximized,
        // chrome-hidden (but titled) window and enter fullscreen from `WriteApp::ui`
        // once the window actually has focus.
        viewport: egui::ViewportBuilder::default()
            .with_titlebar_shown(false)
            .with_title_shown(false)
            .with_fullsize_content_view(true)
            .with_maximized(true),
        ..Default::default()
    };
    eframe::run_native(
        "write",
        native_options,
        Box::new(move |cc| Ok(Box::new(app::WriteApp::new(cc, file)))),
    )
}