Skip to content

fix: support RFC3339 timestamps in parseTrialExpiry and update banner background colors - #5451

Merged
akshaydeo merged 1 commit into
devfrom
07-22-fix_parsetrialexpiry_parsing_fix
Jul 22, 2026
Merged

akshaydeo merged 1 commit into
devfrom
07-22-fix_parsetrialexpiry_parsing_fix

Conversation

@impoiler

@impoiler impoiler commented Jul 22, 2026

Copy link
Copy Markdown
Member

Summary

Fixes two issues with the trial expiry banner: the background colours were using Tailwind opacity-modifier classes that didn't render correctly, and the trial expiry date parser rejected RFC3339 timestamps (e.g. 2024-06-01T00:00:00Z) injected by the Docker build, causing the banner to silently disappear.

Changes

  • Replaced bg-red-500/10 and bg-amber-500/10 with explicit hex values (#ffebea and #fff4e4) to ensure the banner background renders as intended in both expired/critical and warning states.
  • Updated parseTrialExpiry to accept both bare YYYY-MM-DD dates and full RFC3339 timestamps. Only the calendar date portion is used (interpreted at local midnight), so the time component is stripped before parsing.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

  1. Set TRIAL_EXPIRY_DATE to an RFC3339 value such as 2024-06-01T00:00:00Z and confirm the banner appears with the correct background colour.
  2. Set it to a bare date such as 2024-06-01 and confirm the banner still renders correctly.
  3. Set it to a date within the warning window and confirm the amber (#fff4e4) background is shown.
  4. Set it to an expired or critical date and confirm the red (#ffebea) background is shown.
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build

Screenshots/Recordings

Before: banner background was invisible due to unresolved Tailwind opacity-modifier classes.
After: banner displays the correct solid tinted background in both warning and expired/critical states.

Breaking changes

  • Yes
  • No

Related issues

Security considerations

None.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes
    • Improved trial expiry date handling to accept dates with optional time information while rejecting invalid calendar dates.
    • Updated trial expiry banner backgrounds for clearer visual distinction between warning and expired or critical states.

Walkthrough

Trial expiry parsing now accepts valid dates with optional time suffixes, while the expiry banner uses fixed background colors for expired/critical and warning states.

Changes

Trial expiry handling

Layer / File(s) Summary
Trial expiry date parsing
ui/lib/constants/config.ts
parseTrialExpiry captures and validates the calendar date from date-only or date-time input, returning null for empty, malformed, or invalid dates.
Trial expiry banner styling
ui/components/trialExpiryBanner.tsx
Expired/critical and warning states use fixed hex background colors while preserving existing text colors.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: pratham-mishra04

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main fixes: RFC3339 trial expiry parsing and banner background color updates.
Description check ✅ Passed The PR description follows the template and includes all required sections, with only minor items like related issues and checklist left unfilled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 07-22-fix_parsetrialexpiry_parsing_fix

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@impoiler
impoiler force-pushed the 07-22-fix_parsetrialexpiry_parsing_fix branch 2 times, most recently from d00ba76 to 6685c04 Compare July 22, 2026 07:17
@impoiler
impoiler force-pushed the 07-22-fix_parsetrialexpiry_parsing_fix branch from 6685c04 to 92b23d9 Compare July 22, 2026 07:18
@impoiler impoiler changed the title fix: parseTrialExpiry parsing fix fix: support RFC3339 timestamps in parseTrialExpiry and update banner background colors Jul 22, 2026
@impoiler impoiler self-assigned this Jul 22, 2026
@impoiler
impoiler marked this pull request as ready for review July 22, 2026 07:20
@coderabbitai
coderabbitai Bot requested a review from Pratham-Mishra04 July 22, 2026 07:21

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ui/components/trialExpiryBanner.tsx`:
- Line 22: Update the conditional class expression in the trial expiry banner to
add dark-mode background classes paired with the existing dark-mode red-400 and
amber-400 foreground colors, ensuring both expired/critical and warning states
remain readable in dark mode while preserving the current light-mode styles.

In `@ui/lib/constants/config.ts`:
- Around line 18-20: Update dateRegex in the date parsing logic to validate the
complete supported timestamp suffix rather than accepting arbitrary text after
the date. Preserve date-only parsing and any intentionally supported RFC3339
variants, reject malformed values such as “2024-01-01Tgarbage”, and add
regression coverage for invalid suffixes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b9ae48b2-37eb-4a2d-87cd-e7a53c1da60d

📥 Commits

Reviewing files that changed from the base of the PR and between c8df649 and 92b23d9.

📒 Files selected for processing (2)
  • ui/components/trialExpiryBanner.tsx
  • ui/lib/constants/config.ts

Comment thread ui/components/trialExpiryBanner.tsx
Comment thread ui/lib/constants/config.ts

akshaydeo commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • Jul 22, 7:33 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jul 22, 7:33 AM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo
akshaydeo merged commit f736463 into dev Jul 22, 2026
15 checks passed
@akshaydeo
akshaydeo deleted the 07-22-fix_parsetrialexpiry_parsing_fix branch July 22, 2026 07:33
akshaydeo pushed a commit that referenced this pull request Jul 24, 2026
…er background colors (#5451)

## Summary

Fixes two issues with the trial expiry banner: the background colours were using Tailwind opacity-modifier classes that didn't render correctly, and the trial expiry date parser rejected RFC3339 timestamps (e.g. `2024-06-01T00:00:00Z`) injected by the Docker build, causing the banner to silently disappear.

## Changes

- Replaced `bg-red-500/10` and `bg-amber-500/10` with explicit hex values (`#ffebea` and `#fff4e4`) to ensure the banner background renders as intended in both expired/critical and warning states.
- Updated `parseTrialExpiry` to accept both bare `YYYY-MM-DD` dates and full RFC3339 timestamps. Only the calendar date portion is used (interpreted at local midnight), so the time component is stripped before parsing.

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [x] UI (React)
- [ ] Docs

## How to test

1. Set `TRIAL_EXPIRY_DATE` to an RFC3339 value such as `2024-06-01T00:00:00Z` and confirm the banner appears with the correct background colour.
2. Set it to a bare date such as `2024-06-01` and confirm the banner still renders correctly.
3. Set it to a date within the warning window and confirm the amber (`#fff4e4`) background is shown.
4. Set it to an expired or critical date and confirm the red (`#ffebea`) background is shown.

```sh
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

## Screenshots/Recordings

Before: banner background was invisible due to unresolved Tailwind opacity-modifier classes.  
After: banner displays the correct solid tinted background in both warning and expired/critical states.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

None.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
akhsaul pushed a commit to akhsaul/bifrost that referenced this pull request Aug 27, 2026
…er background colors (maximhq#5451)

## Summary

Fixes two issues with the trial expiry banner: the background colours were using Tailwind opacity-modifier classes that didn't render correctly, and the trial expiry date parser rejected RFC3339 timestamps (e.g. `2024-06-01T00:00:00Z`) injected by the Docker build, causing the banner to silently disappear.

## Changes

- Replaced `bg-red-500/10` and `bg-amber-500/10` with explicit hex values (`#ffebea` and `#fff4e4`) to ensure the banner background renders as intended in both expired/critical and warning states.
- Updated `parseTrialExpiry` to accept both bare `YYYY-MM-DD` dates and full RFC3339 timestamps. Only the calendar date portion is used (interpreted at local midnight), so the time component is stripped before parsing.

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [x] UI (React)
- [ ] Docs

## How to test

1. Set `TRIAL_EXPIRY_DATE` to an RFC3339 value such as `2024-06-01T00:00:00Z` and confirm the banner appears with the correct background colour.
2. Set it to a bare date such as `2024-06-01` and confirm the banner still renders correctly.
3. Set it to a date within the warning window and confirm the amber (`#fff4e4`) background is shown.
4. Set it to an expired or critical date and confirm the red (`#ffebea`) background is shown.

```sh
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

## Screenshots/Recordings

Before: banner background was invisible due to unresolved Tailwind opacity-modifier classes.  
After: banner displays the correct solid tinted background in both warning and expired/critical states.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

None.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
occcat pushed a commit to occcat/bifrost that referenced this pull request Sep 2, 2026
…er background colors (maximhq#5451)

## Summary

Fixes two issues with the trial expiry banner: the background colours were using Tailwind opacity-modifier classes that didn't render correctly, and the trial expiry date parser rejected RFC3339 timestamps (e.g. `2024-06-01T00:00:00Z`) injected by the Docker build, causing the banner to silently disappear.

## Changes

- Replaced `bg-red-500/10` and `bg-amber-500/10` with explicit hex values (`#ffebea` and `#fff4e4`) to ensure the banner background renders as intended in both expired/critical and warning states.
- Updated `parseTrialExpiry` to accept both bare `YYYY-MM-DD` dates and full RFC3339 timestamps. Only the calendar date portion is used (interpreted at local midnight), so the time component is stripped before parsing.

## Type of change

- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Documentation
- [ ] Chore/CI

## Affected areas

- [ ] Core (Go)
- [ ] Transports (HTTP)
- [ ] Providers/Integrations
- [ ] Plugins
- [x] UI (React)
- [ ] Docs

## How to test

1. Set `TRIAL_EXPIRY_DATE` to an RFC3339 value such as `2024-06-01T00:00:00Z` and confirm the banner appears with the correct background colour.
2. Set it to a bare date such as `2024-06-01` and confirm the banner still renders correctly.
3. Set it to a date within the warning window and confirm the amber (`#fff4e4`) background is shown.
4. Set it to an expired or critical date and confirm the red (`#ffebea`) background is shown.

```sh
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build
```

## Screenshots/Recordings

Before: banner background was invisible due to unresolved Tailwind opacity-modifier classes.  
After: banner displays the correct solid tinted background in both warning and expired/critical states.

## Breaking changes

- [ ] Yes
- [x] No

## Related issues

## Security considerations

None.

## Checklist

- [ ] I read `docs/contributing/README.md` and followed the guidelines
- [ ] I added/updated tests where appropriate
- [ ] I updated documentation where needed
- [ ] I verified builds succeed (Go and UI)
- [ ] I verified the CI pipeline passes locally if applicable
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