{"record":{"id":"68dfc4c633ab8208","repo":"siyuan-note/siyuan","slug":"displayname-default-is-required","errorCode":null,"errorMessage":"displayName.default is required","messagePattern":"displayName\\.default is required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kernel/model/boot_appearance.go","lineNumber":679,"sourceCode":"\tfor _, part := range strings.Split(relative, string(os.PathSeparator)) {\n\t\tif part == \".\" || part == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tcurrent = filepath.Join(current, part)\n\t\tinfo, lstatErr := os.Lstat(current)\n\t\tif lstatErr != nil {\n\t\t\treturn lstatErr\n\t\t}\n\t\tif info.Mode()&os.ModeSymlink != 0 {\n\t\t\treturn ErrBootAppearanceAssetForbidden\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc validateBootAppearanceDisplayName(displayName map[string]string) error {\n\tif strings.TrimSpace(displayName[\"default\"]) == \"\" {\n\t\treturn errors.New(\"displayName.default is required\")\n\t}\n\tfor lang, value := range displayName {\n\t\tif strings.TrimSpace(lang) == \"\" || strings.TrimSpace(value) == \"\" || len(lang) > 32 || len(value) > 128 ||\n\t\t\tstrings.ContainsAny(value, \"\\x00\\r\\n\") {\n\t\t\treturn errors.New(\"invalid display name\")\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc normalizeBootAppearanceFrontends(manifestFrontends, pluginFrontends []string) ([]string, error) {\n\tcandidates := manifestFrontends\n\tif len(candidates) == 0 {\n\t\tcandidates = pluginFrontends\n\t}\n\tfrontends := []string{}\n\tseen := map[string]bool{}\n\tfor _, frontend := range candidates {","sourceCodeStart":661,"sourceCodeEnd":697,"githubUrl":"https://github.com/siyuan-note/siyuan/blob/9f775e8a12daef8255556097396f9b2739078892/kernel/model/boot_appearance.go#L661-L697","documentation":"validateBootAppearanceDisplayName checks the manifest's localized display-name map. The map MUST contain a non-blank \"default\" entry, since it is the fallback shown for any language without an explicit translation. A missing or whitespace-only \"default\" key aborts loading with this error.","triggerScenarios":"Loading a boot appearance package whose manifest.json `displayName` object lacks a `default` key, or whose `displayName.default` is empty, whitespace-only, or absent entirely.","commonSituations":"Authors writing only language-specific names (e.g. only zh_CN) and forgetting the fallback; hand-writing a manifest from scratch; a generator emitting an empty displayName object.","solutions":["Add a `\"default\"` key to the manifest's displayName object with a non-empty human-readable name","Ensure the default value is not just whitespace — trim before saving","Repackage the appearance and reinstall"],"exampleFix":"// manifest.json before\n\"displayName\": {\"zh_CN\": \"我的启动画面\"}\n// after\n\"displayName\": {\"default\": \"My Boot Splash\", \"zh_CN\": \"我的启动画面\"}","handlingStrategy":"validation","validationCode":"function hasDefaultDisplayName(manifest) {\n  return typeof manifest.displayName === \"object\" && manifest.displayName !== null &&\n    String(manifest.displayName.default ?? \"\").trim() !== \"\";\n}","typeGuard":"function isValidDisplayName(m) {\n  return typeof m?.displayName?.default === \"string\" && m.displayName.default.trim().length > 0;\n}","tryCatchPattern":"try {\n  await loadManifest(pkgPath);\n} catch (e) {\n  if (String(e).includes(\"displayName.default is required\")) {\n    // prompt author to add displayName.default\n  }\n}","preventionTips":["Always include a `default` key in displayName","Validate manifests in CI before publishing packages","Never leave displayName empty when generating manifests"],"tags":["boot-appearance","manifest","validation"],"backgroundTag":"missing-required-config-field","analyzedSha":"9f775e8a12daef8255556097396f9b2739078892","analyzedAt":"2026-09-19T03:17:15.984Z","contentChangedAt":"2026-09-19T03:17:15.984Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}