mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #4550] [MERGED] feat(noodle): new-since-last-visit divider and counter (Slice 8f-5, plus Noodle), and blurred locked teasers #6418
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#6418
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/4550
Author: @Gunterlie
Created: 8/4/2026
Status: ✅ Merged
Merged: 8/4/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/noodler-locked-blurred-teaser📝 Commits (10+)
56a9f1afix(noodler): restore blurred teasers for locked posts5bb36d9feat(noodler): add the new-since-last-visit divider and entry-point counter3ac7fcbfeat(noodle): carry the divider and counter to the public timelinece40e0dfix(noodle): put the divider on the timeline, not in search results13d6fd1fix(noodle): show the timeline counter from NoodleR, and share one count2868940Merge branch 'staging' into fix/noodler-locked-blurred-teaserc7793e6fix(noodle): address review on the unseen divider, teaser fallback, and its tests306f4c5Merge remote-tracking branch 'origin/fix/noodler-locked-blurred-teaser' into fix/noodler-locked-blurred-teaser62b89abfix(noodle): keep feed-seen timestamps monotonic and type the sharp loader53b8b89Merge branch 'staging' into fix/noodler-locked-blurred-teaser📊 Changes
19 files changed (+759 additions, -107 deletions)
View changed files
📝
.github/plans/noodl-split/noodler-pr-split-living-plan.md(+44 -17)📝
package.json(+1 -1)📝
packages/client/src/components/noodle/NoodleHome.tsx(+83 -32)📝
packages/client/src/components/noodle/NoodleShell.tsx(+45 -0)📝
packages/client/src/components/noodle/NoodlerHome.tsx(+77 -2)📝
packages/client/src/components/noodle/NoodlerPostCard.tsx(+12 -5)📝
packages/client/src/hooks/use-noodle.ts(+22 -1)📝
packages/client/src/localization/locales/en.json(+2 -0)📝
packages/server/src/routes/game-assets.routes.ts(+3 -33)📝
packages/server/src/routes/noodle.routes.ts(+24 -12)📝
packages/server/src/services/noodle/noodle-noodler-media.ts(+37 -2)📝
packages/server/src/services/storage/noodle.storage.ts(+15 -1)➕
packages/server/src/utils/sharp.ts(+36 -0)📝
packages/shared/src/index.ts(+1 -0)📝
packages/shared/src/schemas/noodle.schema.ts(+7 -1)📝
packages/shared/src/types/noodle.ts(+10 -0)➕
packages/shared/src/utils/noodle-unseen.ts(+81 -0)➕
scripts/regressions/noodle-feed-seen.regression.ts(+165 -0)➕
scripts/regressions/noodle-locked-teaser.regression.ts(+94 -0)📄 Description
Why
Slice 8f-5 — the watching surface. NoodleR gave a returning user no reason to come back and no way to see where they stopped. The plan calls this "the cheapest real win in the document" and split it out specifically so a scope cut could not eat it:
Also carries a side fix found while working in the same files: locked posts had stopped showing a blurred image at all.
8f-5: divider and counter
One timestamp, per viewer persona.
noodlerFeedSeenAtjoinsNoodleAccountSocialSettingsnext to the existingnotificationsReadAt, and rides the account-settings patch route that already exists — no new endpoint. Per persona rather than per user is the plan's explicit requirement, and it matters: NoodleR follows and locked-post access are already persona-scoped, so an account-wide timestamp would let visiting as one persona silently clear another persona's counter despite them having entirely different Following feeds.It advances only once the feed is actually shown, not on app entry and not while discovery search has replaced the feed — again per the plan. The subtlety that costs a line of thought: advancing the stored timestamp the moment the feed renders would erase the divider out from under the reader, so the value the divider reads is frozen per persona at that moment while the stored one moves on.
The divider sits at the boundary after the run of new posts (the feed is newest-first, so everything new is one contiguous run at the top). It is shown only when there is something on both sides of it — with no older posts it would sit at the bottom labelling nothing, and with no new ones it says nothing.
The counter is a badge on the NoodleR mode toggle, so it is visible from the Noodle side — which is where the user is when they are not already watching NoodleR. It excludes the viewer's own stage profile's posts, which are never "new" to the person who just wrote them, and stays silent for a persona that has never been shown the feed rather than announcing the entire backlog on first run.
countNoodlerPostsSince()lives inpackages/shared/src/utils/noodle-unseen.ts— pure, shared, and directly testable rather than buried in a hook.Carried to public Noodle
Not in the plan — 8f-5 scopes to NoodleR — so flagging it as an explicit addition rather than something folded in silently. The same blind spot exists on Noodle: characters post while you are elsewhere, and nothing tells you how many landed. The existing bell counts things addressed to you (mentions, replies, follows), not new posts in your timeline.
noodleFeedSeenAtis a separate field fromnoodlerFeedSeenAt, not one shared value — otherwise opening either surface clears the other's counter, which is the same cross-contamination the per-persona scoping exists to prevent.The one thing that needed real care: Noodle's timeline sorts by latest activity, not creation time. Counting by
createdAtwould put the divider somewhere other than the boundary the reader sees. So both the count and the divider measure the same value the sort does — a post bumped by a new reply is unseen again. That expression was inline and evaluated twice per comparison; it is now onetimelineActivityAt()shared by the sort and both consumers.The badge and the divider are shared components in
NoodleShellrather than a second copy of each.Side fix: blurred teasers for locked posts
A locked post with an image rendered an empty grey frame. The onboarding wizard, meanwhile, teaches the locked card using a pre-blurred demo image (
NoodlerBulkCreatePanel.tsx:77), described there as "what the user is being taught to recognise" — so the tutorial promised something the feed did not deliver.Slice 8f-2 caused this deliberately, and its reasoning was right as far as it went: "a browser-side blur would still disclose the original image bytes." True — the bytes are in the page. But the remedy was to withhold the image entirely, which removed the teaser as a side effect.
Fixed by blurring server-side instead:
readNoodlerLockedTeaser()downscales to 24px before blurring, which makes the derivative destructive rather than merely obscured, and caches it beside the original.resolveReadableNoodlerPostnow reportslockedrather than refusing, so the access-checked media route can answer a locked viewer with the teaser;resolveGatedNoodlerPostchecks the flag, leaving interaction gating unchanged. The viewer projection keepsimageUrlfor locked posts only when it points inside the NoodleR media namespace — media stored elsewhere has no derivative and is still withheld. The card's CSS blur dropsblur-xl→blur-sm, since it is presentation over an already-blurred image now, not the protection.Fail-closed throughout: no
sharp(Android/Termux has no prebuild), undecodable source, or missing file all serve nothing and leave the empty frame — today's behaviour, never the original.Also extracted the lazy
sharploader out ofgame-assets.routes.tsintopackages/server/src/utils/sharp.tsrather than copying it. No behaviour change for game assets.Plan updated
noodler-pr-split-living-plan.mdstill described 8f-1/2/3/4/8g as unmerged onbig-chungus-1; #4515 shipped them on 2026-08-03. The status table and implementation-status section now reflect that, record 8f-5 as done here, and note the locked-media defect so it is not rediscovered. 8f-6 (creator-page operator area, source-changed/source-missing notices) is now the only remaining 8f unit.Validation already run
pnpm checkandpnpm regression:noodlepass on this head. Two new regressions, both wired intoregression:noodle:noodle-feed-seen.regression.ts— the timestamps survive a storage round-trip, one persona's visit does not clear another's, a Noodle visit does not disturb the NoodleR timestamp, and the counting rules hold (own posts excluded, no-timestamp means zero, unparseable timestamp means zero, a post exactly at the boundary counts as seen).noodle-locked-teaser.regression.ts— the teaser is not the original bytes, is ≤24px wide and under a quarter the size, is reused from cache without rebuilding, and returns null on an unreadable source. Wheresharpcannot load it pins the fail-closed branch instead.The boxes below are for the human contributor and are intentionally left unchecked.
Test plan
pnpm checkpnpm regression:noodle.teaser.jpgsharploader extractionSummary by CodeRabbit
New Features
Bug Fixes
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.