Skip to content

[RED-02] Remove ~1,670-line dead timezone fallback from display-datetime component #5

Description

@mairas

Severity: high | Confidence: confirmed | Area: dead-code | Source: codebase review 2026-06-30, finding RED-02

Problem

display-datetime.component.ts is 1,764 lines and the single largest source file in the repository. Approximately 95% of those lines — roughly 1,670 lines spanning the else branch from line 60 to 1,729 — consist of a hardcoded static array of ~420 {offset, label} timezone entries. This branch is only reached when typeof Intl.supportedValuesOf === 'undefined' (line 55). Since Intl.supportedValuesOf has been available in all evergreen browsers since 2022, and the project targets Angular 21 with a modern browser baseline, the else branch is effectively unreachable in practice. The happy path already calls getDynamicTimeZones(), which derives the timezone list from Intl.supportedValuesOf('timeZone').

Impact

The dead fallback inflates the component to nearly 20× its functional size, making the file difficult to navigate, review, and maintain. The inline embedding of a large static data table inside a component file also violates the single-responsibility principle. Because this is upstream cruft rather than SKip-specific logic, there is a clean opportunity to contribute a deletion PR upstream; no fork-specific divergence is needed to address it.

Affected code

  • src/app/widget-config/display-datetime/display-datetime.component.ts:55-1735

Suggested direction

Delete the static fallback else branch entirely, relying on Intl.supportedValuesOf which the target browser baseline already guarantees. If a fallback is judged necessary for any reason, extract the data table to a separately-imported JSON or constant file rather than embedding it inline. Either path reduces the component to roughly 90 lines of functional code. This is a suitable upstream contribution with low risk and clear benefit.

Verification

Verified against the codebase (confidence: confirmed): display-datetime.component.ts is 1,764 lines; the branch condition at line 55 is typeof Intl.supportedValuesOf !== "undefined", with the static array of ~420 entries occupying lines 60–1,729 (~1,670 lines, ~95% of the file).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:dead-codeRedundancy, dead code & baggageenhancementNew feature or requestkip-reviewFrom the 2026-06-30 Kip/SKip codebase reviewseverity:highReview finding: high severity

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions