Skip to content

Some server-side generated warnings are hardcoded #2049

@maxchang3

Description

@maxchang3

Describe the bug

The warnings displayed in the skill modal and the sidebar panel in the diff view are currently hardcoded strings returned by the server and do not use translation keys.

const warnings: string[] = []
if (fileChanges.truncated) {
warnings.push(`File list truncated to ${MAX_FILES_COMPARE} files`)
}

export function validateSkill(frontmatter: SkillFrontmatter): SkillWarning[] {
const warnings: SkillWarning[] = []
if (!frontmatter.license) {
warnings.push({ type: 'warning', message: 'No license specified' })
}
if (!frontmatter.compatibility) {
warnings.push({ type: 'warning', message: 'No compatibility info' })
}
return warnings
}

Additional context

I'd like to make these warnings use translation keys, but I'm not sure what the best approach would be:

Returning i18n keys directly from the API doesn‘t appear to be a common pattern in this project. Would it be preferable to move the warning generation entirely to the client instead, similar to the other client-side warning patterns already used in this project?

Metadata

Metadata

Assignees

No one assigned

    Labels

    backServer, DatafrontFrontend, Design

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions