Repository navigation
Description
Parent
#249 Deepen the installed PWA. Sibling of #247, #248, and #251. Not blocked by them.
What to build
Add caret find on the open pad. The user types a query, sees hits, and steps the caret to the next or previous hit.
Filter stays Filter. It hides Sections. It is not find. Rename the Filter field so it no longer says “Find in document”.
Acceptance criteria
- Desktop and phone: a Find control opens a find bar on the pad. It does not open Filter.
- That control sits next to Filter (same desktop toolbar, same phone host). Do not add a new 32 by 32 docked control.
- Desktop:
Mod-fopens that bar and does not open the browser find dialog. - Escape closes the bar and restores the fold snapshot taken when the bar opened.
- Enter moves to the next hit. Shift-Enter moves to the previous hit. The caret lands in the current hit.
- The query is a case-insensitive literal. Empty query clears hits. No regex. No replace.
- Search walks the pad document, including Title. It does not search Pad title, chat, or History.
- A viewer under Read-only or Editing lock can still find. History view has no find bar.
- The current hit is visible. Unfold its Section. Keep every other fold from the open snapshot.
- Hit paint uses a new decoration class. It does not write the Highlight mark. It does not reuse the Filter wash.
- A polite live region outside the editor speaks the current index and the hit count, for example
3 of 12. - More than 200 hits: paint at most 200, show
200+, and step only those 200. - Find does not change the URL. It does not write filter path segments.
- Filter field
aria-labeland placeholder no longer say “Find in document”. The panel title stays Filter. - Light and dark, desktop and phone: the bar is a compact pad control, not a BottomSheet.
Agent Brief
Category: enhancement
Summary: Real find on the pad, plus an honest Filter label.
Current behavior:
The Filter panel title is Filter. Its field still says “Find in document”. Apply hides unmatched Sections. It does not step hits or move the caret.
Folded Section bodies use display: none. Browser find cannot see them. The pad does not bind Mod-f.
matchSections skips Title and the nodes under Title. It is a Section index for Filter. It is not the hit engine.
A viewer can already run Filter. History unmounts the pad editor.
Desired behavior:
Open a find bar from a toolbar control next to Filter. On desktop, Mod-f opens the same bar and steals browser find. That steal is required, because folded text is hidden from the page.
Walk the live pad document. Include Title. Ignore Pad title, the chat composer, and History.
Treat the query as a trimmed, case-insensitive substring. Do not add whole-word, regex, or replace.
When the bar opens, snapshot the current folds. For the current hit, unfold that Section only. Leave the rest of the snapshot in place. Do not replace the whole fold set with one id. Closing the bar restores the snapshot. Filter can stay on.
Paint hits with a new inline decoration class. Do not write the stored Highlight mark. Do not reuse the Filter highlight class. Do not put a live region inside the editor.
Cap paint and stepping at 200 hits. If there are more, show 200+.
A Read-only viewer can find. An Editing lock still allows find. Do not run find when History has unmounted the pad.
#175 is theme flip and a two-key help dialog. Do not add find to that help table.
Key interfaces:
- Caret find — bar, next, previous, caret on the current hit
- Filter — Section hide only; field no longer claims find
- Title — first heading; included in search
- Pad title — header name; not searched
- Section — heading plus following nodes; unfold the one that holds the current hit
- Editing lock — blocks edits; does not block find
- Highlight — stored mark; do not use it to paint hits
Out of scope
- Replace and replace-all
- New REST or saved queries
- Searching chat, Pad title, or History
- Opening Filter on
Mod-f - Extending Filter into a hit stepper
- Adding find to the App keyboard shortcuts: theme flip and a help dialog #175 help table
- Command jump
- Slash menu (Slash menu to insert a block #251)
- Focus mode
Activity
HMarzban commentedon Sep 9, 2026
Sibling slash menu is #251. Both sit under #249.
HMarzban commentedon Sep 9, 2026
Cohesion
Find is pad text. It is not Settings → Documents “Search documents”. It is not Filter.
iOS and macOS Safari
Mod-fmust open the find bar and stop Safari’s own find. Folded text isdisplay: none, so Safari find misses it.HMarzban commentedon Sep 9, 2026
Safari follow-up from iOS find slash jump:
preventDefaultonMod-fcan steal Find on Page. Prove that steal.Cmd-fevents never reach JS. Keep the Find control. A failed steal is not a bug.matchSectionsas the hit engine. It skips Title.HMarzban commentedon Sep 9, 2026
Spec review: Find sits next to Filter. No new docked 32 by 32 control.
HMarzban commentedon Sep 10, 2026
UX cohesion (epic #249):
Find is caret step through pad text. It is not Filter (hide Sections) and not Command jump (go to a place).
The bar is a compact L0 pad control next to Filter (
ToolbarButton+ daisyUIinput). Not a BottomSheet, not FilterPanel, not Spotlight.This card owns open, close, Escape, and the polite live region. #248 does not cover the find bar. Do not add Find to the #175 help table.
HMarzban commentedon Nov 3, 2026
Status, 2026-11-03. Built in f167903, which ships in v2.1.0. #393 then moved the bar to float in the editor column and made Mod-F the only desktop entry (f083ac6, 23b8939). The #308 fix (99a2444) is pushed and deployed on 2026-11-03. It hides the phone edit toolbar on a read-only pad. Left:
HMarzban commentedon Nov 4, 2026
Status, 2026-11-04. The acceptance list predates #393. Read it with these changes: there is no desktop toolbar Find control, Mod-F is the only desktop entry, and the cap is 9,999 steps with 200 painted.
Left:
HMarzban commentedon Nov 4, 2026
Simulator check, 2026-11-04. The iPhone read-only row is blocked: the phone Find bar never opened, because a new defect sends the user to Home.
Setup: iPhone 17 Pro simulator, iOS 26.5, Safari, signed out. Local
mainat91aeeaa8a, and productiondocs.plus/demo.Defect: on a phone, the drawer's Find and Filter buttons go to Home (
/).docs.plus/demo) with one tap. So it is not from the unpushed local commits.qa-device-ro-1026) and on an editable pad (qa-device-target-1026).closeTocTheninTocModal.tsx, which callscloseModal()and then the action. Closing the drawer with X keeps the pad. A pad left alone for 45 s stays put.Also seen: the Edit button shows on the read-only pad while the keyboard is down, and a tap does nothing (
enableEditorreturns early whenisDocumentEditingLocked()is true).Left:
HMarzban commentedon Nov 4, 2026
Correction, 2026-11-04: the drawer Find and Filter defect in my comment above is not real. It came from the simulator's input, not from the app.
How I found it: I added a temporary on-screen log of history calls, touches and clicks, then repeated the same taps.
mousedown,mouseupandclickfired at the previous tap point, (24, 24).Go to homelink. So the stale click opened Home through a NextRouter.push('/'). Nohistory.back()was involved.Checks that pass:
docs.plus/demo.html.m_mobile): drawer → Find opens the Find bar. Drawer → Filter opens the Filter sheet, and the sheet takes over the drawer's history entry. Closing the sheet leaves the pad entry, and the marker is gone. The URL stays on the pad throughout.No code change was made.
Still left on this issue:
HMarzban commentedon Nov 9, 2026
Device checks, 2026-11-09. Local stack. These cover the two legs left in the 2026-11-04 status.
iPhone, read-only pad. QA iPhone 17 Pro simulator, iOS 26.5, Safari 26.5. Pad
qa-device-ro-1026, viewer Swarm Actor 1 (not the owner). Touch and click points matched on every tap, so the 2026-11-04 click lag is gone.visualViewport.height404 against 714).te, typed on the on-screen keys. Next and Previous step 1 of 4 → 2 → 3 → 2 → 1 → 4 of 4. Focus and the keyboard stay up.contenteditable="false".macOS Safari 27.0.1, Cmd-F. Driven by safaridriver on a fresh pad.
Meta+fwith the pad focused haddefaultPrevented: true. The pad Find bar opened (role=search), and its input took focus.ftyped into the field was not prevented.Seen, not a blocker: after Find closes on the read-only pad, the Edit button shows again. This is the known UX question.
Left:
HMarzban commentedon Nov 9, 2026
Maintainer check, 2026-11-09. A real Cmd-F in Safari on production (
docs.plus/qa-hand-checks-1109): the pad Find bar opened, and Safari's own Find bar did not. That was the last leg. With the simulator row and the safaridriver run above, every leg has passed. Closing.