Skip to content

Rename 'Markdown Summary' to 'Feed Tile Summary' for notebooks#4113

Merged
hlbmtc merged 8 commits into
mainfrom
claude/issue-4089-20260120-1423
Jan 21, 2026
Merged

Rename 'Markdown Summary' to 'Feed Tile Summary' for notebooks#4113
hlbmtc merged 8 commits into
mainfrom
claude/issue-4089-20260120-1423

Conversation

@SylvainChevalier
Copy link
Copy Markdown
Contributor

@SylvainChevalier SylvainChevalier commented Jan 20, 2026

Summary

This PR renames the "Markdown Summary" field to "Feed Tile Summary" and adds it to the frontend notebook creation form.

Changes

Backend:

  • Renamed field from markdown_summary to feed_tile_summary in Notebook model
  • Created migration 0029_rename_markdown_summary_to_feed_tile_summary.py
  • Updated NotebookSerializer, NotebookAdmin, translation, and versioning services

Frontend:

  • Added field to notebook creation form at /create/notebook/
  • Updated TypeScript types and all components using the field
  • Added translation strings for field label and placeholder

The field is now more discoverable and helps prevent raw markdown from appearing on feed tiles.

Fixes #4089


Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added ability to provide custom summary text for feed tiles; system auto-generates summaries from notebook content if not provided.
    • Introduced new form field for entering custom feed tile summaries during notebook creation and editing.
    • Added multi-language support for the new feed tile summary feature (English, Czech, Spanish, Portuguese, Simplified Chinese, Traditional Chinese).

✏️ Tip: You can customize this high-level summary in your review settings.

- Renamed field from markdown_summary to feed_tile_summary in Notebook model
- Created migration 0029_rename_markdown_summary_to_feed_tile_summary.py
- Updated NotebookSerializer, NotebookAdmin, translation, and versioning
- Added field to frontend notebook creation form at /create/notebook/
- Updated TypeScript types and all frontend components using the field
- Added translation strings for the new field label and placeholder

This makes the field purpose clearer and more discoverable for users
creating notebooks, reducing issues with raw markdown on feed tiles.

Fixes #4089

Co-authored-by: Sylvain <SylvainChevalier@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 20, 2026

Warning

Rate limit exceeded

@hlbmtc has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 0 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 1d4a773 and 255a7d3.

📒 Files selected for processing (1)
  • posts/migrations/0029_remove_notebook_markdown_summary_and_more.py
📝 Walkthrough

Walkthrough

This PR systematically renames the "Markdown Summary" field to "Feed Tile Summary" throughout the application—including frontend forms and display components, backend models, database schema, serializers, and translation resources across six languages—enabling users to customize feed tile text via the frontend notebook creation form.

Changes

Cohort / File(s) Change Summary
Translation Files
front_end/messages/en.json, front_end/messages/cs.json, front_end/messages/es.json, front_end/messages/pt.json, front_end/messages/zh.json, front_end/messages/zh-TW.json
Added new translation keys feedTileSummary and feedTileSummaryPlaceholder across six language files, providing UI labels and placeholder text for the renamed field.
Frontend Components
front_end/src/app/(main)/(home)/components/research_and_updates.tsx, front_end/src/components/news_card.tsx, front_end/src/components/post_card/notebook_tile.tsx
Updated display logic to render feed_tile_summary instead of markdown_summary with fallback to getMarkdownSummary() when the field is empty.
Frontend Form
front_end/src/app/(main)/questions/components/notebook_form.tsx
Added textarea input for feed_tile_summary field in notebook creation/edit form, integrated with form schema and defaultValue for edit mode.
Type Definitions
front_end/src/types/post.ts
Updated Notebook type to replace markdown_summary: string with feed_tile_summary: string.
Backend Models & Admin
posts/models.py, posts/admin.py
Replaced markdown_summary field with feed_tile_summary TextField in Notebook model; updated admin list_display accordingly.
Serializers & Translatable Fields
posts/serializers.py, posts/translation.py
Updated NotebookSerializer and NotebookWriteSerializer to expose feed_tile_summary instead of markdown_summary; updated NotebookTranslationOptions.fields for translation coverage.
Services
posts/services/versioning.py
Updated snapshot field extraction in _get_notebook_snapshot() to include feed_tile_summary instead of markdown_summary.
Database Migration
posts/migrations/0029_remove_notebook_markdown_summary_and_more.py
Migration removes eight locale-prefixed markdown_summary fields and adds corresponding feed_tile_summary locale variants, maintaining translatable field structure.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A hop, skip, and field rename away!
From markdown summaries in shadows to feed tiles on display,
Now users craft custom summaries, no admin delays,
Pretty previews on feeds—the rabbit's way! ✨

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the main change: renaming 'Markdown Summary' to 'Feed Tile Summary' across the notebook model and frontend components.
Linked Issues check ✅ Passed The PR fully addresses both objectives from issue #4089: the field is renamed to 'Feed Tile Summary' and added to the frontend notebook creation form with proper translations.
Out of Scope Changes check ✅ Passed All changes are scoped to the field rename and frontend form addition; no unrelated modifications detected beyond the linked issue requirements.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
posts/services/versioning.py (1)

64-65: Pre-existing bug: Notebook snapshot assigned to wrong key.

The notebook snapshot is assigned to snapshot["conditional"] instead of snapshot["notebook"]. This appears to be a copy-paste error from the conditional branch above (lines 60-62).

Proposed fix
             elif post.notebook_id:
-                snapshot["conditional"] = cls._get_notebook_snapshot(post.notebook)
+                snapshot["notebook"] = cls._get_notebook_snapshot(post.notebook)
posts/serializers.py (1)

116-122: Add feed_tile_summary to NotebookWriteSerializer.fields and update the write path to persist it.

The form correctly submits feed_tile_summary, but the serializer drops this field during validation because it's not listed in the serializer's fields. Additionally, update_notebook() in questions/services/common.py:235 explicitly excludes feed_tile_summary from its update fields, so the field cannot be persisted even if it passes validation. Update both:

  1. NotebookWriteSerializer to include "feed_tile_summary" in its fields
  2. update_notebook() to include "feed_tile_summary" in its fields list
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 42cfb5b and abbb32d.

📒 Files selected for processing (12)
  • front_end/messages/en.json
  • front_end/src/app/(main)/(home)/components/research_and_updates.tsx
  • front_end/src/app/(main)/questions/components/notebook_form.tsx
  • front_end/src/components/news_card.tsx
  • front_end/src/components/post_card/notebook_tile.tsx
  • front_end/src/types/post.ts
  • posts/admin.py
  • posts/migrations/0029_rename_markdown_summary_to_feed_tile_summary.py
  • posts/models.py
  • posts/serializers.py
  • posts/services/versioning.py
  • posts/translation.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-15T19:29:58.940Z
Learnt from: hlbmtc
Repo: Metaculus/metaculus PR: 4075
File: authentication/urls.py:24-26
Timestamp: 2026-01-15T19:29:58.940Z
Learning: In this codebase, DRF is configured to use IsAuthenticated as the default in REST_FRAMEWORK['DEFAULT_PERMISSION_CLASSES'] within metaculus_web/settings.py. Therefore, explicit permission_classes([IsAuthenticated]) decorators are unnecessary on DRF views unless a view needs to override the default. When reviewing Python files, verify that views relying on the default are not redundantly decorated, and flag cases where permissions are being over-specified or when a non-default permission is explicitly required.

Applied to files:

  • posts/serializers.py
  • posts/translation.py
  • posts/services/versioning.py
  • posts/admin.py
  • posts/migrations/0029_rename_markdown_summary_to_feed_tile_summary.py
  • posts/models.py
🧬 Code graph analysis (1)
front_end/src/app/(main)/questions/components/notebook_form.tsx (2)
front_end/src/components/ui/input_container.tsx (1)
  • InputContainer (13-67)
front_end/src/components/ui/form_field.tsx (1)
  • Textarea (167-181)
🪛 Ruff (0.14.13)
posts/migrations/0029_rename_markdown_summary_to_feed_tile_summary.py

8-10: Mutable class attributes should be annotated with typing.ClassVar

(RUF012)


12-25: Mutable class attributes should be annotated with typing.ClassVar

(RUF012)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Build Docker Image
  • GitHub Check: integration-tests
  • GitHub Check: Frontend Checks
  • GitHub Check: Backend Checks
🔇 Additional comments (14)
front_end/src/types/post.ts (1)

109-116: LGTM!

The Notebook type property rename from markdown_summary to feed_tile_summary is correct and aligns with the backend model/serializer changes.

posts/admin.py (1)

221-232: LGTM!

The list_display update correctly references the renamed feed_tile_summary field on the Notebook model.

posts/services/versioning.py (1)

140-145: LGTM!

The field rename from markdown_summary to feed_tile_summary in the notebook snapshot is correct and consistent with the model changes.

front_end/src/app/(main)/(home)/components/research_and_updates.tsx (1)

85-92: LGTM!

The fallback pattern notebook.feed_tile_summary || getMarkdownSummary({...}) correctly prioritizes the explicit summary while maintaining backward compatibility for notebooks without a feed tile summary.

front_end/src/components/news_card.tsx (1)

55-68: LGTM!

The feed_tile_summary integration with fallback to getMarkdownSummary is consistent with the other components in this PR.

front_end/src/components/post_card/notebook_tile.tsx (1)

22-35: LGTM!

Consistent use of feed_tile_summary with fallback to computed summary, matching the pattern used in NewsCard and ResearchAndUpdates components.

front_end/src/app/(main)/questions/components/notebook_form.tsx (3)

64-64: LGTM!

The optional feed_tile_summary field is correctly added to the schema without validation constraints, which aligns with the backend's TextField(blank=True, default="") definition.


138-141: LGTM!

The notebook object correctly includes feed_tile_summary with a sensible fallback to an empty string when not provided, matching the backend's default value.


266-274: LGTM!

The new form field follows the established UI patterns with proper:

  • Label from translations (t("feedTileSummary"))
  • Placeholder from translations (t("feedTileSummaryPlaceholder"))
  • Error binding via form.formState.errors.feed_tile_summary
  • Edit mode pre-fill from post?.notebook?.feed_tile_summary
  • Consistent styling with other form elements
front_end/messages/en.json (1)

1873-1874: LGTM!

The translation keys are well-defined with a clear label and an informative placeholder that explains the field's purpose and optional nature.

posts/translation.py (1)

9-10: LGTM!

The translatable field is correctly updated to feed_tile_summary, maintaining translation support for the renamed field.

posts/serializers.py (1)

66-67: LGTM!

The read serializer correctly exposes feed_tile_summary in the API response.

posts/models.py (1)

527-529: LGTM!

The field rename is properly implemented with appropriate attributes:

  • blank=True allows empty values in forms
  • default="" provides a sensible default
  • help_text clearly describes the field's purpose for admin users
posts/migrations/0029_rename_markdown_summary_to_feed_tile_summary.py (1)

12-25: LGTM!

The migration correctly:

  1. Renames the field while preserving existing data via RenameField
  2. Updates the field definition to add the help_text via AlterField

The operation order is correct—rename first, then alter the field definition.

Note: The static analysis hints about ClassVar annotations are false positives for Django migrations, which use mutable class attributes by design.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jan 20, 2026

🧹 Preview Environment Cleaned Up

The preview environment for this PR has been destroyed.

Resource Status
🌐 Preview App ✅ Deleted
🗄️ PostgreSQL Branch ✅ Deleted
⚡ Redis Database ✅ Deleted
🔧 GitHub Deployments ✅ Removed
📦 Docker Image ⚠️ Retained (auto-cleanup via GHCR policies)

Cleanup triggered by PR close at 2026-01-21T12:29:30Z

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@posts/migrations/0029_remove_notebook_markdown_summary_and_more.py`:
- Around line 12-120: The migration currently removes migrations.RemoveField
entries for notebook.markdown_summary* and adds migrations.AddField for
notebook.feed_tile_summary* which will drop existing data; instead replace each
RemoveField+AddField pair with a
migrations.RenameField(from_name="markdown_summary",
to_name="feed_tile_summary", model_name="notebook") (and do the same for each
locale variant like markdown_summary_cs -> feed_tile_summary_cs,
markdown_summary_en -> feed_tile_summary_en, etc.), and if any field options
change after rename follow with a migrations.AlterField for the specific
feed_tile_summary* field to update blank/default/null/help_text as needed.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between abbb32d and 1d4a773.

📒 Files selected for processing (8)
  • front_end/messages/cs.json
  • front_end/messages/es.json
  • front_end/messages/pt.json
  • front_end/messages/zh-TW.json
  • front_end/messages/zh.json
  • posts/migrations/0029_remove_notebook_markdown_summary_and_more.py
  • posts/serializers.py
  • posts/services/versioning.py
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2026-01-15T19:29:58.940Z
Learnt from: hlbmtc
Repo: Metaculus/metaculus PR: 4075
File: authentication/urls.py:24-26
Timestamp: 2026-01-15T19:29:58.940Z
Learning: In this codebase, DRF is configured to use IsAuthenticated as the default in REST_FRAMEWORK['DEFAULT_PERMISSION_CLASSES'] within metaculus_web/settings.py. Therefore, explicit permission_classes([IsAuthenticated]) decorators are unnecessary on DRF views unless a view needs to override the default. When reviewing Python files, verify that views relying on the default are not redundantly decorated, and flag cases where permissions are being over-specified or when a non-default permission is explicitly required.

Applied to files:

  • posts/services/versioning.py
  • posts/serializers.py
  • posts/migrations/0029_remove_notebook_markdown_summary_and_more.py
🪛 Ruff (0.14.13)
posts/migrations/0029_remove_notebook_markdown_summary_and_more.py

7-9: Mutable class attributes should be annotated with typing.ClassVar

(RUF012)


11-121: Mutable class attributes should be annotated with typing.ClassVar

(RUF012)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Build Docker Image
  • GitHub Check: integration-tests
  • GitHub Check: Backend Checks
🔇 Additional comments (9)
front_end/messages/pt.json (1)

1876-1877: LGTM — new feed tile summary strings added.

Nothing else to flag here.

front_end/messages/zh-TW.json (1)

1875-1876: LGTM — feed tile summary translations added.

No issues spotted.

front_end/messages/zh.json (1)

1880-1881: LGTM — feed tile summary strings added.

No further concerns.

posts/services/versioning.py (2)

141-143: LGTM — notebook snapshot now captures feed_tile_summary.

This aligns with the model/serializer rename.


54-65: The snapshot keys are not being renamed; snapshot["conditional"] and snapshot["notebook"] serve different post types in mutually exclusive if/elif branches. A Post object has either a conditional_id OR a notebook_id, never both, so these keys will never coexist in the same snapshot object. No backward compatibility issue exists, and no downstream consumers will be affected. The feed_tile_summary field is a standard model field properly extracted into the snapshot, not a problematic rename.

Likely an incorrect or invalid review comment.

front_end/messages/es.json (1)

1878-1879: Strings align with the renamed feed-tile summary field.

Thanks for adding the Spanish label/placeholder for the new UI field.

front_end/messages/cs.json (1)

1878-1879: Czech strings added cleanly for the new field.

The label and placeholder are consistent with the new feed tile summary intent.

posts/serializers.py (2)

57-67: Read serializer exposure looks good.

Please verify any API consumers that previously expected markdown_summary have been migrated to feed_tile_summary.


116-123: Write serializer change is consistent with the rename.

Please confirm clients and forms now send feed_tile_summary in write payloads.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.

Comment thread posts/migrations/0029_remove_notebook_markdown_summary_and_more.py Outdated
@hlbmtc hlbmtc merged commit 53af8f7 into main Jan 21, 2026
11 of 12 checks passed
@hlbmtc hlbmtc deleted the claude/issue-4089-20260120-1423 branch January 21, 2026 12:29
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.

Rename "Markdown Summary" field for notebooks. Add to FE on /create/notebook/ form.

2 participants