Skip to content

fix: add missing TimeGrid extends chain and full field definitions#3

Merged
slheavner merged 2 commits intoslheavner:mainfrom
cewert:fix/timegrid-missing-extends
Mar 4, 2026
Merged

fix: add missing TimeGrid extends chain and full field definitions#3
slheavner merged 2 commits intoslheavner:mainfrom
cewert:fix/timegrid-missing-extends

Conversation

@cewert
Copy link
Contributor

@cewert cewert commented Feb 26, 2026

Problem

TimeGrid was registered in data.ts with an empty fields array and no extends property. The validator's findAllFields traversal relies on the extends chain to walk up the RSG hierarchy, so it stopped at TimeGrid and never reached Group or Node. This caused SG1002 ("Field not found") to fire for every inherited attribute — including universal ones like id and translation — on any component that used TimeGrid.

Discovered and reproducible via jellyrock/jellyrock#347, a Renovate PR that bumped brighterscript-xml-plugin and surfaced the SG1002 errors on <JRTimeGrid id="scheduleGrid" translation="[0,600]" />.

Changes

src/data.ts

  • Set extends to Group (restoring the full RSG inheritance chain: TimeGrid → Group → Node)
  • Populated all 66 fields from the Roku TimeGrid docs, organised by section:
    • General settings (maxDays, duration, contentStartTime, autoDismissTime, …)
    • App/channel focus (animateToChannel, jumpToChannel, channelFocused, …)
    • Channel information column (channelInfoWidth, channelInfoFocusable, channelInfoComponentName, …)
    • Program grid (programTitleColor, programFocused, fillProgramGaps, …)
    • Past time screen, time bar, now bar
    • Now/Next mode (nowNextMode, nowBackgroundBitmapUri, …)

src/XmlProvider.spec.ts

Three new tests:

  • Own fields — completions for <TimeGrid include content, nowNextMode, programTitleColor, channelInfoWidth
  • Inherited fields — completions include translation and visible (from Group) and id (from Node)
  • No SG1002 — validating <TimeGrid id="scheduleGrid" translation="[0,600]" /> produces zero SG1002 diagnostics

Testing

npm run build && npm test
# 10 passing

TimeGrid was registered in data.ts with an empty fields array and no
extends property, causing brighterscript-xml-plugin to report SG1002
(field not found) for all inherited Node/Group attributes such as 'id'
and 'translation' when validating components that use TimeGrid.

- Set extends to Group (which itself extends Node), restoring the full
  RSG inheritance chain: TimeGrid → Group → Node
- Populated all 66 TimeGrid fields from the Roku developer docs
  (general settings, channel/program grid, time bar, now bar, now/next mode)
- Added tests covering own-field completions, inherited-field completions
  (translation, id), and SG1002 absence for id and translation
@slheavner slheavner merged commit ebf2c80 into slheavner:main Mar 4, 2026
6 checks passed
@cewert cewert deleted the fix/timegrid-missing-extends branch March 4, 2026 18:32
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.

2 participants