Skip to content

[projects] Add single-preview-per-revision project option#1098

Merged
frankrousseau merged 2 commits into
cgwire:mainfrom
frankrousseau:single-preview-per-revision
Jun 2, 2026
Merged

[projects] Add single-preview-per-revision project option#1098
frankrousseau merged 2 commits into
cgwire:mainfrom
frankrousseau:single-preview-per-revision

Conversation

@frankrousseau
Copy link
Copy Markdown
Contributor

Problem

  • Some productions need to enforce a single preview file per revision, but Zou always allows extra previews (position > 1) to be added to a revision.

Solution

  • Add an is_single_preview_per_revision boolean to Project and ProjectTemplate (migration adds it to both tables, nullable with default false).
  • Reject adding an extra preview file to a revision with HTTP 400 (TooManyPreviewFilesException) when the option is enabled, enforced at the single choke point add_preview_file_to_comment.

frankrousseau and others added 2 commits June 2, 2026 01:46
Add a boolean column to project and project_template with a migration
adding it to both tables (nullable, default false for backwards
compatibility).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
When a project has is_single_preview_per_revision enabled, adding a
second preview file (position > 1) to a revision now raises
TooManyPreviewFilesException (HTTP 400). Enforced at the single choke
point add_preview_file_to_comment.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@frankrousseau frankrousseau merged commit e916911 into cgwire:main Jun 2, 2026
13 checks passed
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.

1 participant