Skip to content

ConditionalFormatLayer: textColor is dead code (empty if-statement) #8

@witqq

Description

@witqq

Problem

In @witqq/spreadsheet-plugins v0.2.1, ConditionalFormatLayer has dead code for textColor rendering.

Current behavior

At approximately line 1478 in dist/index.js:

if (rule.style?.textColor) ;

This is an empty if-statement — the textColor check exists but does nothing. Meanwhile, bgColor rendering works correctly in the same layer.

Expected behavior

The textColor branch should set ctx.fillStyle to the rule's textColor and re-render the cell text:

if (rule.style?.textColor) {
  ctx.fillStyle = rule.style.textColor;
  // render cell text with this color
}

Impact

Conditional formatting rules that specify textColor (e.g., red text for negative values, green for positive) have no visual effect. Only bgColor works.

Versions affected

  • @witqq/spreadsheet-plugins 0.2.1

Related

  • This compounds with the CellTextLayer issue (CellTextLayer ignores per-cell textColor) — even if ConditionalFormatLayer sets the color, CellTextLayer would reset it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions