[PR #8441] [MERGED] feat: search within assembled prompt viewer #8602

Closed
opened 2026-11-07 16:45:54 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8441
Author: @SpicyMarinara
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @SpicyMarinara

Base: staging ← Head: feat/8430-prompt-viewer-find


📝 Commits (4)

  • b3264a7 chore: start prompt viewer find (#8430)
  • 26288d1 feat: find text within assembled prompt viewer (#8430)
  • c8c343f chore: shorten prompt Find hint
  • 4d0c8d3 fix: support non-Latin prompt Find shortcuts

📊 Changes

4 files changed (+435 additions, -16 deletions)

View changed files

📝 docs/chats/peek-prompt.md (+8 -0)
➕ e2e/prompt-viewer-find.e2e.ts (+214 -0)
📝 packages/client/src/components/chat/PeekPromptModal.tsx (+206 -16)
📝 packages/client/src/localization/locales/en.json (+7 -0)

📄 Description

Linked issue

Closes #8430

Why this change

Long assembled prompts are difficult to inspect on phones and tablets. Users need to find contradictions and stale state inside the viewer without exporting private prompt content.

What changed

  • Added a visible Find field to the shared Assembled Prompt / Peek Prompt viewer, with highlighted literal, case-insensitive matches, a current/total counter, and previous/next buttons that wrap.
  • Ctrl/Cmd+F focuses Find inside the viewer across Latin and non-Latin layouts, preserving Dvorak and AltGr shortcuts. Enter and Shift+Enter navigate matches; keyboard focus stays inside the dialog without opening the mobile keyboard on entry.
  • Find searches every original message, including closed sections, history wrappers, and provider blocks. While searching, the full message text is shown; clearing Find restores collapsible sections. Prompt text and copied content stay unchanged.
  • Search rendering uses a deferred query and cached highlight tree for large prompts. Updated canonical English labels and the Peek Prompt guide.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Agent-run validation on c8c343ff61e0645869fec4a7fc6c408360bdd17d:

  • pnpm install and pnpm check passed on implementation commit 26288d1fc (the final one-line English hint also passed localization and Prettier checks), including localization, formatting, workspace lint/type checks, E2E type checks, and production build. The existing HomeProfessorMariChat.tsx serverRun hook warning remains.
  • PLAYWRIGHT_CLIENT_PORT=7860 PLAYWRIGHT_SERVER_PORT=7861 PLAYWRIGHT_MOBILE_CLIENT_PORT=7862 PLAYWRIGHT_MOBILE_SERVER_PORT=7863 pnpm regression:ui e2e/prompt-viewer-find.e2e.ts --workers=1 --output=.tmp/8430-ready-browser: 6 passed across desktop Chromium, mobile Chromium, and mobile WebKit.
  • PLAYWRIGHT_CLIENT_PORT=7860 PLAYWRIGHT_SERVER_PORT=7861 PLAYWRIGHT_MOBILE_CLIENT_PORT=7862 PLAYWRIGHT_MOBILE_SERVER_PORT=7863 PLAYWRIGHT_ONLY_PROJECT=desktop pnpm smoke:ui --output=.tmp/8430-smoke: 7 passed.
  • Focused proof uses a 27.5k-token synthetic prompt in Roleplay and Conversation, through saved-message Peek and typed live preview. It covers hidden/wrapper content, first/last/wrapped navigation, Ctrl+F and Cmd+F, Enter/Shift+Enter, Tab wrapping, literal regex punctuation, Unicode, over 7,000 one-letter matches, no matches, clearing, and exact raw/copy text. Light/dark screenshots were visually inspected on desktop and mobile emulation.
  • Baseline source failed at the missing Find field; its screenshot/trace were preserved. Fixture-only failures (Roleplay Enter preference and a mobile Copy toast that remained hovered) were replayed unchanged, traced, and corrected without changing application behavior or raising timeouts.
  • Local CodeRabbit review: completed on the implementation. Earlier advice about deferred rendering and immediate toast dismissal was implemented. The final review reported a minor two-sentence hint, shortened afterward with localization/Prettier revalidated, and a trivial suggestion to avoid rebuilding keyed JSX when moving between matches. That optional optimization is deferred: React already reconciles stable keyed marks without rewriting prompt text; imperative per-mark updates would add state synchronization work without a demonstrated defect. No timing benchmark is claimed. Earlier responsiveness advice was implemented; a docs-follow-up finding is covered by #8443/#8445, and the toast dismissal was moved immediately after the copy assertion.
  • Local container build/run was unavailable: the Docker CLI could not connect to its stopped daemon socket. Hosted container validation remains a merge gate.

Human follow-up:

  • Manually verify Find with a physical phone/tablet keyboard and touch controls, including the on-screen keyboard. Emulation does not prove physical-device behavior.
  • Manually verify the selected theme's match contrast with personal custom themes.

Keyboard-layout review repair

Repair head: 4d0c8d3c1e3f5cd6f60d7e51787263ed2af924fc.

  • Reproduced the old shortcut failure before editing application code: Ctrl + Cyrillic а / KeyF left defaultPrevented false. The failing trace, screenshot and log remain in .tmp/8430-nonlatin-before.
  • Kept the existing typed f match and Alt guard, with a physical KeyF fallback only when the reported key is not an ASCII letter. No shared shortcut behavior was changed.
  • pnpm check passed after the repair. node scripts/run-regressions.mjs --filter scripts/regressions/roleplay-streaming.regression.ts passed 1/1; that script has no assertion tied to the reflowed viewer section JSX.
  • PLAYWRIGHT_CLIENT_PORT=7860 PLAYWRIGHT_SERVER_PORT=7861 PLAYWRIGHT_MOBILE_CLIENT_PORT=7862 PLAYWRIGHT_MOBILE_SERVER_PORT=7863 pnpm regression:ui e2e/prompt-viewer-find.e2e.ts --workers=2 --output=.tmp/8430-nonlatin-after: 6/6 passed across desktop Chromium, mobile Chromium and mobile WebKit. Each case checks Ctrl/Cmd + Cyrillic а / KeyF, typed f on another physical key, Dvorak u / KeyF, and AltGr negatives from the panel, Find input and scroll-area control, including focus and defaultPrevented.
  • Keyboard-layout coverage uses synthetic browser keydown events, not physical keyboard-layout calibration.
  • Audited the highlight variables: default highlight text derives from the selected accent; applied chat colors map it to the resolved custom control color and use the resolved action background. Arbitrary custom-theme color contrast remains a human verification item; no universal contrast claim is made.
  • Local CodeRabbit delta review against c8c343ff6: completed with 0 findings across the two changed files.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened
  • Version/release files updated (only if this PR includes a version bump)

Updated docs/chats/peek-prompt.md. Translations are tracked by #8443 and coordinated in #8445. No version/release metadata changed.

UI evidence (if applicable)

Synthetic before/after proof: https://gist.github.com/SpicyMarinara/057c75894f82b8d7f43d635b38c7602d

Downloaded PNG bytes were verified against the local artifacts.

after-desktop-dark.png

after-desktop-light.png

after-mobile-dark.png

after-mobile-light.png

before-desktop.png

Combined integration validation

Latest isolated candidate 9f7e6771bae3be3e5bd26a9579c43976c991dc43 (tree 16723f5210f18e86de41df66b38fe6adc4ff2532) combines #8441 at 4d0c8d3c, #8444 at e3fd9cea, and merged #8442 at aaa9ab0e. All 29 changed file blobs match their owning heads exactly. pnpm check, the prompt suite, 12 macro regressions, the real Game image route fixture, 18 decision regressions, card-search/pagination and memory-audience regressions all passed. Focused desktop/mobile Chromium/WebKit cases passed 9/9; shell smokes passed 7/7. Browser emulation, local fixture-provider proof, hosted checks and physical-device testing remain distinct evidence.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8441 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/8430-prompt-viewer-find` --- ### 📝 Commits (4) - [`b3264a7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b3264a734a872af4f3c3d8f260368bf3b0464423) chore: start prompt viewer find (#8430) - [`26288d1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/26288d1fc4d516e09623c76d368240b3d592a75d) feat: find text within assembled prompt viewer (#8430) - [`c8c343f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c8c343ff61e0645869fec4a7fc6c408360bdd17d) chore: shorten prompt Find hint - [`4d0c8d3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4d0c8d3c1e3f5cd6f60d7e51787263ed2af924fc) fix: support non-Latin prompt Find shortcuts ### 📊 Changes **4 files changed** (+435 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `docs/chats/peek-prompt.md` (+8 -0) ➕ `e2e/prompt-viewer-find.e2e.ts` (+214 -0) 📝 `packages/client/src/components/chat/PeekPromptModal.tsx` (+206 -16) 📝 `packages/client/src/localization/locales/en.json` (+7 -0) </details> ### 📄 Description ## Linked issue Closes #8430 ## Why this change Long assembled prompts are difficult to inspect on phones and tablets. Users need to find contradictions and stale state inside the viewer without exporting private prompt content. ## What changed - Added a visible Find field to the shared Assembled Prompt / Peek Prompt viewer, with highlighted literal, case-insensitive matches, a current/total counter, and previous/next buttons that wrap. - Ctrl/Cmd+F focuses Find inside the viewer across Latin and non-Latin layouts, preserving Dvorak and AltGr shortcuts. Enter and Shift+Enter navigate matches; keyboard focus stays inside the dialog without opening the mobile keyboard on entry. - Find searches every original message, including closed sections, history wrappers, and provider blocks. While searching, the full message text is shown; clearing Find restores collapsible sections. Prompt text and copied content stay unchanged. - Search rendering uses a deferred query and cached highlight tree for large prompts. Updated canonical English labels and the Peek Prompt guide. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Agent-run validation on `c8c343ff61e0645869fec4a7fc6c408360bdd17d`: - `pnpm install` and `pnpm check` passed on implementation commit `26288d1fc` (the final one-line English hint also passed localization and Prettier checks), including localization, formatting, workspace lint/type checks, E2E type checks, and production build. The existing `HomeProfessorMariChat.tsx` `serverRun` hook warning remains. - `PLAYWRIGHT_CLIENT_PORT=7860 PLAYWRIGHT_SERVER_PORT=7861 PLAYWRIGHT_MOBILE_CLIENT_PORT=7862 PLAYWRIGHT_MOBILE_SERVER_PORT=7863 pnpm regression:ui e2e/prompt-viewer-find.e2e.ts --workers=1 --output=.tmp/8430-ready-browser`: 6 passed across desktop Chromium, mobile Chromium, and mobile WebKit. - `PLAYWRIGHT_CLIENT_PORT=7860 PLAYWRIGHT_SERVER_PORT=7861 PLAYWRIGHT_MOBILE_CLIENT_PORT=7862 PLAYWRIGHT_MOBILE_SERVER_PORT=7863 PLAYWRIGHT_ONLY_PROJECT=desktop pnpm smoke:ui --output=.tmp/8430-smoke`: 7 passed. - Focused proof uses a 27.5k-token synthetic prompt in Roleplay and Conversation, through saved-message Peek and typed live preview. It covers hidden/wrapper content, first/last/wrapped navigation, Ctrl+F and Cmd+F, Enter/Shift+Enter, Tab wrapping, literal regex punctuation, Unicode, over 7,000 one-letter matches, no matches, clearing, and exact raw/copy text. Light/dark screenshots were visually inspected on desktop and mobile emulation. - Baseline source failed at the missing Find field; its screenshot/trace were preserved. Fixture-only failures (Roleplay Enter preference and a mobile Copy toast that remained hovered) were replayed unchanged, traced, and corrected without changing application behavior or raising timeouts. - Local CodeRabbit review: completed on the implementation. Earlier advice about deferred rendering and immediate toast dismissal was implemented. The final review reported a minor two-sentence hint, shortened afterward with localization/Prettier revalidated, and a trivial suggestion to avoid rebuilding keyed JSX when moving between matches. That optional optimization is deferred: React already reconciles stable keyed marks without rewriting prompt text; imperative per-mark updates would add state synchronization work without a demonstrated defect. No timing benchmark is claimed. Earlier responsiveness advice was implemented; a docs-follow-up finding is covered by #8443/#8445, and the toast dismissal was moved immediately after the copy assertion. - Local container build/run was unavailable: the Docker CLI could not connect to its stopped daemon socket. Hosted container validation remains a merge gate. Human follow-up: - Manually verify Find with a physical phone/tablet keyboard and touch controls, including the on-screen keyboard. Emulation does not prove physical-device behavior. - Manually verify the selected theme's match contrast with personal custom themes. ### Keyboard-layout review repair Repair head: `4d0c8d3c1e3f5cd6f60d7e51787263ed2af924fc`. - Reproduced the old shortcut failure before editing application code: Ctrl + Cyrillic `а` / `KeyF` left `defaultPrevented` false. The failing trace, screenshot and log remain in `.tmp/8430-nonlatin-before`. - Kept the existing typed `f` match and Alt guard, with a physical `KeyF` fallback only when the reported key is not an ASCII letter. No shared shortcut behavior was changed. - `pnpm check` passed after the repair. `node scripts/run-regressions.mjs --filter scripts/regressions/roleplay-streaming.regression.ts` passed 1/1; that script has no assertion tied to the reflowed viewer section JSX. - `PLAYWRIGHT_CLIENT_PORT=7860 PLAYWRIGHT_SERVER_PORT=7861 PLAYWRIGHT_MOBILE_CLIENT_PORT=7862 PLAYWRIGHT_MOBILE_SERVER_PORT=7863 pnpm regression:ui e2e/prompt-viewer-find.e2e.ts --workers=2 --output=.tmp/8430-nonlatin-after`: 6/6 passed across desktop Chromium, mobile Chromium and mobile WebKit. Each case checks Ctrl/Cmd + Cyrillic `а` / `KeyF`, typed `f` on another physical key, Dvorak `u` / `KeyF`, and AltGr negatives from the panel, Find input and scroll-area control, including focus and `defaultPrevented`. - Keyboard-layout coverage uses synthetic browser keydown events, not physical keyboard-layout calibration. - Audited the highlight variables: default highlight text derives from the selected accent; applied chat colors map it to the resolved custom control color and use the resolved action background. Arbitrary custom-theme color contrast remains a human verification item; no universal contrast claim is made. - Local CodeRabbit delta review against `c8c343ff6`: completed with 0 findings across the two changed files. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened - [ ] Version/release files updated (only if this PR includes a version bump) Updated `docs/chats/peek-prompt.md`. Translations are tracked by #8443 and coordinated in #8445. No version/release metadata changed. ## UI evidence (if applicable) Synthetic before/after proof: https://gist.github.com/SpicyMarinara/057c75894f82b8d7f43d635b38c7602d Downloaded PNG bytes were verified against the local artifacts. ![after-desktop-dark.png](https://gist.githubusercontent.com/SpicyMarinara/057c75894f82b8d7f43d635b38c7602d/raw/765b8b9ac587c77334e5c02f88cb6d83e85bf04e/after-desktop-dark.png) ![after-desktop-light.png](https://gist.githubusercontent.com/SpicyMarinara/057c75894f82b8d7f43d635b38c7602d/raw/f56f37a8e989e4adb0c4ed8ccd3e33345599dfcd/after-desktop-light.png) ![after-mobile-dark.png](https://gist.githubusercontent.com/SpicyMarinara/057c75894f82b8d7f43d635b38c7602d/raw/befc0dc3c682315e28c0e8ac64ec3173da8074b4/after-mobile-dark.png) ![after-mobile-light.png](https://gist.githubusercontent.com/SpicyMarinara/057c75894f82b8d7f43d635b38c7602d/raw/4b11bf9dbe90565f73ca06066cd4791cb729987b/after-mobile-light.png) ![before-desktop.png](https://gist.githubusercontent.com/SpicyMarinara/057c75894f82b8d7f43d635b38c7602d/raw/aec198d1d0392898630a195ea97d64b53cb6e92d/before-desktop.png) ## Combined integration validation Latest isolated candidate `9f7e6771bae3be3e5bd26a9579c43976c991dc43` (tree `16723f5210f18e86de41df66b38fe6adc4ff2532`) combines #8441 at `4d0c8d3c`, #8444 at `e3fd9cea`, and merged #8442 at `aaa9ab0e`. All 29 changed file blobs match their owning heads exactly. `pnpm check`, the prompt suite, 12 macro regressions, the real Game image route fixture, 18 decision regressions, card-search/pagination and memory-audience regressions all passed. Focused desktop/mobile Chromium/WebKit cases passed 9/9; shell smokes passed 7/7. Browser emulation, local fixture-provider proof, hosted checks and physical-device testing remain distinct evidence. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 16:45:54 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#8602
No description provided.