feat(feed): optional per-feed sender-in-title toggle
Add a per-feed senderInTitle flag (domain FeedState.senderInTitle ↔ FeedConfig.sender_in_title). When set, the feed generator prefixes each entry title with [Sender] (display name, falling back to the address). Exposed as an admin edit-form checkbox and across the REST API create/update/response schemas. Co-Authored-By: Claude Opus 4.7 <[email protected]>
This commit is contained in:
1 parent
7086526670
commit
e86beeeb8a
14 files changed
+234
-2
No files matched your search
@@ -147,6 +147,37 @@ describe("generateRssFeed", () => {
|
||||
expect(result).not.toContain("<item>");
|
||||
});
|
||||
|
||||
it("leaves the item title unprefixed by default", () => {
|
||||
const result = generateRssFeed(
|
||||
mockFeedConfig,
|
||||
mockEmails,
|
||||
BASE_URL,
|
||||
FEED_ID,
|
||||
);
|
||||
expect(result).toContain("Hello World");
|
||||
expect(result).not.toContain("[Alice]");
|
||||
});
|
||||
|
||||
it("prefixes the item title with the sender when sender_in_title is set", () => {
|
||||
const result = generateRssFeed(
|
||||
{ ...mockFeedConfig, sender_in_title: true },
|
||||
mockEmails,
|
||||
BASE_URL,
|
||||
FEED_ID,
|
||||
);
|
||||
expect(result).toContain("[Alice] Hello World");
|
||||
});
|
||||
|
||||
it("falls back to the email address when the sender has no display name", () => {
|
||||
const result = generateRssFeed(
|
||||
{ ...mockFeedConfig, sender_in_title: true },
|
||||
[{ ...mockEmails[0], from: "[email protected]" }],
|
||||
BASE_URL,
|
||||
FEED_ID,
|
||||
);
|
||||
expect(result).toContain("[[email protected]] Hello World");
|
||||
});
|
||||
|
||||
it("feed link points to the public read URL, never an admin path", () => {
|
||||
const result = generateRssFeed(
|
||||
mockFeedConfig,
|
||||
|
||||
Reference in new issue
Block a user