-
Notifications
You must be signed in to change notification settings - Fork 12
feat(simple-message-app): redesign and refactor #711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nicomiguelino
wants to merge
16
commits into
master
Choose a base branch
from
feat/redesign-simple-message-app
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
69ab72e
feat(simple-message-app): redesign and refactor
nicomiguelino fa69c93
fix(simple-message-app): address code review comments in main.ts
nicomiguelino d43b8b7
docs(simple-message-app): update help text for locale and timezone se…
nicomiguelino 88780b7
chore(simple-message-app): rename app from simple-message-app-new
nicomiguelino bd19b5f
feat(simple-message-app): replace legacy Vue app with redesigned Type…
nicomiguelino d0c4a1c
Merge branch 'master' into feat/redesign-simple-message-app
nicomiguelino cd0edf6
feat(simple-message-app): redesign portrait mode layout to match Figma
nicomiguelino 0bd4289
Merge branch 'master' into feat/redesign-simple-message-app
nicomiguelino 1b2dea2
test(simple-message-app): add unit tests for main.ts
nicomiguelino 5d11cac
test(simple-message-app): freeze time in screenshot tests for idempot…
nicomiguelino 6f57ba9
fix(simple-message-app): address PR review comments
nicomiguelino fcd0744
Merge branch 'master' into feat/redesign-simple-message-app
nicomiguelino 9b5b637
test(simple-message-app): expand screenshot fixture message body and …
nicomiguelino 13bfa02
chore(simple-message-app): remove theme setting and setupTheme call
nicomiguelino 379ddb7
Merge branch 'master' into feat/redesign-simple-message-app
nicomiguelino d734be4
Merge remote-tracking branch 'origin/master' into feat/redesign-simpl…
nicomiguelino File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| node_modules/ | ||
| dist/ | ||
| *.log | ||
| .DS_Store |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| node_modules/ |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| # Simple Message App New | ||
|
|
||
| ## Getting Started | ||
|
|
||
| ```bash | ||
| bun install | ||
| ``` | ||
|
|
||
| ## Deployment | ||
|
|
||
| Create and deploy the Edge App: | ||
|
|
||
| ```bash | ||
| screenly edge-app create --name simple-message-app-new --in-place | ||
| bun run deploy | ||
| screenly edge-app instance create | ||
| ``` | ||
|
|
||
| ## Configuration | ||
|
|
||
| The app accepts the following settings via `screenly.yml`: | ||
|
|
||
| | Setting | Description | Type | Default | | ||
| | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------- | | ||
| | `enable_analytics` | Enable or disable Sentry and Google Analytics integrations | optional | `true` | | ||
| | `message_body` | The main text content displayed in the message body card | required | _(default text)_ | | ||
| | `message_header` | The headline text displayed prominently on the left side | required | `Simple Message App` | | ||
| | `override_locale` | Override the default locale with a supported language code (e.g., `en`, `fr`, `de`) | optional | `en` | | ||
| | `override_timezone` | Override the default timezone with a supported timezone identifier (e.g., `Europe/London`, `America/New_York`). Defaults to the system timezone if left blank | optional | - | | ||
| | `tag_manager_id` | Google Tag Manager container ID to enable tracking and analytics | optional | `GTM-P98SPZ9Z` | | ||
| | `theme` | Visual theme for the application (`light` or `dark`) | required | `light` | | ||
|
|
||
| ## Development | ||
|
|
||
| ```bash | ||
| bun install # Install dependencies | ||
| bun run dev # Start development server | ||
| ``` | ||
|
|
||
| ## Testing | ||
|
|
||
| ```bash | ||
| bun run test:unit | ||
| ``` | ||
|
|
||
| ## Screenshots | ||
|
|
||
| Generate screenshots at all supported resolutions: | ||
|
|
||
| ```bash | ||
| bun run screenshots | ||
| ``` | ||
|
|
||
| Screenshots are saved to the `screenshots/` directory. |
Large diffs are not rendered by default.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import { test } from '@playwright/test' | ||
| import { | ||
| createMockScreenlyForScreenshots, | ||
| getScreenshotsDir, | ||
| RESOLUTIONS, | ||
| setupScreenlyJsMock, | ||
| } from '@screenly/edge-apps/test/screenshots' | ||
| import path from 'path' | ||
|
|
||
| const { screenlyJsContent } = createMockScreenlyForScreenshots( | ||
| { coordinates: [40.7128, -74.006], location: 'New York, NY' }, | ||
| { | ||
| enable_analytics: 'true', | ||
| message_body: 'A simple message app...', | ||
| message_header: 'Simple Message App', | ||
| override_locale: 'en', | ||
| override_timezone: 'America/New_York', | ||
| tag_manager_id: 'GTM-P98SPZ9Z', | ||
| theme: 'light', | ||
| }, | ||
| ) | ||
|
|
||
| for (const { width, height } of RESOLUTIONS) { | ||
| test(`screenshot ${width}x${height}`, async ({ browser }) => { | ||
| const screenshotsDir = getScreenshotsDir() | ||
|
|
||
| const context = await browser.newContext({ viewport: { width, height } }) | ||
| const page = await context.newPage() | ||
|
|
||
| await setupScreenlyJsMock(page, screenlyJsContent) | ||
|
|
||
| await page.goto('/') | ||
| await page.waitForLoadState('networkidle') | ||
|
|
||
| await page.screenshot({ | ||
| path: path.join(screenshotsDir, `${width}x${height}.png`), | ||
| fullPage: false, | ||
| }) | ||
|
|
||
| await context.close() | ||
| }) | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8" /> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
| <title>Simple Message App</title> | ||
| <script src="screenly.js?version=1"></script> | ||
| </head> | ||
| <body> | ||
| <auto-scaler | ||
| reference-width="1920" | ||
| reference-height="1080" | ||
| orientation="auto" | ||
| > | ||
| <div id="app"> | ||
| <app-header show-logo show-time show-date></app-header> | ||
| <div id="left-content"> | ||
| <span id="announcement-label">Announcement</span> | ||
| <h1 id="message-header"></h1> | ||
| <div id="date-badge"></div> | ||
| </div> | ||
| <div id="message-body-card"> | ||
| <div id="message-body"></div> | ||
| </div> | ||
| </div> | ||
| </auto-scaler> | ||
| <script type="module" src="/src/main.ts"></script> | ||
| </body> | ||
| </html> |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| { | ||
| "name": "simple-message-app-new", | ||
| "version": "1.0.0", | ||
| "type": "module", | ||
| "scripts": { | ||
| "prebuild": "bun run type-check", | ||
| "generate-mock-data": "screenly edge-app run --generate-mock-data", | ||
| "predev": "bun run generate-mock-data", | ||
| "dev": "edge-apps-scripts dev", | ||
| "build": "edge-apps-scripts build", | ||
| "build:dev": "edge-apps-scripts build:dev", | ||
| "build:prod": "edge-apps-scripts build", | ||
| "test": "bun test --pass-with-no-tests src/", | ||
| "test:unit": "bun test --pass-with-no-tests src/", | ||
| "lint": "edge-apps-scripts lint --fix", | ||
| "format": "prettier --write src/ README.md index.html", | ||
| "format:check": "prettier --check src/ README.md index.html", | ||
| "deploy": "bun run build && screenly edge-app deploy --path=dist/", | ||
| "type-check": "edge-apps-scripts type-check", | ||
| "screenshots": "edge-apps-scripts screenshots", | ||
| "prepare": "cd ../edge-apps-library && bun install && bun run build" | ||
| }, | ||
| "prettier": "../edge-apps-library/.prettierrc.json", | ||
| "devDependencies": { | ||
| "@playwright/test": "^1.58.0", | ||
| "@screenly/edge-apps": "workspace:../edge-apps-library", | ||
| "@types/bun": "^1.3.9", | ||
| "@types/jsdom": "^27.0.0", | ||
| "bun-types": "^1.3.9", | ||
| "jsdom": "^28.1.0", | ||
| "npm-run-all2": "^8.0.4", | ||
| "prettier": "^3.8.1", | ||
| "typescript": "^5.9.3" | ||
| } | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| --- | ||
| syntax: manifest_v1 | ||
| id: 01HTYXDZVA532Z1GN4CX5Z7VH7 | ||
| description: Screenly Simple Message App | ||
| icon: https://playground.srly.io/edge-apps/simple-message-app/static/img/icon.svg | ||
| author: Screenly, Inc. | ||
| ready_signal: true | ||
| settings: | ||
| enable_analytics: | ||
| type: string | ||
| default_value: 'true' | ||
| title: Enable Analytics | ||
| optional: true | ||
| help_text: Enable or disable Sentry and Google Analytics integrations. | ||
| is_global: true | ||
| message_body: | ||
| type: string | ||
| default_value: | | ||
| A simple message app allows users to display text on a screen, making it a | ||
| basic tool for digital signage. Users can input and edit both the heading | ||
| and message body directly from the Screenly dashboard. | ||
| title: Message Body | ||
| optional: false | ||
| help_text: | | ||
| Enter the main text content that will be displayed in the message body. | ||
| message_header: | ||
| type: string | ||
| default_value: Simple Message App | ||
| title: Message Header | ||
| optional: false | ||
| help_text: | | ||
| Enter the headline text that will be displayed as the message title. | ||
| override_locale: | ||
| type: string | ||
| default_value: en | ||
| title: Override Locale | ||
| optional: true | ||
| help_text: | | ||
| Override the default locale with a supported language code (e.g., en, fr, de). Defaults to English if not specified. | ||
| You can find the available locales here: https://momentjs.com/ | ||
| override_timezone: | ||
| type: string | ||
| default_value: '' | ||
| title: Override Timezone | ||
| optional: true | ||
| help_text: | | ||
| Override the default timezone with a supported timezone identifier (e.g., Europe/London, America/New_York). Defaults to the system timezone if left blank. | ||
| You can find the available timezones here: https://momentjs.com/timezone/ | ||
| tag_manager_id: | ||
| type: string | ||
| default_value: GTM-P98SPZ9Z | ||
| title: Google Tag Manager ID | ||
| optional: true | ||
| help_text: | | ||
| Enter your Google Tag Manager container ID to enable tracking and analytics. | ||
| is_global: true | ||
| theme: | ||
| type: string | ||
| default_value: light | ||
| title: Theme | ||
| optional: false | ||
| help_text: | | ||
| Select the visual theme for the application ('light' or 'dark'). | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| --- | ||
| syntax: manifest_v1 | ||
| id: 01JZHP34BQWKHFN9KPT0W0MH2N | ||
| description: Screenly Simple Message App QC | ||
| icon: https://playground.srly.io/edge-apps/simple-message-app/static/img/icon.svg | ||
| author: Screenly, Inc. | ||
| ready_signal: true | ||
| settings: | ||
| enable_analytics: | ||
| type: string | ||
| default_value: 'true' | ||
| title: Enable Analytics | ||
| optional: true | ||
| help_text: Enable or disable Sentry and Google Analytics integrations. | ||
| is_global: true | ||
| message_body: | ||
| type: string | ||
| default_value: | | ||
| A simple message app allows users to display text on a screen, making it a | ||
| basic tool for digital signage. Users can input and edit both the heading | ||
| and message body directly from the Screenly dashboard. | ||
| title: Message Body | ||
| optional: false | ||
| help_text: | | ||
| Enter the main text content that will be displayed in the message body. | ||
| message_header: | ||
| type: string | ||
| default_value: Simple Message App | ||
| title: Message Header | ||
| optional: false | ||
| help_text: | | ||
| Enter the headline text that will be displayed as the message title. | ||
| override_locale: | ||
| type: string | ||
| default_value: en | ||
| title: Override Locale | ||
| optional: true | ||
| help_text: | | ||
| Override the default locale with a supported language code (e.g., en, fr, de). Defaults to English if not specified. | ||
| You can find the available locales here: https://momentjs.com/ | ||
| override_timezone: | ||
| type: string | ||
| default_value: '' | ||
| title: Override Timezone | ||
| optional: true | ||
| help_text: | | ||
| Override the default timezone with a supported timezone identifier (e.g., Europe/London, America/New_York). Defaults to the system timezone if left blank. | ||
| You can find the available timezones here: https://momentjs.com/timezone/ | ||
nicomiguelino marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| tag_manager_id: | ||
| type: string | ||
| default_value: GTM-P98SPZ9Z | ||
| title: Google Tag Manager ID | ||
| optional: true | ||
| help_text: | | ||
| Enter your Google Tag Manager container ID to enable tracking and analytics. | ||
| is_global: true | ||
| theme: | ||
| type: string | ||
| default_value: light | ||
| title: Theme | ||
| optional: false | ||
| help_text: | | ||
| Select the visual theme for the application ('light' or 'dark'). | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.