fix(render-helper): strip the Lumen "Posted via" byline - #1728
Conversation
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 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. Comment |
PR Summary by QodoStrip Lumen bylines and adjacent separators from rendered replies
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
1. Lumen filter strips inline prose
|
| return !(l.includes('posted from liketu speak') && l.includes('auto-transcrib')); | ||
| }) | ||
| .filter(item => item.toLowerCase().includes('originally posted through [scrobble.life') === false) | ||
| .filter(item => item.toLowerCase().includes('*posted via lumen') === false) |
There was a problem hiding this comment.
1. Lumen filter strips inline prose 📎 Requirement gap ≡ Correctness
The new Lumen cleanup filter removes every line containing *posted via lumen, including ordinary user-authored prose such as I *posted via Lumen yesterday*, instead of only footer lines beginning with that marker. Because cleanReply processes complete post bodies and summaries, this can silently delete legitimate content and violate the requirement to preserve non-footer mentions.
Agent Prompt
## Issue description
Update the Lumen cleanup filter so it removes only actual footer lines whose content begins with `*posted via lumen`, while preserving ordinary prose that quotes, discusses, or otherwise contains the italicized phrase. Ensure the separator lookahead uses the same footer-specific matching rule so a preceding horizontal rule is not removed for ordinary content.
## Issue Context
Compliance ID 1 requires plain and proxied-user Lumen footers to be removed while ordinary mentions remain intact. `cleanReply` processes complete post bodies and post summaries, so an unrestricted substring match can cause user content to disappear. Add coverage for prose containing the italicized phrase and for a horizontal rule before such prose, while preserving removal of the actual footer and its optional `by <user>` suffix.
## Fix Focus Areas
- packages/render-helper/src/methods/clean-reply.method.ts[8-10]
- packages/render-helper/src/methods/clean-reply.method.ts[44-44]
- packages/render-helper/src/methods/clean-reply.method.spec.ts[280-285]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 35edb74227
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| return !(l.includes('posted from liketu speak') && l.includes('auto-transcrib')); | ||
| }) | ||
| .filter(item => item.toLowerCase().includes('originally posted through [scrobble.life') === false) | ||
| .filter(item => item.toLowerCase().includes('*posted via lumen') === false) |
There was a problem hiding this comment.
Restrict the Lumen filter to the actual footer
When ordinary prose contains an italicized phrase such as I *posted via Lumen* yesterday, this substring predicate removes the entire line. Because cleanReply processes all rendered bodies rather than only entries tagged lumen/1.0, legitimate non-footer content is lost; anchor the match to the complete terminal byline, including its closing * and optional by ... suffix.
Useful? React with 👍 / 👎.
Closes #1727
Lumen (app
lumen/1.0) appends---\n*Posted via Lumen*to every post and comment, with aby <user>suffix for lite accounts posting through a container. This adds it to the app-footer filters incleanReplyand extends the separator lookahead introduced for scrobble.life so the---directly before the byline is dropped too. Unrelated horizontal rules are untouched. The marker includes the leading asterisk so a body that merely mentions posting via Lumen is not stripped.Test plan
by <user>footer, unrelated hr preserved, plain mention preserved.markdown2Htmlcontain no byline and no<hr>.vitest runin packages/render-helper: 24 files, 1332 tests green. eslint and tsc clean.