Skip to content

fix: accept border style="none" in loadWorkbook (#99) - #102

Merged
baseballyama merged 1 commit into
mainfrom
fix/issue-99-border-style-none
Jul 12, 2026
Merged

fix: accept border style="none" in loadWorkbook (#99)#102
baseballyama merged 1 commit into
mainfrom
fix/issue-99-border-style-none

Conversation

@baseballyama

Copy link
Copy Markdown
Collaborator

Summary

loadWorkbook rejected any workbook whose border sides use style="none", throwing expected one of [thin, medium, ...]; got "none". none is the first value of ECMA-376 §18.18.3 ST_BorderStyle (no stroke), so it is valid input and is now accepted.

Motivation

OnlyOffice — and other producers — write the no-border value explicitly as <left style="none"/>. Excel omits the side element in that case, which is why this went unnoticed until a file from OnlyOffice hit it. The value was simply missing from the SideStyle enumeration.

Closes #99

Changes

  • @office-kit/xlsx/styles: SideStyle (and SIDE_STYLES) now include 'none'. Sides with style="none" parse, round-trip faithfully, and draw no stroke in HTML/SVG preview.

Testing

  • Added tests/styles/issue-99.test.ts — a failing-first test that parses <side style="none"/> and exercises makeSide({ style: 'none' }).
  • Verified end-to-end against the reporter's attached lookup_values_lut.xlsx (5 sides with style="none"): it threw before this change and loads cleanly after, with none preserved on round-trip.
  • pnpm typecheck && pnpm lint && pnpm test green.

Reproduce:

pnpm vitest run tests/styles/issue-99.test.ts

Breaking changes

None. This widens accepted input; existing values are unaffected.

Checklist

  • I have read CLAUDE.md and followed the project's conventions.
  • I have added or updated tests for the change.
  • I have added or updated documentation where user-visible behavior changed.
  • If this is a breaking change, I have added a changeset / CHANGELOG entry and flagged it above.
  • I have re-read my own diff and removed dead code, debug prints, and stale comments.
  • If I used an LLM to draft this PR, I have verified each change myself, the PR represents real work that warrants a maintainer's review, and I am willing to defend each line in review.

OnlyOffice (and other producers) write border sides as
<left style="none"/>. `none` is the first value of ECMA-376 §18.18.3
ST_BorderStyle (no stroke), but it was missing from SideStyle, so
loadWorkbook threw `expected one of [thin, medium, ...]; got "none"`.
Excel omits the side element in this case, which is why it went
unnoticed. `none` is now accepted, round-trips faithfully, and draws no
stroke in HTML/SVG preview.

Closes #99

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HYPZEKSkTxi46S3x2sAyGg
Copilot AI review requested due to automatic review settings July 12, 2026 09:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@baseballyama
baseballyama merged commit 9b1feba into main Jul 12, 2026
13 checks passed
@baseballyama
baseballyama deleted the fix/issue-99-border-style-none branch July 12, 2026 10:15
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.

bug: <one-line summary>Schema validation error when no border is set

2 participants