{"record":{"id":"5f1bc22ce6480a4e","repo":"iOfficeAI/OfficeCLI","slug":"unknown-diagram-look-look-valid-classic-han","errorCode":null,"errorMessage":"unknown diagram look '{look}'. Valid: classic, handDrawn.","messagePattern":"unknown diagram look '(.+?)'\\. Valid: classic, handDrawn\\.","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/officecli/Core/Diagram/MermaidImageRenderer.cs","lineNumber":136,"sourceCode":"    /// source unchanged when no option is set. Rejects unknown values with a\n    /// message listing the valid ones. When the source already carries its own\n    /// frontmatter or an <c>%%{init}%%</c> directive, the source wins and the\n    /// options are ignored (caller may warn) — merging into an existing block is\n    /// out of scope and would risk producing a malformed document.\n    /// </summary>\n    public static string ComposeSource(string mermaid, string? theme, string? layout, string? look)\n    {\n        theme = string.IsNullOrWhiteSpace(theme) ? null : theme.Trim();\n        layout = string.IsNullOrWhiteSpace(layout) ? null : layout.Trim();\n        look = string.IsNullOrWhiteSpace(look) ? null : look.Trim();\n        if (theme == null && layout == null && look == null) return mermaid;\n\n        if (theme != null && !Themes.Contains(theme))\n            throw new ArgumentException($\"unknown diagram theme '{theme}'. Valid: {string.Join(\", \", Themes)}.\");\n        if (layout != null && !Layouts.Contains(layout))\n            throw new ArgumentException($\"unknown diagram layout '{layout}'. Valid: {string.Join(\", \", Layouts)}.\");\n        if (look != null && !Looks.Contains(look))\n            throw new ArgumentException($\"unknown diagram look '{look}'. Valid: classic, handDrawn.\");\n\n        var lead = mermaid.TrimStart();\n        if (lead.StartsWith(\"---\", StringComparison.Ordinal) || lead.StartsWith(\"%%{\", StringComparison.Ordinal))\n            return mermaid; // source already declares config — do not double-inject\n\n        var sb = new StringBuilder(\"---\\nconfig:\\n\");\n        if (theme != null) sb.Append(\"  theme: \").Append(theme.ToLowerInvariant()).Append('\\n');\n        if (layout != null) sb.Append(\"  layout: \").Append(layout.ToLowerInvariant()).Append('\\n');\n        // look's canonical mermaid spelling is camelCase handDrawn; normalize.\n        if (look != null)\n            sb.Append(\"  look: \")\n              .Append(look.Equals(\"handdrawn\", StringComparison.OrdinalIgnoreCase) ? \"handDrawn\" : \"classic\")\n              .Append('\\n');\n        sb.Append(\"---\\n\").Append(mermaid);\n        return sb.ToString();\n    }\n\n    /// <summary>True when the (already composed) source carries a style frontmatter,","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/iOfficeAI/OfficeCLI/blob/1ced45e900782c5083ed550ddf328ee974e425e7/src/officecli/Core/Diagram/MermaidImageRenderer.cs#L118-L154","documentation":"Thrown by MermaidImageRenderer.ComposeSource (MermaidImageRenderer.cs:136) when a non-null look value is not in the accepted Looks set {classic, handDrawn} (case-insensitive). 'look' is mermaid 11's rendering style option; handDrawn produces a sketch-like appearance. The canonical camelCase spelling 'handDrawn' is normalized at injection time, but the accepted input set uses lowercase comparison.","triggerScenarios":"Setting a diagram look to 'sketch', 'rough', 'neon', 'hand', or any value outside {classic, handDrawn}.","commonSituations":"Guessing 'sketch' or 'rough' (mermaid uses 'handDrawn'); passing 'handdrawn' works (case-insensitive) but 'hand-drawn' does not; expecting a mermaid 10 theme that does not exist under the look option in v11.","solutions":["Use one of: classic or handDrawn.","Leave look unset to keep the default classic appearance."],"exampleFix":"// before\nlook=sketch\n// after\nlook=handDrawn","handlingStrategy":"validation","validationCode":"static readonly HashSet<string> ValidLooks = new(StringComparer.OrdinalIgnoreCase) { \"classic\",\"handdrawn\" };\nstatic string ValidateLook(string look) => ValidLooks.Contains(look ?? \"\") ? look : throw new ArgumentException($\"unknown look '{look}'\");","typeGuard":"static bool IsValidLook(string look) => ValidLooks.Contains(look ?? \"\");","tryCatchPattern":"try { MermaidImageRenderer.ComposeSource(mermaid, null, null, look); }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"unknown diagram look\"))\n{ /* default to null (classic) or pick classic/handDrawn */ }","preventionTips":["Use 'handDrawn' (case-insensitive) for the sketch style, not 'sketch'/'rough'.","Leave look null for the default classic appearance.","Remember 'look' is a mermaid 11 option; it does not exist in v10 themes."],"tags":["diagram","mermaid","look","validation"],"backgroundTag":null,"analyzedSha":"1ced45e900782c5083ed550ddf328ee974e425e7","analyzedAt":"2026-08-13T13:01:07.193Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}