Skip to content

ui: surface per-file encoding and line-ending in the values sticky strip and preserve them on save - #58

Merged
bosiakov merged 1 commit into
mainfrom
ui/per-file-encoding-diagnostics
May 2, 2026
Merged

ui: surface per-file encoding and line-ending in the values sticky strip and preserve them on save#58
bosiakov merged 1 commit into
mainfrom
ui/per-file-encoding-diagnostics

Conversation

@bosiakov

@bosiakov bosiakov commented May 2, 2026

Copy link
Copy Markdown
Contributor
  • Added service.DetectFileEncoding that BOM sniffs UTF-8, UTF-8 BOM, UTF-16 LE, UTF-16 BE and scans for the first newline to report LF or CRLF
  • Added service.EncodeForFile that prepends the original BOM and rewrites LF to CRLF when writing back, so a UTF-8 BOM CRLF file round trips unchanged
  • Extended domain.ValuesFile and service.FlatValues with Encoding and LineEnding fields populated at read time and copied through newFlatValues
  • ReadCustomValues and ReadAndMergeCustomValues now detect the encoding pair from the raw bytes; multi file merge takes them from the first file, parallel to indent
  • SaveValuesFile and the controller saveToFile accept encoding and line ending parameters; columnFileEncoding pulls them from the column so saves preserve the source shape
  • Promoted anyColumnHasCustomValues to exported AnyColumnHasCustomValues so the page layer can gate on a real load
  • layoutStickyDiagnostics returns empty dimensions until at least one column has parsed values, then renders override count, extras count, and one encoding chip per loaded column
  • Added layoutStickyDiagDivider that draws a hairline vertical separator between adjacent diagnostic chips, and appendDiagChip that skips empty entries so leading and trailing dividers never appear
  • Removed the leading plus glyph from the extras count label
  • Added constants for the encoding labels, divider dimensions, and the maximum chip count, plus service/file_metadata_test.go covering the detection helper

@bosiakov
bosiakov merged commit 980c51f into main May 2, 2026
1 check passed
@bosiakov
bosiakov deleted the ui/per-file-encoding-diagnostics branch May 2, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant