Skip to content

feat: critical notes with modal popup + popover & Don't show again - #7146

Merged
nbats merged 8 commits into
fmhy:mainfrom
eli32-vlc:t3/critical-notes-popup-dismissal
Nov 10, 2026
Merged

nbats merged 8 commits into
fmhy:mainfrom
eli32-vlc:t3/critical-notes-popup-dismissal

Conversation

@eli32-vlc

Copy link
Copy Markdown
Contributor

Summary

Sort all 105 notes in docs/.vitepress/notes/ into critical (must-read) vs non-critical (tips/enhancements). 18 notes that involve safety, malware, bootloops, account bans, data loss, fake download buttons, adware, or broken installers are now *-critical.md with their first heading ending in "Critical"; the remaining 87 keep their current names.

Critical notes render a red ⚠ Critical badge in place of the note link:

  • Clicking the badge opens the same anchored popover as normal notes (FloatingVue, click-only) with title + note body + Source footer + Close only (no dismissal side-effects).
  • Clicking the main entry link (e.g. Foxit) is intercepted in Layout.vue and opens a centered modal dialog (réka-ui, modeled on Base64Dialog) with a Don't show again checkbox + Cancel/Continue. Continue opens the real link in a new tab; dismissed clicks pass through. Dismissals are stored per-note in localStorage (fmhy-critical-notes-dismissed) as {noteId: contentHash} — sha256 (truncated to 12 chars) computed in utils/tooltips.ts; editing a critical note changes its hash and re-prompts all users.

Non-critical notes are untouched (existing hover/click tooltip via Tooltip.vue). 34 link occurrences across 13 docs pages updated, including 3 previously misleading [Note] labels (sanet, liteapk-modyolo, yts-yify) fixed to [Critical].

Files changed

Content (59 files)

  • 18 docs/.vitepress/notes/*.md renamed to *-critical.md (content-sorted; heading updated to "… Critical")
  • 13 docs pages (file-tools, mobile, gaming, privacy, reading, system-tools, video-tools, video, internet-tools, downloading, beginners-guide, sandbox, …) — link URLs + labels updated
  • .github/CONTRIBUTING.md — documents *-critical.md vs *-note.md + critical: true/false frontmatter

New (5 files)

  • docs/.vitepress/theme/components/CriticalBadge.vue — inline red badge + popover
  • docs/.vitepress/theme/components/CriticalDialog.vue — modal dialog with targetUrl (Continue opens the link)
  • docs/.vitepress/theme/composables/criticalNotes.ts — per-note localStorage ({noteId: hash}, fail-open, SSR-guarded)
  • docs/.vitepress/theme/composables/criticalRegistry.ts — runtime registry so Layout.vue can populate the dialog
  • docs/public/critical.svg — badge icon (same artwork as note.svg)

Modified (7 files)

  • docs/.vitepress/theme/Layout.vue — capture-phase click interceptor + CriticalDialog hosting, criticalTargetUrl tracking; fallback to .critical-badge-hidden-body
  • docs/.vitepress/utils/markdown.ts — critical → <CriticalBadge>, non-critical → <Tooltip> (unchanged)
  • docs/.vitepress/utils/tooltips.ts — critical flag (filename convention + frontmatter override) and contentHash
  • docs/.vitepress/theme/index.ts + docs/.vitepress/theme/components/VPLocalSearchBox.vue — CriticalBadge registered (global + search stub)

Test plan

  • pnpm eslint clean, pnpm prettier -w ., node scripts/lint-markdown.js passes
  • pnpm docs:dev --port 5173, then in preview:
    • /sandbox (has both a Critical and a non-critical example) and /file-tools / /reading:
      • Click Pangu7/Foxit (main link) → modal appears with full warning text; check Don't show again + Continue → link opens; click again → navigates directly
      • Click the Critical badge → popover appears next to the badge with same text; Close only; verify badge is unchanged after closing
      • Buster / Note icon → normal tooltip, unchanged (no red badge, no modal)
    • Search for a critical note's text → no leaked results (same as normal notes)
    • Mobile/touch, keyboard (Tab → Enter, Esc), light/dark/monolith themes, prefers-reduced-motion, forced-colors

Notes

  • The repo requires Issues to be created before opening a PR (contributing guide: don't spam un-tested links). This PR is large (content + theme). Happy to discuss the critical set — I classified by content: safety/security, bans, data loss, fake buttons, adware, broken versions.

Sort all 105 notes in docs/.vitepress/notes/ into critical (must-read)
vs non-critical (tips/enhancements). 18 notes that involve safety,
malware, bootloops, account bans, data loss, fake download buttons,
adware, or broken installers are now *-critical.md with their first
heading ending in "Critical"; the remaining 87 keep their current names.

Critical notes render a red ⚠ Critical badge in place of the note link:
- Clicking the badge opens a FloatingVue popover (like normal notes)
  with Close only — no dismissal side effects.
- Clicking the main entry link (e.g. Foxit) is intercepted in
  Layout.vue and opens a centered modal dialog (reka-ui, modeled on
  Base64Dialog) with a "Don't show again" checkbox + Cancel/Continue.
  Continue opens the real link; dismissed clicks pass through. Dismissals
  are stored per-note in localStorage (fmhy-critical-notes-dismissed) as
  {noteId: contentHash} (sha256 truncated to 12 chars, computed in
  tooltips.ts); editing a critical note changes its hash and re-prompts.

Non-critical notes are untouched (existing hover/click tooltip via
Tooltip.vue), as are all link relocations (34 occurrences across 13
docs pages, incl. misleading [Note] labels fixed to [Critical]).

Also adds Contributing docs, a /sandbox test row, max token 6k.
@github-actions github-actions Bot added core Core changes to our VitePress setup docs Content changes labels Nov 7, 2026
Match the non-critical note tooltip behaviour:
- Badge popover opens on hover (tap on touch devices) via
  useMediaQuery, same 50ms show/hide delay as Tooltip.vue
- Remove the Close action row and its dead handler/CSS; auto-hide,
  Esc and click-outside are the close paths now

The main-link modal (Don't show again) is unchanged.
Normal note tooltips (Tooltip.vue) have no hover styling on their
trigger, so the Critical badge shouldn't either. Removes the :hover
rule and its transition; cursor + focus-visible outline remain.
…up-dismissal

# Conflicts:
#	docs/file-tools.md
Match the chat review notes: keep one icon style for all notes and let
colour carry the severity, so the page never reads as a wall of words.

- Warning notes now use the same note.svg glyph as regular notes, tinted
  red; the "Critical" pill/label is gone from the UI
- Add fixed --fmhy-note-icon / --fmhy-note-icon-warning tokens (swarm vs
  carnation) so info vs warning stay distinguishable in every theme,
  including red and monochrome, where --vp-c-brand-* and
  --vp-custom-block-danger-* are themed away
- Regular notes now read --fmhy-note-icon instead of text-primary, giving
  both icons identical sizing/geometry plus the same hover affordance
- Dialog title fallback "Warning", icon/checkbox/outline use the fixed
  warning hue, primary button back to brand button colours
- Note headings end with "Warning"; the four [Critical] link labels
  become [Warning]; CONTRIBUTING documents the blue/red icon split and
  keeps the *-critical.md filename suffix as an internal marker
- Drop docs/public/critical.svg (no longer referenced)
The rewrite dropped the bg-current utility from the masked span, so the
mask had no background colour to paint through and the icon rendered
blank. Restores it to match Tooltip.vue.
Restores the coloured border the warning popover had before the icon
refactor, now using the fixed --fmhy-note-icon-warning token so it stays
red in every theme.
@nbats
nbats marked this pull request as draft November 9, 2026 09:47
@nbats
nbats marked this pull request as ready for review November 10, 2026 22:58
@nbats
nbats merged commit 3fc2d2c into fmhy:main Nov 10, 2026
1 check passed
@eli32-vlc eli32-vlc mentioned this pull request Nov 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core changes to our VitePress setup docs Content changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants