fix: hide Raw toggle for non-markdown files forced into raw editor

Non-markdown text files (.yml, .yaml, .json, etc.) are already forced
into raw editor mode via effectiveRawMode. This hides the Raw toggle
button in the breadcrumb bar for those files since toggling is not
applicable. Adds tests for classify_file_kind and forceRawMode behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
lucaronin
2026-04-05 12:59:19 +02:00
parent 61a83f437d
commit ef17e7b3b1
4 changed files with 48 additions and 3 deletions

View File

@@ -222,7 +222,7 @@ export function EditorContent({
<ActiveTabBreadcrumb
activeTab={activeTab}
barRef={breadcrumbBarRef}
props={{ diffMode, diffContent, onToggleDiff, rawMode: effectiveRawMode, onToggleRaw, ...breadcrumbProps }}
props={{ diffMode, diffContent, onToggleDiff, rawMode: effectiveRawMode, onToggleRaw, forceRawMode: isNonMarkdownText, ...breadcrumbProps }}
/>
{isTrashed && (
<TrashedNoteBanner