Skip to content

Release v0.1.3 with widget stylesheet and calendar updates#5

Merged
asvitloaten merged 5 commits into
devfrom
t104.4
Apr 7, 2026
Merged

Release v0.1.3 with widget stylesheet and calendar updates#5
asvitloaten merged 5 commits into
devfrom
t104.4

Conversation

@asvitloaten
Copy link
Copy Markdown
Member

This pull request introduces several new features and improvements for the OLS Sun Light Time widget package, focusing on enhanced styling, improved calendar logic, and developer experience. The most significant updates include shipping a default CSS stylesheet, correcting the calendar widget's day calculation and display, adding a standalone demo page, and fixing IIFE bundle output naming.

Key changes:

Styling and Theming

  • A default stylesheet (ols-widgets.css) is now shipped with the package, providing baseline OLS dark-theme styles for all widgets. This can be imported or linked directly, and all class names use the ols-* BEM namespace for easy overrides. [1] [2] [3] [4]

Calendar Widget Improvements

  • The calendar widget now displays the day in 106LD format (e.g., 106LD for "Light Day 106") instead of Day 106, and the calculation is fixed to always show the day within the current Light Year (modulo 365), ignoring Gregorian leap years. [1] [2]

Developer Experience

  • A new demo.html page is included for standalone preview and testing of all widgets without needing a host app. This demo imports the new CSS and demonstrates toggle menus and widget usage. [1] [2]

Build System and Distribution

  • The IIFE bundle output naming is fixed to avoid double .global.global.js suffixes, and the build script now copies the CSS file to the distribution folder. [1] [2] [3]

Documentation

  • The README is updated to reflect the new stylesheet, calendar widget format, calculation changes, toggle menu features, and the inclusion of the demo. A roadmap for future features is also added. [1] [2]

These changes together make the widgets easier to style, more accurate in their display, and simpler to integrate and test.

Release v0.1.2 with TypeScript widgets and new modal features
- Added ols-widgets.css — default OLS dark-theme stylesheet for all four
  widgets (ols-lighttime-*, ols-calendar-*, ols-orb-*, ols-arc-*);
  copied to dist/widgets/ at build time; exported as
  @olsystem/lt-lh/widgets/ols-widgets.css

- Fixed light day calculation in ols-calendar-widget.ts — was showing
  total days since epoch (472); now correctly shows day within the
  current Light Year via ((totalDays - 1) % 365) + 1 = 106LD

- Updated calendar widget label format from 'Day 106' to '106LD' to
  match the OLS Light Calendar convention

- Fixed IIFE build naming in tsup.config.ts — removed .global suffix
  from entry keys and added outExtension: () => ({ js: '.global.js' })
  so output is widget.global.js instead of widget.global.global.js;
  removed duplicate define key

- Added demo.html — standalone preview page for all four widgets using
  ESM imports + importmap for zod; includes toggle click menus (LH →
  auth / check-in, LD → auth / roots) and large toggle styles

- Updated README for v0.1.3: corrected styling note (CSS now ships),
  added New in v0.1.3 section and roadmap for personal development AI
  integration into Global ID ethical rating

- Bumped version to 0.1.3 in package.json and package-lock.json
1ba01c0  feat: update README and add default stylesheet; version bump to 0.1.3
703e41d  Merge pull request #4 from onelightsystem/dev
8bdd92e  Update tsup.config.ts
- Added default stylesheet for widgets
- Updated calendar widget display format
- Fixed light day calculation
- Included demo HTML for standalone preview
- Adjusted package.json and package-lock.json for version alignment
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR releases v0.1.3 of @olsystem/lt-lh, adding a default widget stylesheet, updating calendar widget day formatting/calculation, providing a standalone demo page, and adjusting the widget build output naming for IIFE bundles.

Changes:

  • Ship a default widget stylesheet (ols-widgets.css) and export it from the package.
  • Fix calendar widget display to ###LD and compute day-in-cycle modulo 365.
  • Adjust tsup IIFE output naming to avoid double .global.global.js, and add a demo page.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tsup.config.ts Updates widget IIFE bundle naming via outExtension while keeping ESM + IIFE widget builds.
src/widgets/ols-widgets.css Adds baseline dark-theme CSS for all widgets using ols-* class namespace.
src/widgets/ols-calendar-widget.ts Changes calendar widget day display to LD format and uses modulo-365 cycle logic.
README.md Documents new stylesheet, calendar format changes, and adds v0.1.3 notes/roadmap.
package.json Bumps version to 0.1.3, exports the CSS asset, and copies CSS into dist during build.
package-lock.json Updates lockfile contents (but version fields are inconsistent with package.json).
demo.html Adds a standalone demo page that imports dist widgets and the shipped CSS.

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

Comment thread package.json
Comment thread src/widgets/ols-calendar-widget.ts Outdated
Comment thread src/widgets/ols-calendar-widget.ts Outdated
@@ -43,15 +43,18 @@ export function initCalendarWidget(options?: CalendarWidgetOptions): void {
const now = new Date();
const todayUtcDay = Date.UTC(now.getFullYear(), now.getMonth(), now.getDate()) / 86400000;
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todayUtcDay is computed with Date.UTC(now.getFullYear(), now.getMonth(), now.getDate()), which uses local date components to produce a UTC timestamp. This makes the day calculation timezone-dependent/off-by-one around local midnight for some timezones. If the intent is truly UTC-based day counting, use getUTCFullYear/getUTCMonth/getUTCDate (or rename the variable/logic if local-day behavior is intended).

Suggested change
const todayUtcDay = Date.UTC(now.getFullYear(), now.getMonth(), now.getDate()) / 86400000;
const todayUtcDay = Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate()) / 86400000;

Copilot uses AI. Check for mistakes.
Comment thread README.md Outdated
Comment thread README.md Outdated
- Light Day calculation fixed — correctly displays day within the current Light Year (modulo 365)
- IIFE build naming fixed (no more double `.global.global.js` suffix)
- Toggle click menus — LH toggle opens auth / check-in, LD toggle opens auth / roots
- `demo.html` included for standalone preview without a host app
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README says demo.html is “included for standalone preview”, but package.json only publishes dist, README.md, and LICENSE via the files field, so consumers installing from npm won’t receive demo.html. Either add demo.html to the published files (or provide it under dist) or reword the README to indicate it’s only in the repository.

Suggested change
- `demo.html` included for standalone preview without a host app
- Repository includes `demo.html` for standalone preview without a host app

Copilot uses AI. Check for mistakes.
@asvitloaten
Copy link
Copy Markdown
Member Author

@copilot apply changes based on the comments in this thread

…negative-safe, README corrections

Agent-Logs-Url: https://github.com/onelightsystem/LT-LH/sessions/6d088817-c797-4227-8273-750d0582cdd1

Co-authored-by: asvitloaten <33326470+asvitloaten@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

@copilot apply changes based on the comments in this thread

Applied all changes in commit 8cc1113:

  • package.json: Added ./dist/widgets/**/*.css to sideEffects so bundlers (webpack etc.) preserve CSS imports.
  • ols-calendar-widget.ts: Fixed todayUtcDay to use getUTCFullYear/getUTCMonth/getUTCDate for consistent UTC day counting across timezones.
  • ols-calendar-widget.ts: Fixed dayInYear formula to ((((totalDays - 1) % 365) + 365) % 365) + 1 to handle pre-epoch/negative totalDays safely.
  • README.md: Removed the unimplemented "Toggle click menus" bullet and updated demo.html mention to clarify it's repository-only (not published to npm).

@asvitloaten
Copy link
Copy Markdown
Member Author

Thank you for the review!
Fixed dayInYear modulo to handle negative values safely.
Updated todayUtcDay to use UTC methods for timezone consistency.
Clarified README: toggle menus and demo.html are repository-only (not shipped in npm package).
Will add ols-widgets.css export in next patch if needed.
Ready for merge after these changes.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@asvitloaten asvitloaten merged commit 3c7c067 into dev Apr 7, 2026
1 check passed
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.

3 participants