feat: add show_labels setting to toggle chart and gauge labels#25
Merged
Conversation
- 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
There was a problem hiding this comment.
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_labelssetting (defaultfalse) and threads it from Screenly settings →main.ts→ render functions. - Gates Chart.js datalabel rendering and gauge breakpoint labels behind the
showLabelsflag. - Extracts report rendering utilities/logic into
src/render/report.tsand 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.
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Associated Pull Requests
Screenshots
Labels enabled — landscape (1920×1080)
Labels enabled — portrait (1080×1920)