Add title pages, standard manuscript format and collapsible panels

Five changes to the export and the window chrome:

* Manuscript details gains a contact field and a "Begin exports with a
  title page" option: the title, the author beneath it, and the contact
  details beneath that, laid out line for line as typed. A chapters +
  master export puts the title page on the master, not on each chapter.

* "Standard manuscript format" lays an export out the way an agent or an
  editor expects a submission: 12pt Courier, double-spaced, half-inch
  first-line indents, a Surname / Title / page header on every page but
  the title page, chapters opening a third of the way down, and `---`
  rendered as the conventional centred `#` scene break. The title page
  becomes the submission kind, with contact top-left and an approximate
  word count top-right. Off by default; margins were already the
  standard 1in on US Letter and are unchanged either way.

* A folder button beside Export ODT opens the project folder in the file
  manager -- the enclosing git work tree, including one still awaiting
  confirmation, since showing a folder is a smaller question than
  choosing which repository to commit to.

* The toolbar and the file list each collapse, from the pair of buttons
  at the right of the menu bar or from the View menu, and Ctrl+D folds
  both away together for distraction-free writing. Both choices persist.

* The editor sizes to its viewport instead of a fixed 30 rows, so the
  height a folded panel gives back reaches the page rather than leaving
  grey space below the text box that did not even take focus.

Two traps worth recording. ODF's style:master-page-name is inherited,
and any paragraph style carrying one forces a page break before every
paragraph that uses it -- a four-line contact block came out as four
pages until Contact_20_Line stopped inheriting from Contact_20_Block;
a test now pins which styles may carry one. And the status bar shares
a function with the toolbar, so guarding that function's top rather
than the top panel alone silently took the word counts away with it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GYSGPDwkSzhm4qLqjCbqxU
This commit is contained in:
2026-08-25 17:58:59 -05:00
parent 66d3f9817e
commit f35397b49b
9 changed files with 1038 additions and 58 deletions
+35
View File
@@ -11,6 +11,15 @@ pub struct Config {
/// Whether to show the live preview pane.
#[serde(default)]
pub show_preview: bool,
/// Whether the toolbar under the menu bar — the Workspace, Export, Grammar
/// and Spelling rows — is shown. Hiding it hands four rows of height back to
/// the editor; the menu bar keeps a toggle so it can be brought back.
#[serde(default = "default_show_toolbar")]
pub show_toolbar: bool,
/// Whether the left-hand file list is shown. Hiding it, with the toolbar,
/// leaves nothing on screen but the page.
#[serde(default = "default_show_toolbar")]
pub show_file_panel: bool,
/// Whether the editor hides the editorial header, showing the prose alone.
#[serde(default)]
pub collapse_header: bool,
@@ -127,6 +136,27 @@ pub struct Config {
/// Author written into exported documents.
#[serde(default)]
pub manuscript_author: String,
/// How to reach the author: whatever belongs under their name on a title
/// page — an address, an email, a phone number, an agent. Written a line
/// per line, so the layout typed here is the layout that is exported.
#[serde(default)]
pub manuscript_contact: String,
/// Whether an export opens with a title page carrying the title, the author
/// and their contact details.
#[serde(default)]
pub manuscript_title_page: bool,
/// Whether exports are laid out in standard manuscript format — 12pt
/// Courier, double-spaced, with a running header — which is the shape an
/// agent or editor expects a submission in.
#[serde(default)]
pub manuscript_standard_format: bool,
}
/// The toolbar and the file list are what the window opens with; hiding either
/// is a deliberate act, and a config written before the options existed should
/// not start hidden.
pub fn default_show_toolbar() -> bool {
true
}
/// Default cookiecutter template for **File ▸ New project…**.
@@ -237,6 +267,8 @@ impl Default for Config {
workspace,
export_path,
show_preview: false,
show_toolbar: default_show_toolbar(),
show_file_panel: default_show_toolbar(),
collapse_header: false,
show_reference_files: false,
draft_marker: default_marker(),
@@ -267,6 +299,9 @@ impl Default for Config {
archive_folder: default_archive_folder(),
manuscript_title: String::new(),
manuscript_author: String::new(),
manuscript_contact: String::new(),
manuscript_title_page: false,
manuscript_standard_format: false,
}
}
}