Rename 'Markdown Summary' to 'Feed Tile Summary' for notebooks#4113
Conversation
- 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>
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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. 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
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 ofsnapshot["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: Addfeed_tile_summarytoNotebookWriteSerializer.fieldsand 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()inquestions/services/common.py:235explicitly excludesfeed_tile_summaryfrom its update fields, so the field cannot be persisted even if it passes validation. Update both:
NotebookWriteSerializerto include"feed_tile_summary"in its fieldsupdate_notebook()to include"feed_tile_summary"in its fields list
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (12)
front_end/messages/en.jsonfront_end/src/app/(main)/(home)/components/research_and_updates.tsxfront_end/src/app/(main)/questions/components/notebook_form.tsxfront_end/src/components/news_card.tsxfront_end/src/components/post_card/notebook_tile.tsxfront_end/src/types/post.tsposts/admin.pyposts/migrations/0029_rename_markdown_summary_to_feed_tile_summary.pyposts/models.pyposts/serializers.pyposts/services/versioning.pyposts/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.pyposts/translation.pyposts/services/versioning.pyposts/admin.pyposts/migrations/0029_rename_markdown_summary_to_feed_tile_summary.pyposts/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
Notebooktype property rename frommarkdown_summarytofeed_tile_summaryis correct and aligns with the backend model/serializer changes.posts/admin.py (1)
221-232: LGTM!The
list_displayupdate correctly references the renamedfeed_tile_summaryfield on theNotebookmodel.posts/services/versioning.py (1)
140-145: LGTM!The field rename from
markdown_summarytofeed_tile_summaryin 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_summaryintegration with fallback togetMarkdownSummaryis 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_summarywith fallback to computed summary, matching the pattern used inNewsCardandResearchAndUpdatescomponents.front_end/src/app/(main)/questions/components/notebook_form.tsx (3)
64-64: LGTM!The optional
feed_tile_summaryfield is correctly added to the schema without validation constraints, which aligns with the backend'sTextField(blank=True, default="")definition.
138-141: LGTM!The notebook object correctly includes
feed_tile_summarywith 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_summaryin the API response.posts/models.py (1)
527-529: LGTM!The field rename is properly implemented with appropriate attributes:
blank=Trueallows empty values in formsdefault=""provides a sensible defaulthelp_textclearly describes the field's purpose for admin usersposts/migrations/0029_rename_markdown_summary_to_feed_tile_summary.py (1)
12-25: LGTM!The migration correctly:
- Renames the field while preserving existing data via
RenameField- Updates the field definition to add the
help_textviaAlterFieldThe operation order is correct—rename first, then alter the field definition.
Note: The static analysis hints about
ClassVarannotations 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.
🧹 Preview Environment Cleaned UpThe preview environment for this PR has been destroyed.
Cleanup triggered by PR close at 2026-01-21T12:29:30Z |
There was a problem hiding this comment.
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
📒 Files selected for processing (8)
front_end/messages/cs.jsonfront_end/messages/es.jsonfront_end/messages/pt.jsonfront_end/messages/zh-TW.jsonfront_end/messages/zh.jsonposts/migrations/0029_remove_notebook_markdown_summary_and_more.pyposts/serializers.pyposts/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.pyposts/serializers.pyposts/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 capturesfeed_tile_summary.This aligns with the model/serializer rename.
54-65: The snapshot keys are not being renamed;snapshot["conditional"]andsnapshot["notebook"]serve different post types in mutually exclusive if/elif branches. A Post object has either aconditional_idOR anotebook_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. Thefeed_tile_summaryfield 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_summaryhave been migrated tofeed_tile_summary.
116-123: Write serializer change is consistent with the rename.Please confirm clients and forms now send
feed_tile_summaryin write payloads.
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
Summary
This PR renames the "Markdown Summary" field to "Feed Tile Summary" and adds it to the frontend notebook creation form.
Changes
Backend:
markdown_summarytofeed_tile_summaryin Notebook model0029_rename_markdown_summary_to_feed_tile_summary.pyFrontend:
/create/notebook/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
✏️ Tip: You can customize this high-level summary in your review settings.