Skip to content

Subtitle add#223

Merged
tenkus47 merged 2 commits into
devfrom
subtitle_add
Jun 8, 2026
Merged

Subtitle add#223
tenkus47 merged 2 commits into
devfrom
subtitle_add

Conversation

@tenkus47

@tenkus47 tenkus47 commented Jun 8, 2026

Copy link
Copy Markdown
Member

No description provided.

tenkus47 added 2 commits June 8, 2026 18:12
- Introduced a new sub-title field in GroupMetadataDTO and GroupMetadataInput interfaces.
- Updated GroupFormPage to include sub-title input in the form and validation.
- Enhanced GroupDetailsPage to display the sub-title if provided.
- Adjusted group schema validation to require sub-title along with title and description.
- Updated `resolveSeriesImageKey` to ensure proper handling of image strings.
- Refactored `resolveGroupBannerUrl` and `resolveGroupAvatarUrl` to utilize `resolveDashboardItemImageUrl` for improved URL resolution.
- Simplified image URL mapping in `groupLinkedPlansToFkOptions` for better clarity and maintainability.
@greptile-apps

greptile-apps Bot commented Jun 8, 2026

Copy link
Copy Markdown

Confidence Score: 3/5

The feature addition itself is straightforward, but making sub_title and description required in the schema will silently block all users from saving changes to existing groups that lack those fields.

Editors of any existing group without a sub-title or description will hit a blocking form validation error every time they try to save — even for unrelated changes like toggling visibility. This affects the entire existing dataset and is not gated behind a migration or a backward-compatible default.

src/schema/GroupSchema.ts — the .min(1) constraints on sub_title and description are the root of the breaking-change concern and should be reviewed carefully before merging.

Reviews (1): Last reviewed commit: "refactor(api): enhance image URL resolut..." | Re-trigger Greptile

Comment thread src/schema/GroupSchema.ts
Comment on lines +8 to 11
title: z.string().trim().min(1, "Title is required"),
sub_title: z.string().trim().min(1, "Sub-title is required"),
description: z.string().trim().min(1, "Description is required"),
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Required fields break editing of existing groups

Both sub_title and description are now enforced with .min(1), but existing groups loaded from the API can have null/undefined for either field. The hydration code defaults both to "" via meta.sub_title ?? "" and meta.description ?? "", which immediately fails the .min(1) check. Any user who tries to edit an existing group — even to toggle is_public — will be blocked by a validation error on every language block until they fill in a subtitle and a description. The old schema treated description as optional (no .min(1)), and sub_title did not exist, so this is a breaking change for all pre-existing records.

Comment on lines +645 to 648
if (!block) continue;
out.push({
language: code,
title: block.title.trim(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Filter no longer skips blocks with an empty title

The previous guard was if (!block?.title?.trim()) continue, which protected the API call if a block somehow had an empty title string. The new guard only skips undefined blocks, so a block that passes through with title: "" (e.g., if schema validation is somehow bypassed, or if buildGroupMetadata is called programmatically outside the form) will be sent to the backend with an empty title.

Suggested change
if (!block) continue;
out.push({
language: code,
title: block.title.trim(),
if (!block?.title?.trim()) continue;
out.push({
language: code,
title: block.title.trim(),

Comment on lines 409 to +420
<Pecha.FormItem>
<Pecha.FormLabel className="text-sm font-bold">
{languageLabelForCode(code)} title
<span className="text-destructive"> *</span>
</Pecha.FormLabel>
<Pecha.FormControl>
<Pecha.Input
className="h-12 bg-white dark:bg-[#181818]"
{...field}
/>
</Pecha.FormControl>
<Pecha.FormMessage />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Sub-title field marked required but is optional data

The sub-title label shows a red asterisk (*) indicating a required field, and the schema enforces .min(1). However, sub-title is a brand-new optional field on the server (sub_title?: string | null in GroupMetadataDTO). Marking it required in the UI when it may not be enforced server-side (and existing records will never have it) sets a misleading expectation. If sub-title is genuinely required going forward, this should be a coordinated backend + migration change; if it is optional, the asterisk and .min(1) should be removed.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@tenkus47 tenkus47 merged commit 2775209 into dev Jun 8, 2026
2 of 3 checks passed
@tenkus47 tenkus47 deleted the subtitle_add branch June 8, 2026 12:56
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