mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#5856
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3239
Author: @kolacheee
Created: 7/5/2026
Status: ✅ Merged
Merged: 7/5/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/3238-in-app-docs📝 Commits (10+)
3891df3chore: start in-app documentation viewer (#3238)eb27820feat: in-app documentation viewer with FAQ entry and home footer button (#3238)2966633fix: render docs with engine markdown styles, ship docs/ in Docker images, harden viewer edge cases (#3238)a5b62c8feat: docs viewer search, last-updated dates, larger layout, and reading-place memory (#3238)03efe61fix: docs viewer polish from review: safe-area height, saved-place edge cases, search count and snippets (#3238)51a7c66fix: docs viewer scroll restore raced the modal mount; widen to max-w-6xl; add code block copy buttons (#3238)4188ffcfix: move docs code block copy button to bottom-right, clear of the language tag (#3238)fc17bd9feat: docs viewer opens as a full-screen window on mobile via new Modal mobileFullscreen prop (#3238)2889c14fix: wrap docs code blocks instead of horizontal scroll so the lang tag and Copy button stay corner-anchored (#3238)9082633Harden docs content path resolution📊 Changes
12 files changed (+871 additions, -13 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
Dockerfile(+3 -0)📝
Dockerfile.lite(+3 -0)📝
docs/FAQ.md(+17 -0)📝
packages/client/src/components/chat/ChatArea.tsx(+24 -10)📝
packages/client/src/components/chat/HomeFaq.tsx(+51 -1)📝
packages/client/src/components/layout/ModalRenderer.tsx(+8 -0)➕
packages/client/src/components/modals/DocsViewerModal.tsx(+436 -0)📝
packages/client/src/components/ui/Modal.tsx(+13 -2)➕
packages/client/src/hooks/use-docs.ts(+81 -0)➕
packages/server/src/routes/docs.routes.ts(+232 -0)📝
packages/server/src/routes/index.ts(+2 -0)📄 Description
Closes #3238
Summary
Adds an in-app documentation viewer so the guides shipped in
docs/can be read directly inside Marinara, discoverable from a new Documentation button in the home page footer (next to Replay Tutorial) and a new FAQ entry ("Where can I find documentation?") that shows the on-disk docs path and opens the viewer. The viewer supports full-text search across all guides, shows a per-guide "Last updated" date, has one-click Copy buttons on every code block, and remembers the reader's place (guide + scroll position) across close/reopen.Why
Marinara ships ~28 user guides (installation, configuration, troubleshooting, macros, extensions, Game Mode, and more), but the app never mentioned them — users had to already know the
docsfolder existed inside the install directory. Discussed and approved beforehand; see #3238. The search, last-updated dates, larger layout, place-memory, and code-block copy buttons were requested during testing: last-updated helps triage "is this documentation outdated?" reports, place-memory supports bouncing in and out of the viewer while referencing macros/CSS guides mid-chat, and copy buttons serve the CSS-theming guide's paste-a-snippet workflow.Architecture
docs.routes.ts:GET /api/docs(index with titles from each file's first#heading, file-mtimeupdatedAt, and the absolute on-disk docs path),GET /api/docs/content?path=…(one markdown file), andGET /api/docs/search?q=…(case-insensitive full-text search with per-doc match counts and match-windowed line snippets). Path safety: per-segment validation (no../\/null bytes),.md-only, case-insensitive exclusion of internal artifact folders (evidence/,pr-evidence/,screenshots/,examples/),assertInsideDircontainment, and theMAX_DOC_BYTESsize guard applied on both content and search reads.DocsViewerModal(max-w-6xl, fills the modal shell height on desktop; on mobile it opens as a full-screen window via a new opt-inmobileFullscreenprop on the sharedModal— edge-to-edge, square corners, safe-area padding inside the panel; registered asdocs-viewerinModalRenderer),use-docs.tsReact Query hooks (staleTime: Infinity, debounced search), FAQ entry +FaqDocsAccessblock inHomeFaq, footer button inChatArea. Reading place persists viasessionStorage; the reader element is tracked with a state callback ref because theModalshell rendersnullon its first frame (plain refs never see the portal DOM when the doc is already cached).renderMarkdownBlocks) inside the standardmari-message-contentstyling scope. AprepareDocMarkdownpass converts the structural HTML used bydocs/FAQ.md(<details>/<summary>blocks, anchor tags) into headings and rewrites relative cross-doc links to the content endpoint; a click handler follows those inside the modal, so cross-doc navigation works. Opening a search result jumps to the first occurrence of the term in the rendered text. Code blocks get a Copy button via viewer-scoped DOM augmentation (the renderer is shared with chat, so it is not modified globally).DockerfileandDockerfile.liteproduction stages nowCOPY docs/ docs/— container images previously shipped no docs at all, which would have 404'd the viewer for every Docker/Podman/HF-Spaces user. (Windows installer and Termux installs are full clones and already includedocs/.)What was verified so far (automated)
pnpm checkgreen (lint + production build).updatedAt(CRLF files included) and pinned ordering; nested paths work; search returns windowed snippets, correct counts (H1 not double-counted), 400 on sub-2-character queries, and empty results cleanly.../, encoded/double-encoded, backslash, absolute path, null byte, excluded dirs in any letter case).FAQ.md,INSTALLATION.md,installation/ios-pwa.md, andPROFESSOR_MARI.md: zero leftover raw-HTML lines, zero unrewritten relative links, correct../resolution from nested docs.proseclasses →mari-message-content, Docker docs packaging, FAQ.md HTML handling, cross-doc links, safe-area-aware mobile height, saved-place edge cases, search count/snippet windowing, duplicate native search-clear button, scroll-restore racing the modal mount animation).Manual verification
<details>/<summary>tags); lists/tables/code blocks styled; paragraphs separated.Known limitations
#anchorfragments in cross-doc links are dropped (navigates to the top of the target doc); same-page anchor links render as plain text.screenshots/*.png) are not served and render as text — no shipped top-level guide currently relies on them for comprehension.updatedAtis the file's on-disk modification time: on fresh installs it reflects install/update time rather than when the guide was authored. It still distinguishes "docs from three versions ago" from "docs updated with this release".Docs touched
docs/FAQ.md— new entry: "How do I read the documentation inside the app?"CHANGELOG.md— Unreleased → Added entry.UI Evidence
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.