Skip to content

fix: PAT expiry handling, date filters, and settings view borders#1671

Merged
rohanchkrabrty merged 2 commits into
mainfrom
fix/pat-and-view-fixes
Jun 4, 2026
Merged

fix: PAT expiry handling, date filters, and settings view borders#1671
rohanchkrabrty merged 2 commits into
mainfrom
fix/pat-and-view-fixes

Conversation

@rohanchkrabrty
Copy link
Copy Markdown
Contributor

Summary

  • Upgrade @raystack/apsara to 1.0.0-rc.12 across SDK, admin, and client-demo packages
  • Fix date filters in server-mode DataTables: expand date eq into a [start of day, next day) gte/lt range anchored to the user's local timezone, fixing the off-by-one-day RQL query and the impossible exact-timestamp eq match in all three transform-query utils
  • Show PAT expiry as a relative timestamp via dayjs fromNow, and disable the Update action (button + menu item) with an explanatory tooltip when the token is expired
  • Normalize settings view separators (general, profile, preferences, sessions, security) to 0.5px and remove the trailing border on the last section/row via :last-child

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
frontier Ready Ready Preview, Comment Jun 3, 2026 11:00am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Date filters now expand into range-based queries using local day semantics
  • Improvements

    • Expired personal access tokens display with disabled update actions and tooltip message
    • Updated PAT expiry information display formatting
  • Style

    • Refined border thickness across views for improved visual consistency
    • Added tooltip styling for improved clarity
  • UI Updates

    • Updated action menu label: "Remove from project" → "Remove"

Walkthrough

This PR upgrades @raystack/apsara to version 1.0.0-rc.12 across all applications and the SDK, implements date filter expansion logic in three transform-query.ts modules to expand date equality filters into local-day ranges, adds expired-token UI disabling and tooltips to the PAT details view, refines CSS border thickness to 0.5px across multiple view modules, and updates a menu item label.

Changes

Apsara upgrade and date filter expansion

Layer / File(s) Summary
Dependency version updates
web/apps/admin/package.json, web/apps/client-demo/package.json, web/sdk/package.json
Updates @raystack/apsara and @raystack/apsara-v1 from version 1.0.0-rc.9 to 1.0.0-rc.12 across admin, client-demo, and SDK package manifests.
Date filter expansion — SDK core utils
web/sdk/utils/transform-query.ts
Type imports switch to @raystack/apsara-v1, convertFilterValue widens to accept unknown, and transformFilter is refactored to return RQLFilter[] arrays. New transformDateFilter expands date equality filters into gte(startOfDay) / lt(nextDayStart) ranges, while non-equality date operators anchor to local day start. Query transformation uses flatMap to flatten the expanded arrays into the final filter list.
Date filter expansion — SDK React utils
web/sdk/react/utils/transform-query.ts
Applies the same date filter expansion pattern: adds dayjs import, introduces transformDateFilter for local-day semantics, converts transformFilter to return arrays, and uses flatMap for aggregation.
Date filter expansion — Admin app utils
web/apps/admin/src/utils/transform-query.ts
Implements identical date filter expansion logic: adds dayjs, introduces transformDateFilter, updates transformFilter to return arrays, and uses flatMap for query transformation.
Expired PAT token disabling and UI
web/sdk/react/views-new/pat/pat-details-view.tsx, web/sdk/react/views-new/pat/pat-details-view.module.css
PATDetailsView now derives isExpired from pat.expiresAt and disables both the PAT actions menu "Update" item and the General section "Update" button with tooltips showing "token has expired". Expiry info display is refactored to use fromNow() output. Adds .expiredTooltip CSS class with max-width: 220px for tooltip width control.
CSS border refinement across view modules
web/sdk/react/views-new/general/general-view.module.css, web/sdk/react/views-new/preferences/components/preferences-row.module.css, web/sdk/react/views-new/profile/profile-view.module.css, web/sdk/react/views-new/security/security-view.module.css, web/sdk/react/views-new/sessions/sessions-view.module.css
Updates .section and .sessionRow/.row bottom border thickness from 1px to 0.5px across multiple view CSS modules, with explicit :last-child overrides removing borders on final rows for visual hierarchy refinement.
Minor UI text update
web/sdk/react/views-new/projects/project-details-view.tsx
Changes project member removal menu item label from "Remove from project" to "Remove".

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes


Possibly related PRs

  • raystack/frontier#1594: Modifies the same transform-query.ts filter conversion logic and convertFilterValue patterns that the main PR builds upon.
  • raystack/frontier#1565: Uses data table RQL query transformations that are directly affected by the main PR's date filter expansion and flatMap changes.
  • raystack/frontier#1635: Modifies the same web/sdk/react/views-new/pat/pat-details-view.tsx file with different PAT action menu UI changes.

Suggested reviewers

  • rohilsurana
  • rsbh
  • paanSinghCoder
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Warning

Review ran into problems

🔥 Problems

Git: Failed to clone repository. Please run the @coderabbitai full review command to re-trigger a full review. If the issue persists, set path_filters to include or exclude specific files.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
web/apps/admin/src/utils/transform-query.ts (1)

133-152: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Map group_by through fieldNameMapping in the admin path too.

Filters and sorts already rename UI field keys before building the request, but groupBy still sends the raw query.group_by values. That leaves grouped admin queries inconsistent with the SDK variants in this PR whenever the backend expects mapped field names.

Suggested fix
   const rqlRequest = create(RQLRequestSchema, {
     filters,
-    groupBy: query.group_by || [],
+    groupBy: (query.group_by || []).map(
+      field => fieldNameMapping?.[field] ?? field
+    ),
     offset: query.offset || 0,
     limit: query.limit || defaultLimit,
     sort: transformSort(query.sort || [], fieldNameMapping) || [],
     search: query.search || ''
   });

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 04803451-3d12-4397-ad0f-03b4a034a013

📥 Commits

Reviewing files that changed from the base of the PR and between c2f9a2c and ec1a21f.

⛔ Files ignored due to path filters (1)
  • web/pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • web/apps/admin/package.json
  • web/apps/admin/src/utils/transform-query.ts
  • web/apps/client-demo/package.json
  • web/sdk/package.json
  • web/sdk/react/utils/transform-query.ts
  • web/sdk/react/views-new/general/general-view.module.css
  • web/sdk/react/views-new/pat/pat-details-view.module.css
  • web/sdk/react/views-new/pat/pat-details-view.tsx
  • web/sdk/react/views-new/preferences/components/preferences-row.module.css
  • web/sdk/react/views-new/profile/profile-view.module.css
  • web/sdk/react/views-new/projects/project-details-view.tsx
  • web/sdk/react/views-new/security/security-view.module.css
  • web/sdk/react/views-new/sessions/sessions-view.module.css
  • web/sdk/utils/transform-query.ts

Comment thread web/sdk/react/views-new/pat/pat-details-view.tsx
Comment thread web/sdk/utils/transform-query.ts
@coveralls
Copy link
Copy Markdown

Coverage Report for CI Build 26880447270

Coverage remained the same at 43.153%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 38000
Covered Lines: 16398
Line Coverage: 43.15%
Coverage Strength: 12.09 hits per line

💛 - Coveralls

@rohanchkrabrty rohanchkrabrty enabled auto-merge (squash) June 4, 2026 06:50
@rohanchkrabrty rohanchkrabrty merged commit 59e64ef into main Jun 4, 2026
8 checks passed
@rohanchkrabrty rohanchkrabrty deleted the fix/pat-and-view-fixes branch June 4, 2026 06:50
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