Skip to content

feat: add show_labels setting to toggle chart and gauge labels#25

Merged
nicomiguelino merged 2 commits into
developmentfrom
feature/show-labels-setting
Jun 29, 2026
Merged

feat: add show_labels setting to toggle chart and gauge labels#25
nicomiguelino merged 2 commits into
developmentfrom
feature/show-labels-setting

Conversation

@nicomiguelino

@nicomiguelino nicomiguelino commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a `show_labels` boolean setting (default `false`) so labels on charts and gauges are opt-in rather than always on, since the app is public and this was originally requested by a specific customer
  • Threads the flag from `screenly.yml` / `screenly_qc.yml` through `main.ts` down to `renderChart` and `renderGauge`
  • Extracts `src/render/report.ts` to group all report-specific rendering logic and keep `index.ts` within the `max-lines` lint limit

Associated Pull Requests

Screenshots

Labels enabled — landscape (1920×1080)

dashboard-labels-1920x1080

Labels enabled — portrait (1080×1920)

dashboard-labels-1080x1920

- Add `show_labels` boolean setting to screenly.yml and screenly_qc.yml
- Thread `showLabels` flag through main.ts, renderDashboard, renderReport,
  renderComponent, renderChart, and renderGauge
- Extract src/render/report.ts with all report-specific rendering logic
  to keep index.ts within the max-lines lint limit
- Add dashboard-labels screenshot tests at 1920x1080 and 1080x1920
- Refactor takeScreenshot to inline networkidle wait and extract
  mockCredentials, setupDashboardRoutes, and setupReportRoutes helpers

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.

Pull request overview

Adds an opt-in show_labels setting to control whether chart data labels and gauge breakpoint labels are rendered, and refactors report-specific rendering logic into a dedicated module to keep src/render/index.ts smaller.

Changes:

  • Introduces a show_labels setting (default false) and threads it from Screenly settings → main.ts → render functions.
  • Gates Chart.js datalabel rendering and gauge breakpoint labels behind the showLabels flag.
  • Extracts report rendering utilities/logic into src/render/report.ts and updates screenshot e2e coverage for dashboards with labels enabled.

Reviewed changes

Copilot reviewed 8 out of 22 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/render/report.ts New module containing report-specific rendering helpers and renderReportContent, now supports showLabels.
src/render/index.ts Threads showLabels through dashboard/report rendering and uses extracted report helpers.
src/render/gauge.ts Adds showLabels toggle to conditionally draw gauge breakpoint labels.
src/render/chart.ts Adds showLabels toggle to enable/disable chartjs-plugin-datalabels.
src/main.ts Reads show_labels from settings and passes it into rendering pipeline.
screenly.yml Adds show_labels setting to the app manifest.
screenly_qc.yml Adds show_labels setting to the QC manifest.
e2e/screenshots.spec.ts Refactors route setup helpers and adds “dashboard-labels” screenshot fixtures/tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/render/index.ts
Comment thread src/render/index.ts Outdated
Comment thread src/render/report.ts Outdated
Comment thread e2e/screenshots.spec.ts
- Add ReportResult to top-level import in index.ts
- Replace inline import type with ReportResult in renderReport signature
- Add explicit DashboardMetadataComponent type annotation to meta in renderReportTableCard
- Add report-labels screenshot tests at 1920x1080 and 1080x1920
@nicomiguelino nicomiguelino merged commit 42da535 into development Jun 29, 2026
1 check passed
@nicomiguelino nicomiguelino deleted the feature/show-labels-setting branch June 29, 2026 16:54
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