feat: edit AI summaries and chapters - #2233
Merged
Merged
Conversation
Member
Author
|
hey @greptileai, please re-review the PR |
Comment on lines
+11
to
+13
| return sql`IF( | ||
| JSON_UNQUOTE(JSON_EXTRACT(${videos.metadata}, ${editedPath})) = 'true' | ||
| AND JSON_CONTAINS_PATH(${videos.metadata}, 'one', ${path}), |
Contributor
There was a problem hiding this comment.
Cleared content blocks regeneration
When an owner clears the summary or chapters, the edit action keeps the empty JSON path and sets its manual-edit flag. This condition then treats that empty field as protected, so later AI generation discards the generated replacement. As a result, replacing the video content cannot restore the cleared summary or chapters as intended.
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/web/lib/ai-content-metadata.ts
Line: 11-13
Comment:
**Cleared content blocks regeneration**
When an owner clears the summary or chapters, the edit action keeps the empty JSON path and sets its manual-edit flag. This condition then treats that empty field as protected, so later AI generation discards the generated replacement. As a result, replacing the video content cannot restore the cleared summary or chapters as intended.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Member
Author
|
hey @greptileai, please re-review the PR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Owners can now edit summaries and chapter titles/timestamps from the share page Summary tab, with add/remove chapters, Save/Cancel, inline validation, pending/error states, and unsaved-draft protection. Saved content updates the shared query cache so the summary, chapter list, and player markers stay in sync.
Owner-authorized writes use a short row-locked transaction, field-level conflict detection, and atomic JSON updates. Manual edits survive late AI results; replacing video content still permits regeneration. Generation queueing also preserves concurrent metadata edits. Deliberately cleared fields stay empty; replacing video content deletes their JSON keys and permits fresh generation even when old manual flags remain. No database migration or new dependency.
Validation: 96 focused tests passed; Biome passed for all changed files; no TypeScript diagnostics in changed files (existing dependency diagnostics remain). Actual React components verified in Chromium at desktop and mobile widths, covering validation, failed-save recovery, saving, chapter seeking, fixture reload persistence, and read-only viewers. Browser save boundary was mocked; live database-backed verification was unavailable because local Cap services were not running.
Greptile Summary
This PR lets video owners edit AI summaries and chapter titles/timestamps from the share page while preserving concurrent metadata updates and manual content during later AI generation.
Confidence Score: 5/5
The PR appears safe to merge; both previous findings are resolved and no actionable new issue remains.
Media replacement removes summary and chapter paths before regeneration, so cleared manual content no longer blocks replacement AI results. The resolved whitespace thread is also addressed through consistent normalization in the editor and server action.
Important Files Changed
Reviews (2): Last reviewed commit: "fix: normalize AI content before detecti..." | Re-trigger Greptile