feat(app): add fixed Start tab with welcome page and recent documents

A pinned "Start" tab now lives at index 0. It cannot be closed, opens
on launch, and replaces the model-space viewport with a welcome page —
similar to Thunderbird's first-run screen.

- Boot opens with only the Start tab; Drawing1 is no longer auto-spawned.
- The Properties left panel becomes a Recent Documents rail on the
  Start tab. Recents persist to disk
  (%APPDATA%/H7CAD/recent.txt on Windows, $XDG_CONFIG_HOME/H7CAD/recent.txt
  on Linux, ~/Library/Application Support/H7CAD/recent.txt on macOS), up
  to 20 entries, saved on every open and rehydrated at boot.
  Each row opens or removes the file in place.
- The Support ribbon group (Donate / Report / About / Changelog) is
  retired; the same actions surface on the welcome page instead. The
  Donate button is the primary call-to-action — solid #B03020 brand
  fill with a soft brand-tinted ambient glow halo behind the action row
  (Thunderbird-style coloured glow against the neutral page).
- Drawing-only overlays (mouse-area, viewcube, navbar, dynamic input,
  selection markers) are suppressed on the Start tab so its clicks
  don't trigger CAD commands. OpenFile's "current_is_empty" check
  refuses to replace the Start tab, and TabClose ignores requests on
  it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Hakan 2026-05-21 16:19:31 +03:00
commit 35acdb2dc8
10 changed files with 513 additions and 70 deletions

View file

@ -282,6 +282,11 @@ pub enum Message {
/// File picker returned. `Some((path, size_in_bytes))` → start loading;
/// `None` → user cancelled the dialog (no overlay shown).
OpenPathPicked(Option<(PathBuf, u64)>),
/// Open a path from the Start tab's recent-documents list (skips the
/// file picker; the path is already known).
OpenRecent(PathBuf),
/// Drop a path from the recent-documents list.
RecentRemove(PathBuf),
/// User clicked Cancel on the loading overlay. The parser thread keeps
/// running but its result is discarded.
OpenCancel,
@ -688,14 +693,19 @@ pub enum Message {
impl H7CAD {
fn new() -> Self {
let first_tab = DocumentTab::new_drawing(1);
// Boot with only the Welcome/Start tab. The user creates drawings
// explicitly (File → New); we never auto-spawn Drawing1.
let start_tab = DocumentTab::new_start();
let mut app_menu = AppMenu::new();
// Restore recents from disk so the Start page lists them across runs.
app_menu.load_persistent_recents();
let mut app = Self {
start: Instant::now(),
tabs: vec![first_tab],
tabs: vec![start_tab],
active_tab: 0,
tab_counter: 1,
tab_counter: 0,
ribbon: Ribbon::new(),
app_menu: AppMenu::new(),
app_menu,
command_line: CommandLine::new(),
status_bar: StatusBar::new(),
cursor_pos: Point::ORIGIN,