Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(web): apply tag blurring to attachment previews - #6312

Open
fzlzjerry wants to merge 2 commits into
usememos:mainfrom
fzlzjerry:6127-blur-tagged-attachments
Open

fix(web): apply tag blurring to attachment previews#6312
fzlzjerry wants to merge 2 commits into
usememos:mainfrom
fzlzjerry:6127-blur-tagged-attachments

Conversation

@fzlzjerry

@fzlzjerry fzlzjerry commented Sep 11, 2026

Copy link
Copy Markdown

Closes #6127
Closes #6189

Memo details already apply tag-based content blurring, but the attachment library renders the same images without it.

This applies the existing tag rules to library thumbnails and full-screen previews. Linked memo lookups share the existing query cache and are deduplicated by memo; no extra memo requests are made when no blur rule is enabled. Pending or unavailable memo data stays concealed.

Each item has an explicit reveal button. Opening another full-screen item keeps that item's blur state, and closing the preview resets its reveal. Videos do not autoplay behind the blur, and motion-photo playback controls appear only after reveal. Paired Live Photos check both linked memos rather than only the still image's memo.

The change is limited to presentation. It does not change memo visibility, authentication, file permissions, filenames or direct file links, and adds no dependencies.

Validation:

  • pnpm lint
  • pnpm test --maxWorkers=2: 1,376 tests passed, including 13 new tests through the actual attachments page, providers, query hooks and preview components. RPC boundaries are mocked in these tests; the original implementation fails 12 of the 13 cases.
  • pnpm build and pnpm release
  • Browser checks against a real SQLite instance: desktop/mobile Chrome and Firefox; delayed settings and memo lookups; lookup failure; disabled rules; archived memos; image reveal/navigation; actual MP4, Apple Live Photo and Android motion-photo playback.
  • Real pagination from 49 to 51 displayed media items retained the six blurred previews and made only three memo-detail requests.

To check manually, add a blur rule to a tag, attach an image to a matching memo, then open Attachments. The thumbnail should stay blurred until revealed. Also open a normal image and navigate to a tagged item's full-screen preview; that item should still require its own reveal.

Narrow-screen follow-up: the reveal label wraps within the thumbnail instead of being clipped. The production mobile check now verifies both button bounds and text overflow, in addition to the reveal/navigation behavior.

@fzlzjerry
fzlzjerry requested a review from a team as a code owner September 11, 2026 06:32
Copilot AI lite review requested due to automatic review settings September 11, 2026 06:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: c2bfd1d7-f332-4088-88a9-762af6a25d83

📥 Commits

Reviewing files that changed from the base of the PR and between e38ab9f and 4a36d76.

📒 Files selected for processing (1)
  • web/src/components/BlurredMedia.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • web/src/components/BlurredMedia.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


Walkthrough

The attachment library now derives blur state from memo tag settings and applies it to gallery and full-screen media previews. Images, videos, and motion photos remain concealed while linked memo data loads or fails. Each preview requires explicit reveal, and navigation or rule changes reset concealment. Tests cover lookup behavior, loading and error states, reveal lifecycle, videos, and paired Live Photos.

Suggested reviewers: bluedbird

Priority: ➖ Normal

Merge Risk: ⚪ Minimal · up to 4a36d

The current change has no identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 7 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR satisfies the coding objectives in [#6127] and [#6189]. useBlurredAttachmentItems reuses each attachment's linked memo, deduplicates memo lookups, applies isMemoBlurred, and conceals items …
Out of Scope Changes check ✅ Passed The changed code stays within [#6127] and [#6189]. It adds presentation-layer concealment, memo-based blur evaluation, preview state handling, and supporting tests. The PR does not change memo visibil…
Title check ✅ Passed The title clearly and concisely describes the main change: applying tag-based blurring to web attachment previews.
Description check ✅ Passed The description directly explains the attachment blurring behavior, reveal controls, memo lookup handling, scope limits, and validation results.
  • Fix all pre-merge checks with AI

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR] Pictures related to blurred tag should be blurred [Feature Request] Blur attachments from notes with a blurred tag

2 participants