feat(cv): expand builder studio tools

This commit is contained in:
cesnimda
2026-08-29 01:45:30 +02:00
parent f794265e3e
commit 0f17d95c57
10 changed files with 434 additions and 47 deletions
@@ -66,6 +66,10 @@ public sealed class CvSectionSetting
// Optional CV-specific content for bullet/tag sections. Null uses master data; an empty list is
// an intentional empty override. Entry sections continue to use stable per-item overrides.
public List<string>? Items { get; set; }
// Optional presentation hint consumed by the shared renderer, so preview and PDF always agree.
// Unsupported combinations safely fall back to the normal row layout.
public string? Presentation { get; set; } // rows | grid | compact | bubble
public int? Columns { get; set; } // 1 | 2
}
public sealed class CvItemOverride
@@ -167,6 +171,11 @@ public static class CvVariantSettingsJson
Items = group.Items.Where(item => !string.IsNullOrWhiteSpace(item)).Select(item => item.Trim()).Distinct(StringComparer.OrdinalIgnoreCase).Take(100).ToList(),
})
.ToList();
foreach (var section in s.Sections)
{
section.Presentation = NormalizeChoice(section.Presentation, "rows", "grid", "compact", "bubble");
section.Columns = section.Columns is 1 or 2 ? section.Columns : null;
}
foreach (var section in s.CustomSections)
{
section.ContentType = NormalizeChoice(section.ContentType, "paragraphs", "bullets", "entries") ?? "bullets";