feat(calendar): redesign app using plain HTML/CSS/TS#717
feat(calendar): redesign app using plain HTML/CSS/TS#717nicomiguelino wants to merge 27 commits intomasterfrom
Conversation
- Migrate from Vue 3 + Pinia to framework-free Web Components - Add reusable weekly-calendar-view custom element to edge-apps-library Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PR Reviewer Guide 🔍(Review updated until commit 60f9ed0)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 60f9ed0
Previous suggestionsSuggestions up to commit 7378c5c
|
- Fix missing error cause in events.ts - Extract CSS and utility functions into separate files to satisfy max-lines rules - Add e2e screenshots Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… file - Update `.this-week-title` to Inter Regular (weight 400), normal style, centered, with letter-spacing - Remove unused `weekly-calendar-view.css` (CSS lives in `weekly-calendar-view-styles.ts`)
- Increase day name font size to 0.98rem with line-height 1.333 - Increase day date font size to 1.469rem with line-height 1.556 - Add opacity 0.8 to today's day name - Increase day header height and time gutter padding-top to 5.225rem - Increase time gutter width to 6.5rem and padding-right to 1rem - Match time label font size to day name (0.98rem)
- Set day-body overflow to visible so the time indicator dot is not clipped - Adjust current time indicator dot left offset to -0.27rem - Remove horizontal margin from .header to fix app header alignment
- Force landscape orientation with letterbox bars and vertical centering - Fix app header margins and compact event display for short events - Fix timezone-aware day header date and locale-aware day names - Match Figma design tokens for event card and title styles
- Replace --calendar-accent-color with --theme-color-primary - Style app-header background and text color from theme - Make weekly-calendar-view background transparent
- Add `daily-calendar-view` Web Component with same styling as weekly view - Add `calendar-view-utils.ts` with shared `buildTimeGutter` and `buildEventElement` - Extract `filterEventsForWindow` into shared utils to eliminate duplication - Support `calendar_mode` setting to switch between weekly and daily views Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add `schedule-calendar-view` Web Component showing today/tomorrow events - Move `calendar-view-utils.ts` to components root (shared by all views) - Fix `generateTimeSlots` to use configured timezone for time labels - Support `schedule` as default `calendar_mode` in calendar app Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add per-mode screenshot loops (schedule, weekly, daily)
- Rename files from `WxH.png` to `{mode}-WxH.png`
- Enrich ICS mock data with more events for schedule view
- Set screenly_color_accent to #2E8B57 in mock settings
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Move icon.svg from static/ to static/img/ - Update icon URL in manifest files to match new path - Remove unused bg.webp from static/images/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rename calendar-new to calendar, replacing the old Vue 3/Pinia app - Add schedule, weekly, and daily calendar views as Web Components - Remove Vue, Vite, and blueprint dependencies - Update build tooling to use edge-apps-scripts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR migrates the Calendar edge app from a Vue 3 + Pinia implementation to framework-free Web Components, and introduces reusable calendar view components in edge-apps-library (daily/weekly/schedule) with shared event layout + rendering utilities.
Changes:
- Add
<weekly-calendar-view>,<daily-calendar-view>, and<schedule-calendar-view>Web Components (plus shared event layout + DOM builder utilities) toedge-apps-library. - Rewrite the Calendar app to render those components from plain HTML/CSS/TS, including new screenshot-test coverage and updated assets.
- Remove Vue/Vite/Vitest/Pinia scaffolding from the Calendar app and update manifests/docs accordingly.
Reviewed changes
Copilot reviewed 46 out of 87 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| edge-apps/edge-apps-library/src/components/weekly-calendar-view/weekly-calendar-view.ts | New weekly view Web Component rendering a 7-day grid with event layout + current-time indicator. |
| edge-apps/edge-apps-library/src/components/weekly-calendar-view/weekly-calendar-view-utils.ts | Shared helpers for windowing, slot generation, event styling/clipping, and safe attribute setting. |
| edge-apps/edge-apps-library/src/components/weekly-calendar-view/weekly-calendar-view-styles.ts | Shadow-DOM CSS for the weekly view. |
| edge-apps/edge-apps-library/src/components/weekly-calendar-view/index.ts | Public exports for weekly view component + event type. |
| edge-apps/edge-apps-library/src/components/weekly-calendar-view/event-layout.ts | Event overlap clustering + column layout algorithm for time-grid views. |
| edge-apps/edge-apps-library/src/components/vite-env.d.ts | Add *.css?inline module typing for component CSS imports. |
| edge-apps/edge-apps-library/src/components/schedule-calendar-view/schedule-calendar-view.ts | New schedule list view Web Component (today + tomorrow, capped). |
| edge-apps/edge-apps-library/src/components/schedule-calendar-view/schedule-calendar-view-styles.ts | Shadow-DOM CSS for the schedule view. |
| edge-apps/edge-apps-library/src/components/schedule-calendar-view/index.ts | Public export for schedule view component. |
| edge-apps/edge-apps-library/src/components/daily-calendar-view/daily-calendar-view.ts | New daily view Web Component (12-hour window, event layout, current-time indicator). |
| edge-apps/edge-apps-library/src/components/daily-calendar-view/daily-calendar-view-styles.ts | Shadow-DOM CSS for the daily view. |
| edge-apps/edge-apps-library/src/components/daily-calendar-view/index.ts | Public export for daily view component. |
| edge-apps/edge-apps-library/src/components/calendar-view-utils.ts | Shared DOM builders for time gutter + event cards used by daily/weekly views. |
| edge-apps/edge-apps-library/src/components/register.ts | Register new calendar custom elements alongside existing components. |
| edge-apps/edge-apps-library/src/components/index.ts | Export new calendar view components (and CalendarEvent type) from the library entrypoint. |
| edge-apps/edge-apps-library/package.json | Add dayjs dependency needed by the new components/utilities. |
| edge-apps/edge-apps-library/bun.lock | Lockfile update for added dependency. |
| edge-apps/calendar/src/types.ts | New local types (CalendarEvent, ViewMode, VIEW_MODE) for the rewritten app. |
| edge-apps/calendar/src/main.ts | Rewrite app bootstrap to use Web Components, theme/error setup, and periodic ticking/refresh. |
| edge-apps/calendar/src/events.ts | Update iCal fetching/parsing to be framework-free and accept explicit timezone input. |
| edge-apps/calendar/src/css/style.css | New global app styles (layout + view switching via .active). |
| edge-apps/calendar/index.html | Replace Vue mount point with static layout using auto-scaler, app-header, and calendar view elements. |
| edge-apps/calendar/package.json | Switch scripts/tooling to edge-apps-scripts workflow; remove Vue/Pinia/Vitest plumbing. |
| edge-apps/calendar/README.md | Update deployment/dev/testing/screenshot instructions for the new architecture. |
| edge-apps/calendar/e2e/screenshots.spec.ts | Add Playwright-based screenshot generation test across modes and resolutions. |
| edge-apps/calendar/screenly.yml | Update manifest icon URL path. |
| edge-apps/calendar/screenly_qc.yml | Update QC manifest icon URL path. |
| edge-apps/calendar/.ignore | Add ignore file for deployment packaging (node_modules). |
| edge-apps/calendar/.gitignore | Add gitignore for build artifacts/logs/etc. |
| edge-apps/calendar/vitest.config.ts | Remove Vitest config (no longer using Vitest). |
| edge-apps/calendar/vite.config.ts | Remove Vite config (now handled by edge-apps-scripts). |
| edge-apps/calendar/tsconfig.vitest.json | Remove Vitest TS config. |
| edge-apps/calendar/tsconfig.node.json | Remove node/tooling TS config. |
| edge-apps/calendar/tsconfig.json | Remove TS project references for the prior Vue setup. |
| edge-apps/calendar/tsconfig.app.json | Remove Vue app TS config. |
| edge-apps/calendar/src/utils.ts | Remove re-export utilities tied to the old blueprint/Vue setup. |
| edge-apps/calendar/src/test-setup.ts | Remove prior Vitest setup. |
| edge-apps/calendar/src/stores/settings.ts | Remove Pinia settings store. |
| edge-apps/calendar/src/stores/calendar.ts | Remove Pinia calendar store. |
| edge-apps/calendar/src/constants.ts | Remove old constants re-export. |
| edge-apps/calendar/src/components/tests/App.spec.ts | Remove Vue unit test. |
| edge-apps/calendar/src/assets/main.scss | Remove old SCSS styling tied to Vue blueprint layout. |
| edge-apps/calendar/src/App.vue | Remove Vue root component. |
| edge-apps/calendar/playwright.config.ts | Remove old Playwright config (now using shared screenshot helpers). |
| edge-apps/calendar/eslint.config.ts | Remove Vue/Vitest/Playwright-specific ESLint config (now via edge-apps-scripts). |
| edge-apps/calendar/e2e/vue.spec.ts | Remove old Vue-focused Playwright test. |
| edge-apps/calendar/e2e/tsconfig.json | Remove old e2e TS config. |
| edge-apps/calendar/.vscode/extensions.json | Remove Vue/Vitest editor recommendations. |
| edge-apps/calendar/screenshots/weekly-800x480.webp | Add updated weekly-mode screenshot artifact. |
| edge-apps/calendar/screenshots/weekly-720x1280.webp | Add updated weekly-mode screenshot artifact. |
| edge-apps/calendar/screenshots/weekly-480x800.webp | Add updated weekly-mode screenshot artifact. |
| edge-apps/calendar/screenshots/schedule-800x480.webp | Add updated schedule-mode screenshot artifact. |
| edge-apps/calendar/screenshots/schedule-720x1280.webp | Add updated schedule-mode screenshot artifact. |
| edge-apps/calendar/screenshots/schedule-480x800.webp | Add updated schedule-mode screenshot artifact. |
| edge-apps/calendar/screenshots/daily-800x480.webp | Add updated daily-mode screenshot artifact. |
| edge-apps/calendar/screenshots/daily-720x1280.webp | Add updated daily-mode screenshot artifact. |
| edge-apps/calendar/screenshots/daily-480x800.webp | Add updated daily-mode screenshot artifact. |
| edge-apps/calendar/screenshots/daily-1280x720.webp | Add updated daily-mode screenshot artifact. |
| edge-apps/calendar/screenshots/daily-1080x1920.webp | Add updated daily-mode screenshot artifact. |
| edge-apps/calendar/static/images/enable-google-calendar-api.png | Include static documentation image asset for setup instructions. |
| edge-apps/calendar/static/images/authorization-code.png | Include static documentation image asset for setup instructions. |
| edge-apps/calendar/src/assets/font/Aeonik-Regular.woff2 | Include font asset (legacy/compat). |
| edge-apps/calendar/src/assets/font/Aeonik-Regular.woff | Include font asset (legacy/compat). |
| edge-apps/calendar/public/fonts/Aeonik-Regular.woff2 | Include font asset served from public/. |
| edge-apps/calendar/public/fonts/Aeonik-Regular.woff | Include font asset served from public/. |
| edge-apps/calendar/public/favicon.ico | Include app favicon asset. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
edge-apps/edge-apps-library/src/components/weekly-calendar-view/weekly-calendar-view.ts
Outdated
Show resolved
Hide resolved
...edge-apps-library/src/components/calendar-views/weekly-calendar-view/weekly-calendar-view.ts
Show resolved
Hide resolved
edge-apps/edge-apps-library/src/components/weekly-calendar-view/weekly-calendar-view-utils.ts
Outdated
Show resolved
Hide resolved
edge-apps/edge-apps-library/src/components/daily-calendar-view/daily-calendar-view.ts
Outdated
Show resolved
Hide resolved
- Add white variant of screenly.svg to e2e/ - Set screenly_logo_light to a base64 data URI in screenshot tests - Regenerate screenshots Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Throttle now tick from 1s to 30s to reduce unnecessary re-renders - Replace JSON.parse for bypass_cors with getSettingWithDefault - Replace toLocaleString/parseInt with dayjs for hour/minute extraction - Move customElements.define into each calendar view component file - Remove redundant side-effect imports and define blocks from register.ts - Hoist ALLOWED_ATTRIBUTES to module-level constant in weekly-calendar-view-utils Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Persistent review updated to latest commit 60f9ed0 |
…cture - Replace Vue 3 + Pinia with vanilla TS using edge-apps-library components - Rewrite event fetching to use Google Calendar API with OAuth token management - Add token refresh loop with exponential backoff - Use getCredentials(), getSettingWithDefault() from shared library - Add color-coding support via Google Calendar colors API - Add Playwright screenshot tests with Google API route mocks Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Change icon path from `src/img/icon.svg` to `static/img/icon.svg` Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Use regex route patterns instead of glob for Google API mocks - Add mock access_token setting to bypass getCredentials() in tests - Regenerate screenshots with events properly populated Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add `centerAutoScalerVertically` to `utils/screen.ts` with tests - Add `getDateRangeForViewMode` to new `utils/calendar.ts` with tests - Add `CalendarViewMode` type and `CALENDAR_VIEW_MODE` constant to `types/index.ts` - Remove duplicated definitions from `google-calendar` and `calendar` Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Move weekly/daily/schedule views into calendar-views/ in edge-apps-library - Move event-layout.ts and calendar-view-utils.ts to calendar-views/ root - Remove redundant types.ts from calendar app - Extend CalendarEvent from base type in google-calendar types.ts - Fix getDateRangeForViewMode to use Date.now() for testability Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR migrates the calendar and google-calendar edge apps from Vue/Pinia to framework-free Web Components, while extracting reusable calendar view components and time/date utilities into @screenly/edge-apps and adding Playwright-based screenshot coverage.
Changes:
- Replace the Vue app shells with plain HTML/CSS/TS that render
<schedule-calendar-view>,<weekly-calendar-view>, and<daily-calendar-view>. - Add reusable calendar view Web Components + shared layout/windowing/date-range utilities to
edge-apps-library. - Add screenshot E2E tests and commit screenshot baselines across supported resolutions.
Reviewed changes
Copilot reviewed 85 out of 168 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| edge-apps/google-calendar/vitest.config.ts | Remove Vitest config (Vue-era tooling). |
| edge-apps/google-calendar/vite.config.ts | Remove Vite+Vue config (migrating to shared scripts/tooling). |
| edge-apps/google-calendar/tsconfig.vitest.json | Remove Vitest TS config. |
| edge-apps/google-calendar/tsconfig.node.json | Remove node TS config for legacy tooling files. |
| edge-apps/google-calendar/tsconfig.json | Remove TS project references used by Vue/Vite/Vitest setup. |
| edge-apps/google-calendar/tsconfig.app.json | Remove Vue app TS config. |
| edge-apps/google-calendar/src/utils.ts | Remove legacy blueprint utility re-exports + token fetch helper. |
| edge-apps/google-calendar/src/types.ts | Add local CalendarEvent type extending library event type. |
| edge-apps/google-calendar/src/test-setup.ts | Remove Vitest global screenly mock (tests moved away from Vitest). |
| edge-apps/google-calendar/src/stores/settings.ts | Remove Pinia settings store (Vue-era). |
| edge-apps/google-calendar/src/stores/calendar.ts | Remove Pinia calendar store and refresh loops (Vue-era). |
| edge-apps/google-calendar/src/main.ts | New TS bootstrap: selects active view element, sets locale/timezone, handles token refresh + event refresh. |
| edge-apps/google-calendar/src/img/icon.svg | Remove legacy icon location. |
| edge-apps/google-calendar/src/events.ts | Refactor Google API event fetch to use shared settings/date-range helpers + explicit timezone parameter. |
| edge-apps/google-calendar/src/css/style.css | Add framework-free app shell CSS (header/content + active view). |
| edge-apps/google-calendar/src/constants.ts | Remove blueprint calendar constants re-export. |
| edge-apps/google-calendar/src/components/tests/App.spec.ts | Remove Vue component unit test. |
| edge-apps/google-calendar/src/colors.ts | Minor refactor/simplification of colors fetch + caching logic. |
| edge-apps/google-calendar/src/assets/main.scss | Remove Vue-era SCSS shell styling. |
| edge-apps/google-calendar/playwright.config.ts | Remove legacy Playwright config (moving to shared scripts). |
| edge-apps/google-calendar/package.json | Switch to shared edge-apps-scripts, remove Vue deps, add workspace library + scripts incl. screenshots. |
| edge-apps/google-calendar/index.html | Replace Vue mount point with <auto-scaler> + header + calendar view elements. |
| edge-apps/google-calendar/eslint.config.ts | Remove Vue-era ESLint config. |
| edge-apps/google-calendar/e2e/vue.spec.ts | Remove Vue-focused E2E test. |
| edge-apps/google-calendar/e2e/tsconfig.json | Remove E2E TS config (shared tooling). |
| edge-apps/google-calendar/e2e/screenshots.spec.ts | Add screenshot E2E coverage across modes/resolutions with API mocks. |
| edge-apps/google-calendar/e2e/screenly.svg | Add SVG asset for screenshot branding mock. |
| edge-apps/google-calendar/README.md | Update docs for new setup/scripts (but currently mismatched vs Google API configuration). |
| edge-apps/google-calendar/.vscode/extensions.json | Remove Vue/Vitest/Volar extension recommendations. |
| edge-apps/google-calendar/.ignore | Add ignore for Screenly packaging (node_modules). |
| edge-apps/google-calendar/.gitignore | Simplify ignore list (but drops screenshot PNG ignore). |
| edge-apps/google-calendar/.gitattributes | Remove repo-local attributes file. |
| edge-apps/google-calendar/.editorconfig | Remove repo-local editorconfig. |
| edge-apps/google-calendar/screenly.yml | Update icon URL to new static path. |
| edge-apps/google-calendar/screenly_qc.yml | Update icon URL to new static path. |
| edge-apps/google-calendar/screenshots/daily-1080x1920.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/daily-1280x720.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/daily-1920x1080.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/daily-2160x3840.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/daily-2160x4096.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/daily-3840x2160.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/daily-4096x2160.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/daily-480x800.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/daily-720x1280.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/daily-800x480.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/schedule-1080x1920.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/schedule-1280x720.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/schedule-1920x1080.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/schedule-2160x3840.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/schedule-2160x4096.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/schedule-3840x2160.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/schedule-4096x2160.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/schedule-480x800.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/schedule-720x1280.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/schedule-800x480.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/weekly-1080x1920.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/weekly-1280x720.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/weekly-1920x1080.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/weekly-2160x3840.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/weekly-2160x4096.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/weekly-3840x2160.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/weekly-4096x2160.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/weekly-480x800.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/weekly-720x1280.webp | Add screenshot baseline. |
| edge-apps/google-calendar/screenshots/weekly-800x480.webp | Add screenshot baseline. |
| edge-apps/calendar/vitest.config.ts | Remove Vitest config (Vue-era tooling). |
| edge-apps/calendar/vite.config.ts | Remove Vite+Vue config (migrating to shared scripts/tooling). |
| edge-apps/calendar/tsconfig.vitest.json | Remove Vitest TS config. |
| edge-apps/calendar/tsconfig.node.json | Remove node TS config for legacy tooling files. |
| edge-apps/calendar/tsconfig.json | Remove TS project references used by Vue/Vite/Vitest setup. |
| edge-apps/calendar/tsconfig.app.json | Remove Vue app TS config. |
| edge-apps/calendar/src/utils.ts | Remove legacy blueprint utility re-exports. |
| edge-apps/calendar/src/test-setup.ts | Remove blueprint test setup. |
| edge-apps/calendar/src/stores/settings.ts | Remove Pinia settings store (Vue-era). |
| edge-apps/calendar/src/stores/calendar.ts | Remove Pinia calendar store (Vue-era). |
| edge-apps/calendar/src/main.ts | New TS bootstrap: selects active view element, sets locale/timezone, refreshes iCal events into the active view. |
| edge-apps/calendar/src/events.ts | Refactor iCal fetch to use shared settings/date-range helper + explicit timezone parameter. |
| edge-apps/calendar/src/css/style.css | Add framework-free app shell CSS (header/content + active view). |
| edge-apps/calendar/src/constants.ts | Remove blueprint calendar constants re-export. |
| edge-apps/calendar/src/components/tests/App.spec.ts | Remove Vue component unit test. |
| edge-apps/calendar/src/assets/main.scss | Remove Vue-era SCSS shell styling. |
| edge-apps/calendar/src/App.vue | Remove Vue app component. |
| edge-apps/calendar/playwright.config.ts | Remove legacy Playwright config (moving to shared scripts). |
| edge-apps/calendar/package.json | Switch to shared edge-apps-scripts, remove Vue deps, add scripts incl. screenshots. |
| edge-apps/calendar/index.html | Replace Vue mount point with <auto-scaler> + header + calendar view elements. |
| edge-apps/calendar/eslint.config.ts | Remove Vue-era ESLint config. |
| edge-apps/calendar/e2e/vue.spec.ts | Remove Vue-focused E2E test. |
| edge-apps/calendar/e2e/tsconfig.json | Remove E2E TS config (shared tooling). |
| edge-apps/calendar/e2e/screenshots.spec.ts | Add screenshot E2E coverage across modes/resolutions with iCal mocks. |
| edge-apps/calendar/e2e/screenly.svg | Add SVG asset for screenshot branding mock. |
| edge-apps/calendar/README.md | Update docs for new setup/scripts + configuration + screenshots. |
| edge-apps/calendar/.vscode/extensions.json | Remove Vue/Vitest/Volar extension recommendations. |
| edge-apps/calendar/.ignore | Add ignore for Screenly packaging (node_modules). |
| edge-apps/calendar/.gitignore | Add minimal ignore list (but drops screenshot PNG ignore). |
| edge-apps/calendar/screenly.yml | Update icon URL to new static path. |
| edge-apps/calendar/screenly_qc.yml | Update icon URL to new static path. |
| edge-apps/calendar/screenshots/daily-1080x1920.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/daily-1280x720.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/daily-1920x1080.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/daily-2160x3840.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/daily-2160x4096.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/daily-3840x2160.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/daily-4096x2160.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/daily-480x800.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/daily-720x1280.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/daily-800x480.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/schedule-1080x1920.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/schedule-1280x720.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/schedule-1920x1080.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/schedule-2160x3840.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/schedule-2160x4096.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/schedule-3840x2160.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/schedule-4096x2160.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/schedule-480x800.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/schedule-720x1280.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/schedule-800x480.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/weekly-1080x1920.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/weekly-1280x720.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/weekly-1920x1080.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/weekly-2160x3840.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/weekly-2160x4096.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/weekly-3840x2160.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/weekly-4096x2160.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/weekly-480x800.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/weekly-720x1280.webp | Add screenshot baseline. |
| edge-apps/calendar/screenshots/weekly-800x480.webp | Add screenshot baseline. |
| edge-apps/edge-apps-library/src/utils/screen.ts | Add centerAutoScalerVertically() helper for orientation-constrained layouts. |
| edge-apps/edge-apps-library/src/utils/screen.test.ts | Add unit tests for centerAutoScalerVertically(). |
| edge-apps/edge-apps-library/src/utils/index.ts | Export new calendar utilities. |
| edge-apps/edge-apps-library/src/utils/calendar.ts | Add timezone-aware date range computation per view mode. |
| edge-apps/edge-apps-library/src/utils/calendar.test.ts | Add unit tests for getDateRangeForViewMode(). |
| edge-apps/edge-apps-library/src/types/index.ts | Add CalendarViewMode + CALENDAR_VIEW_MODE. |
| edge-apps/edge-apps-library/src/components/vite-env.d.ts | Add *.css?inline module typing. |
| edge-apps/edge-apps-library/src/components/register.ts | Register calendar view custom elements globally. |
| edge-apps/edge-apps-library/src/components/index.ts | Export calendar view components + event types. |
| edge-apps/edge-apps-library/src/components/calendar-views/event-layout.ts | Add event overlap clustering + column/span layout algorithm. |
| edge-apps/edge-apps-library/src/components/calendar-views/calendar-view-utils.ts | Add shared time gutter + event element builders for calendar views. |
| edge-apps/edge-apps-library/src/components/calendar-views/weekly-calendar-view/weekly-calendar-view.ts | Add <weekly-calendar-view> implementation. |
| edge-apps/edge-apps-library/src/components/calendar-views/weekly-calendar-view/weekly-calendar-view-utils.ts | Add weekly windowing/time-slot/event-style helpers + attribute safety helper. |
| edge-apps/edge-apps-library/src/components/calendar-views/weekly-calendar-view/weekly-calendar-view-styles.ts | Add weekly calendar component styles. |
| edge-apps/edge-apps-library/src/components/calendar-views/weekly-calendar-view/index.ts | Export weekly view + calendar event type. |
| edge-apps/edge-apps-library/src/components/calendar-views/daily-calendar-view/daily-calendar-view.ts | Add <daily-calendar-view> implementation. |
| edge-apps/edge-apps-library/src/components/calendar-views/daily-calendar-view/daily-calendar-view-styles.ts | Add daily calendar component styles. |
| edge-apps/edge-apps-library/src/components/calendar-views/daily-calendar-view/index.ts | Export daily view. |
| edge-apps/edge-apps-library/src/components/calendar-views/schedule-calendar-view/schedule-calendar-view.ts | Add <schedule-calendar-view> implementation. |
| edge-apps/edge-apps-library/src/components/calendar-views/schedule-calendar-view/schedule-calendar-view-styles.ts | Add schedule view component styles. |
| edge-apps/edge-apps-library/src/components/calendar-views/schedule-calendar-view/index.ts | Export schedule view. |
| edge-apps/edge-apps-library/package.json | Add dayjs dependency to support new calendar/date utilities. |
| edge-apps/edge-apps-library/bun.lock | Lockfile update for dayjs dependency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const windowEndHour = (windowStartHour + 12) % 24 | ||
| const normalizedWindowEnd = | ||
| windowEndHour <= windowStartHour ? windowEndHour + 24 : windowEndHour | ||
| return events.filter((event) => { | ||
| if (event.isAllDay) return false | ||
| const eventStart = dayjs(event.startTime).tz(tz) | ||
| if (eventStart.format('YYYY-MM-DD') !== dayDateStr) return false | ||
| const startH = eventStart.hour() + eventStart.minute() / 60 | ||
| const endDt = dayjs(event.endTime).tz(tz) | ||
| const endH = endDt.hour() + endDt.minute() / 60 | ||
| const normStart = startH < windowStartHour ? startH + 24 : startH | ||
| const normEnd = endH <= windowStartHour ? endH + 24 : endH | ||
| return normStart < normalizedWindowEnd && normEnd > windowStartHour | ||
| }) |
| const windowSize = 12 | ||
| const windowEndHour = (windowStartHour + windowSize) % 24 | ||
|
|
||
| const startDt = dayjs(event.startTime).tz(tz) | ||
| const endDt = dayjs(event.endTime).tz(tz) | ||
|
|
||
| const startHour = startDt.hour() + startDt.minute() / 60 | ||
| const endHour = endDt.hour() + endDt.minute() / 60 | ||
|
|
||
| const normalizedWindowEnd = | ||
| windowEndHour <= windowStartHour ? windowEndHour + 24 : windowEndHour | ||
| const normalizedStart = | ||
| startHour < windowStartHour ? startHour + 24 : startHour | ||
| const normalizedEnd = endHour <= windowStartHour ? endHour + 24 : endHour | ||
|
|
||
| const visibleStart = Math.max(normalizedStart, windowStartHour) | ||
| const visibleEnd = Math.min(normalizedEnd, normalizedWindowEnd) | ||
|
|
||
| const topPct = ((visibleStart - windowStartHour) / windowSize) * 100 | ||
| const heightPct = Math.max( | ||
| ((visibleEnd - visibleStart) / windowSize) * 100, | ||
| 0.5, | ||
| ) | ||
|
|
||
| const clippedTop = normalizedStart < windowStartHour | ||
| const clippedBottom = normalizedEnd > normalizedWindowEnd | ||
|
|
|
|
||
| const LOGO_DATA_URL = `data:image/svg+xml;base64,${Buffer.from( | ||
| fs.readFileSync(path.join(import.meta.dirname, 'screenly.svg'), 'utf-8'), |
| const LOGO_DATA_URL = `data:image/svg+xml;base64,${Buffer.from( | ||
| fs.readFileSync(path.join(import.meta.dirname, 'screenly.svg'), 'utf-8'), | ||
| ).toString('base64')}` |
| ## Deployment | ||
|
|
||
| ## Create an Edge App Instance via CLI | ||
| Create and deploy the Edge App: | ||
|
|
||
| ```bash | ||
| screenly edge-app instance create --name=EDGE_APP_INSTANCE_NAME | ||
| screenly edge-app create --name calendar --in-place | ||
| bun run deploy | ||
| screenly edge-app instance create | ||
| ``` | ||
|
|
||
| ## Deployment | ||
| Configure the required settings: | ||
|
|
||
| ```bash | ||
| bun run deploy | ||
| screenly edge-app setting set ical_url=<YOUR_ICAL_URL> | ||
| screenly edge-app setting set bypass_cors=true | ||
| ``` | ||
|
|
||
| ## Configuration | ||
|
|
||
| | Setting | Description | Type | Default | | ||
| | ------------------- | ------------------------------------------------------------------------------------------------------ | -------- | ---------- | | ||
| | `ical_url` | iCal feed URL for your calendar (required) | secret | - | | ||
| | `calendar_mode` | View mode: `schedule`, `weekly`, or `daily` | optional | `schedule` | | ||
| | `bypass_cors` | Enable CORS bypass for iCal URLs that require it | optional | `true` | | ||
| | `override_locale` | Override the default locale (e.g. `fr`, `de`) | optional | `en` | | ||
| | `override_timezone` | Override the default timezone (e.g. `America/New_York`). Defaults to the system timezone if left blank | optional | - | | ||
| | `theme` | Visual theme: `light` or `dark` | optional | `light` | | ||
| | `display_errors` | Display errors on screen for debugging purposes | optional | `false` | | ||
| | `sentry_dsn` | Sentry DSN for error tracking and monitoring | optional | - | |
| private _render() { | ||
| const shadow = this.shadowRoot! | ||
| const tz = this._timezone | ||
| const locale = this._locale | ||
| const now = this._now | ||
|
|
||
| const nowInTz = dayjs(now).tz(tz) | ||
| const currentHour = nowInTz.hour() | ||
| const currentMinute = nowInTz.minute() | ||
| const windowStartHour = getWindowStartHour(currentHour) | ||
| const timeSlots = generateTimeSlots(windowStartHour, now, locale, tz) | ||
| const weekStart = this._getWeekStart() | ||
| const eventLayouts = this._getEventLayouts() | ||
| const todayStr = nowInTz.format('YYYY-MM-DD') | ||
| const currentSlotIndex = timeSlots.findIndex( | ||
| (slot) => slot.hour === currentHour, | ||
| ) | ||
| const timeIndicatorPct = | ||
| currentSlotIndex >= 0 | ||
| ? ((currentSlotIndex + currentMinute / 60) / 12) * 100 | ||
| : -1 | ||
|
|
||
| shadow.innerHTML = `<style>${COMPONENT_CSS}</style>` | ||
|
|
||
| const container = document.createElement('div') | ||
| container.className = 'weekly-calendar-container' | ||
| const title = document.createElement('p') | ||
| title.className = 'this-week-title' | ||
| title.textContent = 'This week' | ||
| container.appendChild(title) | ||
|
|
||
| const weekGrid = document.createElement('div') | ||
| weekGrid.className = 'week-grid' | ||
| weekGrid.appendChild(buildTimeGutter(timeSlots)) | ||
|
|
||
| const daysGrid = document.createElement('div') | ||
| daysGrid.className = 'days-grid' | ||
| for (let dayIdx = 0; dayIdx < 7; dayIdx++) { | ||
| daysGrid.appendChild( | ||
| this._buildDayColumn( | ||
| dayIdx, | ||
| weekStart, | ||
| windowStartHour, | ||
| todayStr, | ||
| timeIndicatorPct, | ||
| eventLayouts, | ||
| ), | ||
| ) | ||
| } | ||
|
|
||
| weekGrid.appendChild(daysGrid) | ||
| container.appendChild(weekGrid) | ||
| shadow.appendChild(container) | ||
| } |
| node_modules/ | ||
| dist/ | ||
| *.log | ||
| .DS_Store |
| node_modules/ | ||
| dist/ | ||
| *.log | ||
| npm-debug.log* | ||
| yarn-debug.log* | ||
| yarn-error.log* | ||
| pnpm-debug.log* | ||
| lerna-debug.log* | ||
|
|
||
| node_modules | ||
| .DS_Store |
User description
Summary
<weekly-calendar-view>custom element toedge-apps-libraryPR Type
Enhancement, Tests, Documentation
Description
Replace Vue app with custom elements
Add reusable weekly, daily, schedule views
Refactor iCal fetching with timezone filtering
Add screenshot coverage and shared tooling
Diagram Walkthrough
File Walkthrough
15 files
Bootstrap framework-free calendar and refresh cyclesCompose app shell with auto-scaler viewsDefine local calendar event and mode typesAdd base layout and active view stylingRender reusable weekly calendar web componentAdd weekly windowing, formatting, and safety helpersCompute overlapping event clusters and column spansStyle weekly headers, events, and indicatorRender daily calendar using shared layoutsStyle daily view grid and eventsRender schedule view for upcoming eventsStyle schedule columns and event cardsShare time gutter and event element buildersExport reusable calendar view componentsAuto-register calendar custom elements globally1 files
Refactor iCal fetching around explicit timezone1 files
Capture screenshot baselines across modes and sizes1 files
Adopt shared scripts and remove Vue tooling1 files
Document new setup, configuration, and screenshots1 files
Add `dayjs` runtime dependency for components56 files