Commit Graph

58 Commits

Author SHA1 Message Date
1115052762 refactor: split the page, markdown pipeline and escaping out of main.rs
- assets/page/{page.html,page.css,page.js} now hold the UI. build_page only
  fills __MDP_*__ placeholders, so editing the page no longer means escaping
  braces inside a format! string. Output was verified byte-identical for the
  home page, a math/mermaid document and the startup page.
- src/markdown.rs: md -> html pipeline (GFM, AI-output dialect, front matter,
  embedded images, ==highlight==, heading ids).
- src/page.rs: page assembly.
- src/escape.rs: shared JS/HTML escaping.
- src/main.rs drops from 5535 to 3709 lines. No behavior change; 62 tests.
2026-11-03 23:02:58 +08:00
44fe93ec20 docs: allow modular code and refresh the handoff state
- AGENTS.md: new files and module splits need no approval; bug fixes,
  refactors, tests and docs can be done directly with one commit each.
  Only out-of-repo changes, releases, new third-party code and invariant
  changes still stop for a decision. Adds the exe-size and readability
  invariants.
- HANDOFF/STATUS/roadmap/README: correct the stale test count, file
  sizes, session-restore claims and session.json entry; record per-tab
  edit mode/scroll, the .txt removal, and the open editor-styling design
  question.
2026-11-03 22:11:52 +08:00
8221eb5908 chore: clear clippy warnings and tighten the build guard
- base64_encode uses div_ceil plus a slice loop (clippy: manual_div_ceil,
  chunks_exact_to_as_chunks); add known-vector tests.
- macOS-only UserEvent variants no longer warn on Windows.
- needless borrow, needless bool, and a collapsible match arm in the
  Destroyed handler.
- build.ps1 no longer treats the word "powershell" as an updater marker;
  it now checks Start-Process / Invoke-WebRequest instead.
2026-11-03 22:11:03 +08:00
c783a6dc56 fix: stop treating .txt as a supported document
Plain text was listed in the open, locate and link handlers but the file
dialog never offered it for new files, and a .txt opened through the app
behaved like Markdown without being one. Drop the extension everywhere so
the supported set is one list: md, markdown, mdown, mkd.
2026-11-03 22:10:01 +08:00
dfe38890e0 fix: remember edit mode and scroll position per tab
Edit mode used to live on the window, so switching tabs carried the mode
across documents, and the viewport stayed at whatever pixel the previous
document had scrolled to.

- DocumentTab now owns editing and scroll_ratio.
- The page reports edit-mode and scroll changes by tab id; Rust restores
  them when the tab is activated. Reports carry the id so a late report
  cannot land on the tab that just became active.
- Detaching a tab keeps its edit mode instead of forcing preview.
2026-11-03 22:09:34 +08:00
8d98b5e7a9 fix: add UTF-8 BOM to PowerShell scripts for Windows PowerShell 5.1 2026-11-02 01:31:51 +08:00
d2b1630a35 chore: switch to Low workspace and Nutstore-only publish
- build.ps1: dev build only; no copy to a fixed exe
- publish.ps1: user-run Medium publish to Nutstore
- docs: workspace stays D:\Scripts\md-preview, repo under AgentLowWorking
- .gitignore: local test/ scratch directory
2026-11-02 01:26:49 +08:00
301e042bec docs: record v1.4.2-local.5 release 2026-10-30 18:50:21 +08:00
d54b953094 docs: prepare v1.4.2-local.5 release v1.4.2-local.5 2026-10-30 18:49:12 +08:00
618ac47b83 feat: find from the selected preview text without scrolling
Ctrl+F fills the find box from the current preview selection, anchors the first hit to that selection, and suppresses scroll when the find box opens. Typed queries still start from the current viewport and next/previous still reveal their target.
2026-10-30 18:48:48 +08:00
8644966b10 feat: add tab and auto-indent to the editor
Tab inserts two spaces, Shift+Tab outdents selected lines, and Enter carries the current line's leading whitespace. Native textarea undo is preserved and IME composition is left alone.
2026-10-30 18:48:45 +08:00
dd4083fe80 docs: prepare v1.4.2-local.4 release
- Record the New Tab model and English-only UI
- Document the release build hash and deployment
- Add v1.4.2-local.4 release notes
v1.4.2-local.4
2026-10-28 19:39:23 +08:00
d90e47e606 feat: make the UI English-only
- Remove locale detection and the Chinese Strings set
- Label the new-tab page New Tab instead of Home
- Use Untitled defaults for Finder-created files
- Drop the sys-locale dependency
2026-10-28 19:37:50 +08:00
809b7b0299 feat: add Home as the default tab
- Model Home as a tab without a file path (Option<PathBuf>)
- + creates a Home tab; opening a file from Home reuses that tab
- Add a New File button to the Home page (replaces + for file creation)
- Closing the last file tab falls back to a Home tab
- Hide the tab strip while the only tab is Home
- Keep Home tabs out of detach, reveal, watcher, and duplicate checks
2026-10-28 18:21:53 +08:00
abeb426a43 docs: authorize Nutstore mirror after release 2026-10-28 17:41:57 +08:00
47e71cf692 docs: record v1.4.2-local.3 release 2026-10-28 17:38:06 +08:00
52de3f9a0f docs: prepare v1.4.2-local.3 release v1.4.2-local.3 2026-10-28 17:36:51 +08:00
9ae2c134ad fix: keep detached windows on source monitor and refine tab actions 2026-10-28 17:02:46 +08:00
5f2234493b docs: update README and release notes for local.3 2026-10-28 15:50:13 +08:00
8c6c862f5a docs: record independent review and review fixes 2026-10-28 15:34:33 +08:00
f9ccce066c fix: address multi-window review findings 2026-10-28 15:33:59 +08:00
5f08b71d07 docs: record single-tab menu fix and debug build note 2026-10-28 15:04:55 +08:00
85b20ece8a fix: disable detach when only one tab is open 2026-10-28 15:04:47 +08:00
fe32d6fe3e docs: record tab context menu and detach 2026-10-28 14:53:18 +08:00
5740274a86 feat: open a tab in a new window from its context menu 2026-10-28 14:53:05 +08:00
bab8e96197 docs: record global dedupe and recent-only startup 2026-10-28 14:46:49 +08:00
e24733ad96 feat: dedupe open documents and drop session restore 2026-10-28 14:46:40 +08:00
55d78485dd docs: record phase two window creation 2026-10-28 13:46:51 +08:00
39deeac3f5 feat: create additional empty windows at runtime 2026-10-28 13:46:43 +08:00
593dc29f21 docs: record phase one window state refactor 2026-10-28 13:39:49 +08:00
7d4091ddad refactor: route events through per-window state 2026-10-28 13:39:33 +08:00
625ffdb1b6 docs: plan single-process multi-window refactor 2026-10-28 13:34:54 +08:00
bbfc4cfb0b docs: publish v1.4.2-local.2 and record token path 2026-10-27 12:18:39 +08:00
7fda49b425 docs: add release notes for v1.4.2-local.2 v1.4.2-local.2 2026-10-27 12:11:29 +08:00
743ae5d6ee docs: record deployment and Nutstore mirror 2026-10-27 12:01:59 +08:00
53c39af0c8 test: cover multiline math with soft-break rewrite 2026-10-27 11:56:52 +08:00
968e89bf98 docs: record markdown compatibility status 2026-10-27 11:56:17 +08:00
07ac99764f feat: widen markdown compatibility for AI output 2026-10-27 11:54:03 +08:00
2a4df2e3c5 docs: record Gitea release v1.4.2-local.1 2026-10-21 17:39:12 +08:00
87fd5fef4b docs: rewrite README and add v1.4.2-local.1 release notes v1.4.2-local.1 2026-10-21 17:33:47 +08:00
6a8b03b930 docs: final handoff for completed feature set 2026-10-21 17:24:30 +08:00
7dbd1e85cd chore: keep verification screenshots out of git 2026-10-21 17:21:11 +08:00
b01553e421 feat: fixed-size chevron fold toggles
Use 30px hit area and 13.5x20 chevron (90% of the previous H2 marker) for every heading level, restore the outlined arrow, and keep it vertically centered to the left of the heading.
2026-10-21 17:20:52 +08:00
a6eb39b127 docs: status after save-failure and layout fixes 2026-10-21 17:07:29 +08:00
097d2eeb0e fix: keep app closable when autosave fails
- Save failures now pause autosave for the file and show one warning instead of retrying every 700ms
- Closing the window after a failed save asks once to discard changes instead of looping on the error dialog
- Closing/switching a blocked tab asks before discarding its unsaved edits
- Widen preview/editor side padding to 48px and scale fold toggles with the heading font
2026-10-21 17:07:11 +08:00
ef34b5a29b docs: status after heading folding 2026-10-21 16:53:06 +08:00
f74a04bd13 feat: fold heading sections with hover toggles
- Wrap #preview children into nested section.mdp-fold/.mdp-fold-body by heading level
- Chevron button appears on heading hover; H2 folds to next H2, H3 to next H3, nested sections included
- No persistence: every render starts fully expanded
- Find auto-expands collapsed ancestors before scrolling to a hit
- Print expands all sections and hides the toggles
2026-10-21 16:53:03 +08:00
99e1f0b6bf docs: status after zoom persistence 2026-10-21 16:41:09 +08:00
5cfc6224d4 fix: persist content zoom across restarts
localStorage is unavailable for the with_html page (about:blank opaque origin), so zoom was never saved. Store it in config_dir()/zoom.txt via the zoom:<pct> IPC message (400ms debounce) and restore it when the page reports ready.
2026-10-21 16:40:57 +08:00
eb4983813a docs: status after dark code theme 2026-10-21 16:34:09 +08:00