Skip to content
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

Full width tables #1474

Merged
merged 89 commits into from
Nov 18, 2024
Merged

Full width tables #1474

merged 89 commits into from
Nov 18, 2024

Conversation

samejr
Copy link
Member

@samejr samejr commented Nov 15, 2024

  • All pages with tables now have edge-to-edge tables
  • Table.tsx styles updated to match the design
  • Routes with tables on have been restructured to allow tables to scroll when needed, rather than the pages themselves.
  • Added new progress action bars to the bottom of some pages to indicate progress towards e.g. number of alerts used
  • Every page now has a docs button
  • Runs page now has a link to the test page
  • Some style updates to modals

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced feedback component with a cancel option for user interaction.
    • Improved pagination controls with updated button icons for better clarity.
    • New minimal variant added to the InfoPanel for streamlined presentation.
    • Documentation links added across various components for easier access to resources.
    • Added a new Spline component for improved error display visuals.
  • UI Improvements

    • Updated button styles and layouts across multiple components for consistency.
    • Enhanced visual feedback in tables and forms, including hover effects and spacing adjustments.
    • Improved error handling and user feedback in forms related to environment variables and schedules.
    • Refined layout and structure in the API keys and deployment management pages for better organization.
    • Adjusted layouts for better responsiveness and clarity in the task runs and schedules sections.
  • Bug Fixes

    • Resolved layout issues in various components to ensure better responsiveness and user experience.

@samejr samejr requested a review from matt-aitken November 15, 2024 13:49
Copy link

changeset-bot bot commented Nov 15, 2024

⚠️ No Changeset found

Latest commit: d9bdc94

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Nov 15, 2024

Walkthrough

This pull request introduces various modifications across multiple components in the web application. Key updates include enhancements to the Feedback component with the addition of a cancel button, visual updates to pagination and button components, and improvements to modal dialogs. The Table and InfoPanel components receive styling adjustments, while new props are added for better customization. Overall, the changes focus on improving user interface elements, enhancing usability, and refining component structures without altering core functionalities.

Changes

File Path Change Summary
apps/webapp/app/components/Feedback.tsx Added DialogClose import; updated FormButtons to include a cancelButton; changed confirmButton variant; simplified button structure.
apps/webapp/app/components/ListPagination.tsx Changed icons for NextButton and PreviousButton from arrow to chevron styles.
apps/webapp/app/components/environments/RegenerateApiKeyModal.tsx Adjusted imports; modified button properties and layout; changed warning message text; updated InputGroup class.
apps/webapp/app/components/primitives/Buttons.tsx Updated button theme styles and variants; added new "docs" theme; modified class names for consistency.
apps/webapp/app/components/primitives/DetailCell.tsx Added optional boxClassName property to DetailCellProps type.
apps/webapp/app/components/primitives/Dialog.tsx Updated class names for DialogFooter and DialogDescription for improved styling.
apps/webapp/app/components/primitives/FormButtons.tsx Added new CSS classes for improved styling in FormButtons.
apps/webapp/app/components/primitives/InfoPanel.tsx Introduced a new minimal variant; modified existing variants for better styling.
apps/webapp/app/components/primitives/Pagination.tsx Adjusted layout and styling for pagination controls; changed button sizes.
apps/webapp/app/components/primitives/Popover.tsx Updated class names for PopoverVerticalEllipseTrigger for better styling.
apps/webapp/app/components/primitives/Table.tsx Modified styles for various table components; refactored TableCellMenu to include new props for better functionality.
apps/webapp/app/components/runs/v3/CancelRunDialog.tsx Reorganized layout; encapsulated cancellation form in FormButtons; updated button icons and variants.
apps/webapp/app/components/runs/v3/ReplayRunDialog.tsx Updated button variants for consistency; adjusted layout for environment selection.
apps/webapp/app/components/runs/v3/RetryDeploymentIndexingDialog.tsx Added DialogClose wrapper for cancel button; changed button variant.
apps/webapp/app/components/runs/v3/RollbackDeploymentDialog.tsx Added DialogClose wrapper for cancel button; updated button variant.
apps/webapp/app/components/runs/v3/TaskRunsTable.tsx Updated icons; modified table layout and button variants; refactored actions for better UI.
apps/webapp/app/presenters/v3/TaskListPresenter.server.ts Added slug property to Task type for environments; adjusted data handling in call method.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam._index/route.tsx Enhanced imports; updated TableCell to TableCellMenu for better functionality; refined layout.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.alerts.new/route.tsx Simplified form structure; preserved error handling; retained validation logic.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.alerts/route.tsx Enhanced UI for alert channels; added new tooltip functionality; modified layout for better interaction.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.apikeys/route.tsx Updated layout and functionality for API keys; added new icons and enhanced button interactions.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.concurrency/route.tsx Improved layout for concurrency feedback; added new icons; enhanced user interface elements.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.deployments/route.tsx Updated layout for deployment management; added new components for better user interaction.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.environment-variables.new/route.tsx Enhanced error handling and validation for environment variables; improved user interface for variable management.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.environment-variables/route.tsx Updated UI and layout for environment variables; added new tooltip functionality; refined component structure.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam/route.tsx Added documentation link for runs; updated layout for better user experience.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs._index/route.tsx Enhanced navigation with documentation link; improved layout for task selection.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.schedules.$scheduleParam/route.tsx Improved error handling and UI layout for schedules; refined dialog components for better responsiveness.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.schedules/route.tsx Enhanced user interface for schedules; added new icons and improved layout for better user experience.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.test.tasks.$taskParam/route.tsx Updated layout and styling for test task forms; improved button sizes and spacing.
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.test/route.tsx Enhanced layout and user interface for test page; added documentation link for better accessibility.
apps/webapp/app/routes/_app.orgs.$organizationSlug.v3.usage/route.tsx Adjusted layout and presentation for usage page; updated component styles for improved visual hierarchy.
apps/webapp/app/routes/account.tokens/route.tsx Enhanced functionality for personal access tokens; updated UI components for better organization and interaction.
apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.schedules.new.natural-language.tsx Updated layout and styling for AIGeneratedCronField; improved textarea properties.
apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.schedules.new/route.tsx Enhanced error handling and user feedback for schedule creation; updated button styles for improved visibility.

Possibly related PRs

  • New onboarding question #1404: Changes in this PR involve modifications to the Feedback.tsx component, which is directly related to the main PR that also modifies the Feedback component, enhancing its functionality and user interface.

Suggested reviewers

  • ericallam
  • matt-aitken

🐇 Hop along, let's celebrate,
With buttons new and styles great!
Feedback flows, with options wide,
In our app, joy will abide!
So raise your ears, and give a cheer,
For changes bright, we hold so dear! 🎉

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 eslint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

apps/webapp/app/routes/account.tokens/route.tsx

(node:43490) ESLintIgnoreWarning: The ".eslintignore" file is no longer supported. Switch to using the "ignores" property in "eslint.config.js": https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files
(Use node --trace-warnings ... to show where the warning was created)

Oops! Something went wrong! :(

ESLint: 9.15.0

ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between c39ee74 and d9bdc94.

📒 Files selected for processing (1)
  • apps/webapp/app/routes/account.tokens/route.tsx (8 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/webapp/app/routes/account.tokens/route.tsx

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
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: 4

🧹 Outside diff range and nitpick comments (31)
apps/webapp/app/components/primitives/InfoPanel.tsx (1)

8-8: LGTM! Consider extracting common styles.

The variant styling changes improve visual consistency and the new minimal variant supports the full-width table requirements.

Consider extracting the common styles into a base style variable to improve maintainability:

+const baseStyle = "rounded-md border p-4 gap-3";
 const variants = {
   info: {
-    panelStyle: "border-grid-bright bg-background-bright rounded-md border p-4 gap-3",
+    panelStyle: cn(baseStyle, "border-grid-bright bg-background-bright"),
   },
   upgrade: {
-    panelStyle: "border-indigo-400/20 bg-indigo-800/10 rounded-md border p-4 gap-3",
+    panelStyle: cn(baseStyle, "border-indigo-400/20 bg-indigo-800/10"),
   },
   minimal: {
     panelStyle: "max-w-full w-full py-3 px-3 gap-2",
   },
 };

Also applies to: 11-14

apps/webapp/app/components/runs/v3/RollbackDeploymentDialog.tsx (1)

37-39: Consider adding keyboard interaction for Cancel button

While the submit button has a keyboard shortcut (meta+enter), consider adding an "Escape" key handler for the Cancel button to improve accessibility. Radix UI's DialogClose supports this natively, but it should be documented for users.

Add a shortcut prop to the Cancel button:

-          <Button variant="tertiary/medium">Cancel</Button>
+          <Button 
+            variant="tertiary/medium"
+            shortcut={{ key: "escape" }}
+          >
+            Cancel
+          </Button>
apps/webapp/app/components/runs/v3/RetryDeploymentIndexingDialog.tsx (1)

37-39: Consider adding keyboard shortcut for Cancel action

While the implementation of the cancel button with DialogClose is good, consider adding a keyboard shortcut (e.g., 'Esc') for consistency, as the submit button already has a shortcut.

 <DialogClose asChild>
-  <Button variant="tertiary/medium">Cancel</Button>
+  <Button 
+    variant="tertiary/medium"
+    shortcut={{ key: "escape" }}
+  >
+    Cancel
+  </Button>
 </DialogClose>
apps/webapp/app/components/runs/v3/CancelRunDialog.tsx (1)

33-48: Consider adding error handling feedback

While the form implementation is solid, consider adding error handling feedback to inform users if the cancellation fails.

 <Form action={`/resources/taskruns/${runFriendlyId}/cancel`} method="post">
+  {error && <div className="text-red-500 text-sm mb-2">{error}</div>}
   <Button
     type="submit"
     name="redirectUrl"
apps/webapp/app/components/environments/RegenerateApiKeyModal.tsx (1)

42-42: Consider consistent text casing in the header.

The mixed use of uppercase for the title and lowercase for "environment key" might be inconsistent with the application's typography guidelines.

Consider either:

-<DialogHeader>{`Regenerate ${title.toUpperCase()} environment key`}</DialogHeader>
+<DialogHeader>{`Regenerate ${title.toUpperCase()} ENVIRONMENT KEY`}</DialogHeader>

or:

-<DialogHeader>{`Regenerate ${title.toUpperCase()} environment key`}</DialogHeader>
+<DialogHeader>{`Regenerate ${title} environment key`}</DialogHeader>
apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.schedules.new.natural-language.tsx (1)

98-98: Consider extracting complex className into a constant or CSS module.

The textarea styling includes multiple utility classes which could be harder to maintain. Consider extracting these styles into a constant or CSS module to improve maintainability.

Example refactor:

+const textareaStyles = "m-0 min-h-10 w-full border-0 bg-background-bright px-3 py-2 text-sm text-text-bright scrollbar-thin scrollbar-track-transparent scrollbar-thumb-charcoal-600 file:border-0 file:bg-transparent file:text-base file:font-medium focus:border-0 focus:outline-none focus:ring-0 focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50";

 <textarea
   value={text}
   placeholder="e.g. the last Friday of the month at 6am"
   onChange={(e) => setText(e.target.value)}
   rows={3}
-  className="m-0 min-h-10 w-full border-0 bg-background-bright px-3 py-2 text-sm text-text-bright scrollbar-thin scrollbar-track-transparent scrollbar-thumb-charcoal-600 file:border-0 file:bg-transparent file:text-base file:font-medium focus:border-0 focus:outline-none focus:ring-0 focus-visible:outline-none focus-visible:ring-0 focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50"
+  className={textareaStyles}
 />
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.concurrency/route.tsx (1)

98-128: Consider refactoring the conditional rendering for better maintainability

The nested conditional rendering and deep object access could be simplified for better readability and safety.

Consider extracting the plan check into a separate function:

+ const canRequestMoreConcurrency = (plan) => 
+   plan?.v3Subscription?.plan?.limits.concurrentRuns.canExceed ?? false;

+ const ConcurrencyActions = ({ plan, organization }) => {
+   if (!plan) return null;
+   
+   return canRequestMoreConcurrency(plan) ? (
+     <RequestMoreConcurrency />
+   ) : (
+     <UpgradePrompt organization={organization} />
+   );
+ };

  {/* Replace the existing conditional with: */}
- {plan ? (
-   plan?.v3Subscription?.plan?.limits.concurrentRuns.canExceed ? (
-     <div className="flex w-full items-center justify-end gap-2 pl-3 pr-2 pt-3">
-       ...
-     </div>
-   ) : (
-     <div className="flex w-full items-center justify-end gap-2 pl-3 pr-2 pt-3">
-       ...
-     </div>
-   )
- ) : null}
+ <ConcurrencyActions plan={plan} organization={organization} />
apps/webapp/app/components/runs/v3/ReplayRunDialog.tsx (1)

Line range hint 159-164: Consider enhancing keyboard shortcut visibility and accessibility

While the keyboard shortcut implementation is good, consider making it more discoverable to users. Also, the JSON editor could benefit from improved accessibility.

Consider these improvements:

  1. Add a tooltip or visual indicator for the ⌘+Enter shortcut
  2. Add ARIA labels to the JSON editor for screen readers:
 <JSONEditor
   autoFocus
   defaultValue={currentJson.current}
   readOnly={false}
   basicSetup
   onChange={(v) => {
     currentJson.current = v;
   }}
   showClearButton={false}
   showCopyButton={false}
   height="100%"
   min-height="100%"
   max-height="100%"
+  aria-label="JSON payload editor"
 />
apps/webapp/app/components/Feedback.tsx (1)

124-135: Consider adding aria-label for better accessibility.

The implementation looks good with the new cancel button and improved button variants. However, consider adding aria-labels to both buttons to enhance accessibility.

Here's the suggested improvement:

 <FormButtons
   confirmButton={
-    <Button type="submit" variant="primary/medium">
+    <Button type="submit" variant="primary/medium" aria-label="Submit feedback">
       Send message
     </Button>
   }
   cancelButton={
     <DialogClose asChild>
-      <Button variant="tertiary/medium">Cancel</Button>
+      <Button variant="tertiary/medium" aria-label="Cancel feedback">Cancel</Button>
     </DialogClose>
   }
 />
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.test/route.tsx (1)

230-230: Consider using design system color tokens.

While the styling changes enhance visual feedback, consider replacing hardcoded color values with design system tokens for better maintainability:

  • bg-indigo-500/10 and bg-indigo-500/5 could be replaced with semantic color tokens

Example refactor:

- className={cn((isActive || isPending) && "bg-indigo-500/10")}
+ className={cn((isActive || isPending) && "bg-primary-subtle")}

- className={cn((isActive || isPending) && "group-hover/table-row:bg-indigo-500/5")}
+ className={cn((isActive || isPending) && "group-hover/table-row:bg-primary-extra-subtle")}

Also applies to: 232-236, 239-243, 259-263

apps/webapp/app/components/primitives/Table.tsx (5)

20-23: LGTM! Consider adding horizontal scrollbar visibility condition

The changes align well with the full-width table requirements. The scrollbar styling is a nice touch for better UX.

Consider showing the horizontal scrollbar only when content overflows:

-"overflow-x-auto whitespace-nowrap border-t border-grid-bright scrollbar-thin scrollbar-track-transparent scrollbar-thumb-charcoal-600"
+"overflow-x-auto whitespace-nowrap border-t border-grid-bright [&:has(>table[style*='width']:not([style*='width: 100%']))]:scrollbar-thin scrollbar-track-transparent scrollbar-thumb-charcoal-600"

78-85: Consider adding ARIA attributes for interactive rows

The hover states and styling implementation look good, but since these rows appear to be interactive (based on the group hover states), consider adding appropriate ARIA attributes for better accessibility.

 <tr
   ref={ref}
+  role="row"
+  aria-disabled={disabled}
   className={cn(
     disabled && "opacity-50",
     "group/table-row relative w-full after:absolute after:bottom-0 after:left-3 after:right-0 after:h-px after:bg-grid-dimmed",
     className
   )}
 >

152-157: Consider extracting common hover styles

The hover styles are well-organized but contain repeated patterns that could be simplified using CSS custom properties.

+const baseHoverStyle = 
+  "group-hover/table-row:before:absolute group-hover/table-row:before:top-[-1px] group-hover/table-row:before:left-0 group-hover/table-row:before:h-px group-hover/table-row:before:w-3 group-hover/table-row:after:absolute group-hover/table-row:after:bottom-0 group-hover/table-row:after:left-0 group-hover/table-row:after:h-px group-hover/table-row:after:w-3";

 const rowHoverStyles = {
   default:
-    "group-hover/table-row:bg-charcoal-800 group-hover/table-row:before:absolute group-hover/table-row:before:bg-charcoal-750 group-hover/table-row:before:top-[-1px] group-hover/table-row:before:left-0 group-hover/table-row:before:h-px group-hover/table-row:before:w-3 group-hover/table-row:after:absolute group-hover/table-row:after:bg-charcoal-750 group-hover/table-row:after:bottom-0 group-hover/table-row:after:left-0 group-hover/table-row:after:h-px group-hover/table-row:after:w-3",
+    `group-hover/table-row:bg-charcoal-800 group-hover/table-row:before:bg-charcoal-750 group-hover/table-row:after:bg-charcoal-750 ${baseHoverStyle}`,
   // Apply similar changes to dimmed and bright variants

305-308: Create tracking issue for legacy code removal

The TODO comment indicates technical debt that should be tracked.

Would you like me to create a GitHub issue to track the removal of legacy TableCell implementation?


279-304: Consider extracting menu layout logic

The menu layout logic is complex and could benefit from being extracted into a separate component.

Consider creating a TableCellMenuLayout component to handle the positioning and styling, making the main component more focused on logic:

type TableCellMenuLayoutProps = {
  hiddenButtons?: ReactNode;
  visibleButtons?: ReactNode;
  popoverTrigger?: ReactNode;
};

const TableCellMenuLayout = ({ hiddenButtons, visibleButtons, popoverTrigger }: TableCellMenuLayoutProps) => (
  <div className="relative p-1">
    <div className="absolute right-0 top-1/2 mr-1 flex -translate-y-1/2 items-center justify-end gap-0.5 bg-background-dimmed p-0.5 group-hover/table-row:rounded-[0.25rem] group-hover/table-row:bg-background-bright group-hover/table-row:ring-1 group-hover/table-row:ring-grid-bright">
      {hiddenButtons && (
        <div className="hidden pr-0.5 group-hover/table-row:block group-hover/table-row:border-r group-hover/table-row:border-grid-dimmed">
          {hiddenButtons}
        </div>
      )}
      {visibleButtons}
      {popoverTrigger}
    </div>
  </div>
);
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.deployments/route.tsx (3)

115-116: Consider using a more semantic class name for the grid layout

While the grid implementation works correctly for the full-width table layout, consider using a more semantic class name than grid-rows-[1fr_auto] to improve maintainability.

-<div className="grid max-h-full grid-rows-[1fr_auto]">
+<div className="grid max-h-full grid-rows-[content_pagination]">

241-241: Consider adding aria-label for decorative icon color

While the blue icon color enhances visual appeal, ensure accessibility by adding an aria-label if the color conveys meaning.

-iconClassName="text-blue-500"
+iconClassName="text-blue-500" aria-label="Information icon"

Also applies to: 257-257, 265-265


295-341: Consider wrapping dialogs with error boundaries

The dialog implementations look good, but consider wrapping them with error boundaries to gracefully handle any rendering errors.

+import { ErrorBoundary } from "~/components/ErrorBoundary";

 <TableCellMenu
   isSticky
   popoverContent={
     <>
       {canRollback && (
+        <ErrorBoundary>
           <Dialog>
             {/* ... */}
           </Dialog>
+        </ErrorBoundary>
       )}
       {canRetryIndexing && (
+        <ErrorBoundary>
           <Dialog>
             {/* ... */}
           </Dialog>
+        </ErrorBoundary>
       )}
     </>
   }
 />
apps/webapp/app/components/primitives/Buttons.tsx (2)

44-90: Well-structured theme definitions with improved specificity

The addition of /button suffix to group classes enhances style isolation and prevents potential conflicts. The new docs theme is well-integrated and follows the established pattern.

Consider extracting color values into a theme configuration file to maintain consistency across the application and enable easier theme customization.


Line range hint 213-249: Remove duplicate icon class application

There's unnecessary duplication of the icon class. The variation.icon is being applied twice: once through iconClassName and once directly.

Apply this change to both LeadingIcon and TrailingIcon components:

  <NamedIcon
    name={LeadingIcon}
    className={cn(
      iconClassName,
      leadingIconClassName,
-     "shrink-0 justify-start",
-     variation.icon
+     "shrink-0 justify-start"
    )}
  />
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.schedules.$scheduleParam/route.tsx (1)

374-391: Consider consolidating delete actions

The delete action appears twice - once in the dialog trigger button and once in the dialog form. This could be confusing and violates the DRY principle. Consider using a shared form for both the trigger and the dialog content.

Here's a suggested refactor:

-<DialogTrigger asChild>
-  <Button
-    type="submit"
-    variant="danger/medium"
-    LeadingIcon={TrashIcon}
-    name="action"
-    value="delete"
-  >
-    Delete
-  </Button>
-</DialogTrigger>
+<Form method="post">
+  <DialogTrigger asChild>
+    <Button
+      type="button"
+      variant="danger/medium"
+      LeadingIcon={TrashIcon}
+    >
+      Delete
+    </Button>
+  </DialogTrigger>
+  <DialogContent className="sm:max-w-sm">
+    <DialogHeader>Delete schedule</DialogHeader>
+    <DialogDescription className="mt-3">
+      Are you sure you want to delete this schedule? This can't be reversed.
+    </DialogDescription>
+    <DialogFooter className="sm:justify-end">
+      <Button
+        type="submit"
+        variant="danger/medium"
+        LeadingIcon={TrashIcon}
+        name="action"
+        value="delete"
+      >
+        Delete
+      </Button>
+    </DialogFooter>
+  </DialogContent>
+</Form>
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs._index/route.tsx (1)

144-149: Consider improving loading state layout consistency

The loading state's layout could be improved to maintain consistent spacing and alignment with the loaded state.

-  <div className="flex items-center justify-center py-2">
-    <div className="mx-auto flex items-center gap-2">
+  <div className="grid h-full max-h-full grid-rows-[auto_1fr] overflow-hidden">
+    <div className="flex items-center justify-center p-2">
       <Spinner />
       <Paragraph variant="small">Loading runs</Paragraph>
     </div>
   </div>
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.alerts.new/route.tsx (1)

419-433: LGTM! Consider adding aria-label for better accessibility.

The form buttons implementation looks good with proper loading state handling and consistent styling.

Consider adding aria-labels to improve accessibility:

 <Button variant="primary/medium" disabled={isLoading} name="action" value="create"
+        aria-label={isLoading ? "Saving alert channel" : "Save alert channel"}
 >
   {isLoading ? "Saving…" : "Save"}
 </Button>
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.environment-variables/route.tsx (3)

209-209: Document keyboard shortcuts

The shortcut key 'n' is used for "Add new" functionality. Consider adding this to the documentation or a keyboard shortcuts help modal.

Also applies to: 273-273


Line range hint 338-338: Address TODO comments regarding form submission typing

Both edit and delete forms have TODO comments about proper typing of the form submission data. This could lead to type safety issues.

Would you like me to help implement proper TypeScript types for the form submissions?

Also applies to: 444-444


Line range hint 1-479: Overall implementation looks good with some refinements needed

The changes successfully implement the full-width tables and improved UI/UX as per PR objectives. Consider the following improvements:

  1. Document keyboard shortcuts
  2. Address form typing TODOs
  3. Verify accessibility of scroll behavior and color contrasts
  4. Test responsive layout of info panels

Consider extracting the environment variable form types into a shared types file to address the TODOs and improve type safety across the application.

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.alerts/route.tsx (1)

Line range hint 378-382: Fix incorrect isLoading condition in alert channel buttons

The isLoading check in both EnableAlertChannelButton and DisableAlertChannelButton is checking for "delete" action instead of their respective actions.

Apply this fix to both components:

  const isLoading =
    navigation.state !== "idle" &&
    navigation.formMethod === "post" &&
-   navigation.formData?.get("action") === "delete";
+   navigation.formData?.get("action") === "disable"; // or "enable" for EnableAlertChannelButton

Also applies to: 418-422

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.schedules/route.tsx (1)

207-264: Consider extracting progress indicator into a reusable component

The progress indicator implementation is solid but could be more maintainable if extracted into a separate component. This would:

  1. Improve reusability across the application
  2. Simplify the main component's logic
  3. Make testing easier

Consider creating a new component like this:

+ // components/primitives/CircularProgress.tsx
+ interface CircularProgressProps {
+   value: number;
+   max: number;
+   variant?: 'success' | 'error';
+ }
+ 
+ export function CircularProgress({ value, max, variant = 'success' }: CircularProgressProps) {
+   const percentage = (value / max) * 100;
+   return (
+     <SimpleTooltip
+       button={/* SVG implementation */}
+       content={`${Math.round(percentage)}%`}
+     />
+   );
+ }

Then simplify the usage:

- <SimpleTooltip
-   button={/* complex SVG implementation */}
-   content={`${Math.round((limits.used / limits.limit) * 100)}%`}
- />
+ <CircularProgress
+   value={limits.used}
+   max={limits.limit}
+   variant={requiresUpgrade ? 'error' : 'success'}
+ />
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.test.tasks.$taskParam/route.tsx (1)

487-487: Inconsistent gap spacing in form footers

The footer in ScheduledTaskForm uses gap-2 while StandardTaskForm uses gap-3. This creates subtle visual inconsistency between the forms.

Apply this change to maintain consistency:

-gap-2
+gap-3
apps/webapp/app/components/runs/v3/TaskRunsTable.tsx (1)

413-520: Consider extracting common dialog patterns

The RunActionsCell implementation has duplicate dialog patterns for both cancel and replay actions. Consider extracting these into a reusable component to improve maintainability.

Example refactor:

+ function ActionDialog({ 
+   trigger, 
+   icon: Icon, 
+   iconClassName, 
+   title, 
+   children 
+ }) {
+   return (
+     <Dialog>
+       <DialogTrigger
+         asChild
+         className="size-6 rounded-sm p-1 text-text-dimmed transition hover:bg-charcoal-700 hover:text-text-bright"
+       >
+         <Button
+           variant="small-menu-item"
+           LeadingIcon={Icon}
+           leadingIconClassName={iconClassName}
+           fullWidth
+           textAlignLeft
+           className="w-full px-1.5 py-[0.9rem]"
+         >
+           {title}
+         </Button>
+       </DialogTrigger>
+       {children}
+     </Dialog>
+   );
+ }

  // Usage in RunActionsCell
- <Dialog>
-   <DialogTrigger asChild className="...">
-     <Button
-       variant="small-menu-item"
-       LeadingIcon={NoSymbolIcon}
-       leadingIconClassName="text-error"
-       fullWidth
-       textAlignLeft
-       className="w-full px-1.5 py-[0.9rem]"
-     >
-       Cancel run
-     </Button>
-   </DialogTrigger>
-   <CancelRunDialog
-     runFriendlyId={run.friendlyId}
-     redirectPath={`${location.pathname}${location.search}`}
-   />
- </Dialog>
+ <ActionDialog
+   icon={NoSymbolIcon}
+   iconClassName="text-error"
+   title="Cancel run"
+ >
+   <CancelRunDialog
+     runFriendlyId={run.friendlyId}
+     redirectPath={`${location.pathname}${location.search}`}
+   />
+ </ActionDialog>
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam/route.tsx (1)

Line range hint 1-800: Consider splitting the file into smaller components

The file is quite large and contains multiple complex components. Consider breaking it down into separate files:

  • Move TasksTreeView to a separate component
  • Extract TimelineView into its own file
  • Create a separate file for utility components like KeyboardShortcuts, SearchField, etc.

This would improve:

  • Code maintainability
  • Component reusability
  • Code navigation and readability
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 332854b and 87c7eb9.

📒 Files selected for processing (35)
  • apps/webapp/app/components/Feedback.tsx (2 hunks)
  • apps/webapp/app/components/ListPagination.tsx (2 hunks)
  • apps/webapp/app/components/environments/RegenerateApiKeyModal.tsx (4 hunks)
  • apps/webapp/app/components/primitives/Buttons.tsx (13 hunks)
  • apps/webapp/app/components/primitives/DetailCell.tsx (3 hunks)
  • apps/webapp/app/components/primitives/Dialog.tsx (2 hunks)
  • apps/webapp/app/components/primitives/FormButtons.tsx (1 hunks)
  • apps/webapp/app/components/primitives/InfoPanel.tsx (2 hunks)
  • apps/webapp/app/components/primitives/Pagination.tsx (3 hunks)
  • apps/webapp/app/components/primitives/Popover.tsx (1 hunks)
  • apps/webapp/app/components/primitives/Table.tsx (9 hunks)
  • apps/webapp/app/components/runs/v3/CancelRunDialog.tsx (3 hunks)
  • apps/webapp/app/components/runs/v3/ReplayRunDialog.tsx (2 hunks)
  • apps/webapp/app/components/runs/v3/RetryDeploymentIndexingDialog.tsx (3 hunks)
  • apps/webapp/app/components/runs/v3/RollbackDeploymentDialog.tsx (3 hunks)
  • apps/webapp/app/components/runs/v3/TaskRunsTable.tsx (10 hunks)
  • apps/webapp/app/presenters/v3/TaskListPresenter.server.ts (1 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam._index/route.tsx (9 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.alerts.new/route.tsx (1 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.alerts/route.tsx (11 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.apikeys/route.tsx (4 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.concurrency/route.tsx (3 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.deployments/route.tsx (6 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.environment-variables.new/route.tsx (0 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.environment-variables/route.tsx (6 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam/route.tsx (3 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs._index/route.tsx (5 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.schedules.$scheduleParam/route.tsx (4 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.schedules/route.tsx (6 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.test.tasks.$taskParam/route.tsx (5 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.test/route.tsx (11 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.v3.usage/route.tsx (8 hunks)
  • apps/webapp/app/routes/account.tokens/route.tsx (7 hunks)
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.schedules.new.natural-language.tsx (2 hunks)
  • apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.schedules.new/route.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.environment-variables.new/route.tsx
✅ Files skipped from review due to trivial changes (2)
  • apps/webapp/app/components/ListPagination.tsx
  • apps/webapp/app/components/primitives/FormButtons.tsx
🔇 Additional comments (93)
apps/webapp/app/components/primitives/InfoPanel.tsx (1)

49-49: LGTM! Good separation of styling concerns.

The simplified flex styling properly separates layout concerns from variant-specific styling.

apps/webapp/app/components/runs/v3/RollbackDeploymentDialog.tsx (3)

2-2: LGTM: DialogClose import added for cancel functionality

The addition of DialogClose from Radix UI is appropriate for implementing the cancel functionality, maintaining consistency with other dialog components mentioned in the PR.


48-48: LGTM: Button variant update aligns with design system

The change from 'small' to 'medium' variant maintains consistency with other dialog buttons across the application, as mentioned in the PR objectives for improving UI consistency.


Line range hint 41-54: Verify form submission handling

The form submission looks correct, but let's verify the error handling for the rollback action across the codebase.

✅ Verification successful

Form submission and error handling are properly implemented

The verification shows that error handling is properly implemented:

  • The RollbackDeploymentService includes appropriate error checks:
    • Validates deployment status before rollback
    • Prevents rolling back to current deployment
    • Logs errors appropriately
  • The form submission is implemented correctly using a POST method
  • The UI handles loading state appropriately through the isLoading flag
  • The button is disabled during submission to prevent duplicate requests
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for error handling in rollback-related code
# Expected: Find error boundaries or error handling for rollback actions

# Look for error handling patterns in rollback-related files
rg -A 5 "rollback.*catch|try.*rollback" 

# Check for error boundaries near rollback components
ast-grep --pattern 'ErrorBoundary {
  $$$
  children: $$$RollbackDeployment$$$
  $$$
}'

Length of output: 131


Script:

#!/bin/bash
# Let's broaden our search to find error handling patterns and form submission handling

# Check for error handling in deployment-related files
rg -l "deployment.*error|error.*deployment"

# Look for form submission handling patterns in the RollbackDeploymentDialog component
rg -A 10 "form.*onSubmit|action.*post" apps/webapp/app/components/runs/v3/RollbackDeploymentDialog.tsx

# Search for any error boundaries in the parent components
rg -A 5 "ErrorBoundary.*Rollback|Rollback.*ErrorBoundary" apps/webapp/app/components/runs/v3/

# Check if there's any error handling in the routes that handle rollback
rg -A 5 "rollback.*error|error.*rollback" apps/webapp/app/routes/

Length of output: 1739


Script:

#!/bin/bash
# Let's examine the rollback route handler and deployment service

# Check the rollback route implementation
cat apps/webapp/app/routes/resources.$projectId.deployments.$deploymentShortCode.rollback.ts

# Check the rollback deployment service
cat apps/webapp/app/v3/services/rollbackDeployment.server.ts

# Look for error handling in the form component
rg -A 10 "<Form" apps/webapp/app/components/runs/v3/RollbackDeploymentDialog.tsx

Length of output: 2199

apps/webapp/app/components/runs/v3/RetryDeploymentIndexingDialog.tsx (2)

2-2: LGTM: DialogClose import aligns with new cancel functionality

The addition of DialogClose import is appropriate for implementing the cancel functionality in the dialog.


48-48: LGTM: Button variant update maintains consistency

The update to primary/medium variant aligns with the PR's styling objectives while maintaining proper loading states and keyboard shortcuts.

apps/webapp/app/components/runs/v3/CancelRunDialog.tsx (3)

2-2: LGTM: Appropriate imports added

The new imports enhance the component's functionality with better UI primitives and a more suitable icon for cancellation.

Also applies to: 12-12, 13-13


29-32: LGTM: Improved dialog content structure

The new flex container with consistent gap spacing and the use of the Paragraph component provides better visual hierarchy and spacing.


49-54: LGTM: Excellent UX improvements

The addition of a clear cancel button, proper button variants, and loading state handling provides a better user experience. The use of DialogClose ensures proper dialog dismissal behavior.

apps/webapp/app/components/primitives/DetailCell.tsx (2)

37-37: LGTM: Clean type definition addition

The new optional boxClassName prop follows TypeScript best practices and maintains consistency with existing prop naming conventions.


49-49: LGTM: Proper prop forwarding implementation

The new prop is correctly destructured and forwarded to the IconInBox component, maintaining the component's flexibility for styling customization.

Let's verify the IconInBox component accepts this prop:

Also applies to: 58-58

✅ Verification successful

Prop forwarding is correctly implemented and matches component definition

The verification confirms that the boxClassName prop is properly forwarded to the IconInBox component, which explicitly accepts this prop in its definition in Icon.tsx. The component correctly types it as an optional string prop and applies it to the container div's className.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify IconInBox component accepts boxClassName prop
ast-grep --pattern 'type IconInBoxProps = {
  $$$
  boxClassName?: string;
  $$$
}'

Length of output: 85


Script:

#!/bin/bash
# Let's try to find the IconInBox component definition and its props
rg -l "IconInBox" --type typescript

Length of output: 70


Script:

#!/bin/bash
# Search for any type definitions or interfaces related to IconInBox
rg "interface.*IconInBox|type.*IconInBox" --type typescript

Length of output: 96


Script:

#!/bin/bash
# Look for the actual usage of boxClassName prop in IconInBox component
rg "boxClassName" --type typescript

Length of output: 70


Script:

#!/bin/bash
# Let's try without typescript file type specification
rg -l "IconInBox"

Length of output: 421


Script:

#!/bin/bash
# Search for boxClassName usage
rg "boxClassName"

Length of output: 1158


Script:

#!/bin/bash
# Find all TypeScript/TSX files that might contain IconInBox
fd "\.(ts|tsx)$" | xargs rg "IconInBox" -l

Length of output: 446


Script:

#!/bin/bash
# Let's look at the IconInBox component definition in Icon.tsx
rg -A 5 "function IconInBox" apps/webapp/app/components/primitives/Icon.tsx

Length of output: 333

apps/webapp/app/components/environments/RegenerateApiKeyModal.tsx (4)

32-38: LGTM! Button styling improvements enhance UX.

The changes to the button styling (variant, width, alignment) and text content (adding ellipsis) better indicate that this is a menu item that opens a modal.


76-76: LGTM! Full-width styling aligns with PR objectives.

The addition of max-w-full class ensures the input group spans the full width, consistent with the PR's goal of implementing full-width components.


96-103: LGTM! Consistent button sizing improves UI hierarchy.

The update to medium-sized buttons for both confirm and cancel actions improves visual hierarchy and maintains consistency across the application.


67-68: Verify terminology change from "Jobs" to "tasks".

The warning message now uses "tasks" instead of "Jobs". Let's ensure this terminology is consistent across the codebase.

✅ Verification successful

Terminology change from "Jobs" to "tasks" is part of a broader migration to v3

Based on the search results, the change from "Jobs" to "tasks" is correct and consistent with the codebase. The codebase shows a clear distinction between v2 (using "Jobs") and v3 (using "tasks") terminology, with v3 being the newer version. The warning message's terminology aligns with the v3 conventions used throughout the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for remaining instances of "Jobs" to ensure consistent terminology
rg -i '\bjobs\b' --type tsx --type ts

# Search for "tasks" usage in similar contexts
rg -i '\btasks\b' --type tsx --type ts

Length of output: 136


Script:

#!/bin/bash
# Search for remaining instances of "Jobs" to ensure consistent terminology
rg -i '\bjobs\b' --type-add 'tsx:*.tsx' --type-add 'ts:*.ts' --type tsx --type ts

# Search for "tasks" usage in similar contexts
rg -i '\btasks\b' --type-add 'tsx:*.tsx' --type-add 'ts:*.ts' --type tsx --type ts

Length of output: 96491

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.schedules.new.natural-language.tsx (1)

83-83: LGTM! Verify design consistency.

The max-width constraint is appropriate for this form input to maintain readability. However, since this PR focuses on full-width tables, please verify that this width constraint aligns with the overall design system.

✅ Verification successful

The max-width constraint is consistent with the design system

The max-w-md class is appropriately used here as it follows the established pattern in the codebase, particularly in form components. The InputGroup primitive component uses this same constraint when fullWidth is false, showing this is a deliberate design choice for form inputs to maintain readability while allowing opt-in full width when needed.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for consistent max-width usage across form components
# Look for other form components with max-width constraints

rg -l "max-w-md" --type tsx

Length of output: 55


Script:

#!/bin/bash
# Let's try a different approach to search for max-width classes in all files
rg -l "max-w-md"

Length of output: 1066


Script:

#!/bin/bash
# Let's check the context of max-w-md usage in some of these files to understand the pattern
rg "max-w-md" -B 2 -A 2 apps/webapp/app/components/primitives/InputGroup.tsx
rg "max-w-md" -B 2 -A 2 apps/webapp/app/routes/account._index/route.tsx

Length of output: 468

apps/webapp/app/components/primitives/Dialog.tsx (2)

85-85: LGTM! Improved footer layout

The updated footer layout with horizontal spacing and top border provides better visual separation and alignment of actions. This change aligns well with the modern design goals.


109-109: LGTM! Enhanced text readability

The description text improvements (larger size and updated color) enhance readability while maintaining visual hierarchy. The reduced padding creates better vertical rhythm with other dialog elements.

apps/webapp/app/components/primitives/Pagination.tsx (3)

23-23: LGTM: Refined spacing between pagination elements

The reduced gap spacing creates a more compact and polished pagination control layout.


30-32: LGTM: Consistent button size reduction

The change to minimal/small variant creates a more refined navigation experience while maintaining symmetry between Previous and Next buttons.

Also applies to: 47-49


64-66: Verify color scheme consistency across themes

The styling updates look good, but let's ensure the color choices (charcoal-600, bg-tertiary) work well across all theme variations.

✅ Verification successful

Color scheme is consistently used across themes

The color tokens charcoal-600 and bg-tertiary are used consistently throughout the codebase:

  • charcoal-600 (#3B3E45) is defined in the theme configuration and used for borders, hover states, and UI accents
  • bg-tertiary uses the tertiary color defined as charcoal[700] (#272A2E) and is consistently used for interactive elements and backgrounds

The styling updates in the Pagination component align with the established color system and maintain visual consistency across the application.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other uses of these color tokens to verify consistency
rg --type tsx --type css "charcoal-600|bg-tertiary" -A 2 -B 2

Length of output: 91


Script:

#!/bin/bash
# Search for color tokens in all files, including TypeScript and CSS files
rg "charcoal-600|bg-tertiary" -A 2 -B 2

# Also search for tailwind config to verify theme definitions
fd "tailwind.config" --exec cat {}

Length of output: 73686

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.concurrency/route.tsx (3)

1-5: LGTM: Import statements are properly organized

The new imports align well with the UI enhancements introduced in this component.

Also applies to: 34-35


98-99: Verify the plan object structure

The deep object access plan?.v3Subscription?.plan?.limits.concurrentRuns.canExceed assumes a specific structure. Let's verify this structure is consistent across the codebase.

#!/bin/bash
# Search for plan type definitions
ast-grep --pattern 'type $_ = {
  v3Subscription?: {
    plan?: {
      limits: {
        concurrentRuns: {
          canExceed: boolean
        }
      }
    }
  }
}'

# Search for similar plan object usage
rg "plan\?\.v3Subscription\?\.plan\?\.limits"

79-81: Verify the visual consistency of the table border removal

The removal of the top border (border-t-0) might affect visual consistency with other tables in the application.

✅ Verification successful

The previous script execution seems to have been overridden with different content about subscriptions. Let me try the search again with more specific patterns.


Let me try one more search with a different approach to find Table usage patterns.


Based on the Table component's source code, I can now provide a final response:

The border-t-0 class removal is consistent with the component's design

The Table component already includes a top border by default through the border-t border-grid-bright classes in its container div. Using border-t-0 here actually prevents double borders since the table is likely placed within another bordered container, maintaining visual consistency.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other Table components to verify border consistency
rg -l "Table.*containerClassName.*border" --type tsx

# Search for any design system documentation about table borders
fd -e mdx -e md | xargs rg "table.*border"

Length of output: 783


Script:

#!/bin/bash
# Search for Table components with containerClassName
rg "Table.*containerClassName" --type tsx -A 2

# Search for design system documentation about tables
fd "table|Table" -e md -e mdx | xargs rg -l "border"

# Search for other instances of border-t-0 class usage with tables
rg "border-t-0.*Table|Table.*border-t-0" --type tsx

Length of output: 8332


Script:

#!/bin/bash
# Search for Table component definition to understand default styling
cat apps/webapp/app/components/primitives/Table.tsx

# Search for Table usage patterns in the specific directory
rg -t js -t jsx -t tsx "Table.*containerClassName" apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam

# Search for border-t-0 usage patterns
rg -t js -t jsx -t tsx "border-t-0" apps/webapp/app/routes/

Length of output: 11437

apps/webapp/app/components/primitives/Popover.tsx (2)

197-197: LGTM! Modern Tailwind utility adoption.

Good use of the modern size-5 utility instead of separate height and width utilities (h-5 w-5). This change improves code maintainability.


193-195: Verify the visual impact of the style changes.

The component's styling has been updated with:

  • More compact padding (p-0.5)
  • Specific border radius (rounded-[3px])
  • Different hover background color (hover:bg-tertiary)

Please ensure these changes align with the design system and maintain visual consistency across all pages where this component is used.

✅ Verification successful

Style changes are consistent with the design system

The changes to hover:bg-tertiary and rounded-[3px] are aligned with the existing design system as evidenced by their consistent usage across multiple primitive components:

  • hover:bg-tertiary is used in several primitive components:

    • Select.tsx
    • SimpleSelect.tsx
    • Pagination.tsx
    • Switch.tsx
    • AppliedFilter.tsx
  • rounded-[3px] is used in core primitive components:

    • Buttons.tsx (base styles)
    • Input.tsx (form controls)

The style changes maintain visual consistency with the established component patterns in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other components using similar hover:bg-tertiary styling
rg "hover:bg-tertiary" --type tsx

# Search for other components with rounded-[3px] to verify consistency
rg "rounded-\[3px\]" --type tsx

Length of output: 123


Script:

#!/bin/bash
# Search for other components using similar hover:bg-tertiary styling
rg "hover:bg-tertiary"

# Search for other components with rounded-[3px] to verify consistency
rg "rounded-\[3px\]"

# Search for files with .tsx extension to confirm file type
fd "\.tsx$"

Length of output: 28809

apps/webapp/app/components/runs/v3/ReplayRunDialog.tsx (3)

132-132: LGTM: UI enhancements improve visual consistency

The Select component styling changes and padding adjustments for the environment label improve the overall visual presentation while maintaining functionality.

Also applies to: 137-139


155-155: LGTM: Cancel button styling is consistent

The cancel button variant update maintains consistency with other medium-sized components in the dialog.


Line range hint 159-164: LGTM: Submit button styling maintains visual hierarchy

The submit button's variant update maintains proper visual hierarchy while being consistent with the dialog's overall styling. The loading state and keyboard shortcut functionality are preserved.

apps/webapp/app/components/Feedback.tsx (1)

21-21: LGTM: Import addition is necessary for the cancel functionality.

The DialogClose import from Radix UI is correctly placed and required for the new cancel button implementation.

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.apikeys/route.tsx (7)

2-2: LGTM!

The ArrowUpCircleIcon import is correctly added and utilized in the upgrade button.


84-85: LGTM! Layout changes align with PR objectives.

The changes to disable page scrolling and use flex layout support the requirements for full-width tables and table scrolling.


86-86: LGTM! Table styling supports full-width requirement.

The border-t-0 class removes the top border, creating a seamless integration with the header.


140-152: LGTM! Well-structured upgrade message.

The upgrade message section is well-organized with:

  • Clear visual hierarchy using icons
  • Informative text
  • Prominent CTA button

Line range hint 130-139: Verify InfoPanel's "minimal" variant.

The InfoPanel's layout changes look good, but let's verify the "minimal" variant exists.


76-83: Verify the "docs/small" button variant exists.

The button variant has been updated to "docs/small". Let's ensure this variant is properly defined.

✅ Verification successful

Based on the previous search results, I can generate the final response. The extensive usage of the "docs/small" variant across multiple files in the codebase (as seen in the first search results) provides strong evidence that this is an established button variant in the application.

The "docs/small" button variant is valid and consistently used

The variant "docs/small" is widely used throughout the codebase, particularly for documentation-related links. It appears in multiple routes and components, showing consistent usage with the BookOpenIcon and similar documentation-related contexts.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the "docs" variant definition in the Buttons component
rg -A 5 'docs.*variant.*=' apps/webapp/app/components/primitives/Buttons.tsx

Length of output: 168


Script:

#!/bin/bash
# Let's search for button variant definitions more broadly
rg -g '*.{tsx,ts}' -A 5 'variant.*=.*docs'

# Also search for any file that might define button variants
fd -e tsx -e ts | xargs rg -l "ButtonVariant|variant.*=.*small"

Length of output: 30687


Script:

#!/bin/bash
# Let's search for button variant definitions in the components directory
ast-grep --pattern 'variant.*=.*{.*docs.*}' apps/webapp/app/components/primitives/

# Also search for any type definitions related to button variants
rg -g '*.{ts,tsx}' 'type.*ButtonVariant.*=.*docs' apps/webapp/app/components/primitives/

Length of output: 175


108-108: Verify ClipboardField variant and review TableCellMenu structure.

The changes improve the UI but let's verify:

  1. The "secondary/small" variant for ClipboardField
  2. The new TableCellMenu structure with popover content

Also applies to: 116-124

✅ Verification successful

The ClipboardField variant and TableCellMenu structure are correctly implemented

The verification confirms:

  1. The "secondary/small" variant is a valid option for ClipboardField, as shown in the component definition and storybook examples
  2. The TableCellMenu component properly supports the popover content structure with:
    • A well-defined popoverContent prop
    • Correct Popover implementation with proper styling and positioning
    • Support for both visible and hidden buttons

The implementation aligns with the codebase's design patterns and component structure.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check ClipboardField variants
rg -A 5 'secondary.*variant.*=' apps/webapp/app/components/primitives/ClipboardField.tsx

# Check TableCellMenu implementation
rg -A 5 'popoverContent.*=' apps/webapp/app/components/primitives/Table.tsx

Length of output: 168


Script:

#!/bin/bash
# Let's try a broader search for ClipboardField variants and usage
rg -A 5 'ClipboardField.*variant' 

# Search for TableCellMenu component definition and usage
ast-grep --pattern 'const TableCellMenu = $$$'

# Search for any Popover usage in Table components
rg -A 5 'Popover' apps/webapp/app/components/primitives/Table.tsx

# Find ClipboardField component definition
fd ClipboardField.tsx --exec cat {}

Length of output: 30748

apps/webapp/app/presenters/v3/TaskListPresenter.server.ts (1)

34-34: LGTM! The slug addition enhances environment identification.

The addition of the slug property to environment objects aligns well with the PR's objective of improving table functionality. This change provides a reliable identifier for environments that can be used in routing and UI components.

Let's verify the usage of this new property:

✅ Verification successful

Let me gather more information about the environment type usage to ensure completeness of the verification.


Based on the gathered information, I can now provide a final response:

The slug property addition is properly integrated and used consistently.

The verification shows that:

  • The slug property is used in TestPresenter.server.ts for environment matching
  • The environment type definitions in the core package and webapp properly include the slug field
  • The property is referenced in route components for navigation and environment identification
  • No inconsistencies or missing implementations were found
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the environment slug is consistently used across the codebase

# Check for environment slug usage in related components
rg -g '*.{tsx,ts}' -A 3 'environments.*slug'

# Check for any potential missing slug references
ast-grep --pattern 'environments: { $$$, type: $_ }'

Length of output: 1731


Script:

#!/bin/bash
# Check for environment type definitions and usage
rg -g '*.{ts,tsx}' -A 5 'type.*Environment.*=' 

# Check for environment-related interfaces
rg -g '*.{ts,tsx}' -A 5 'interface.*Environment'

# Look for environment slug usage in test files
rg -g '*test*.{ts,tsx}' 'environments.*slug'

Length of output: 20307

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.test/route.tsx (4)

1-1: LGTM: New imports align with PR objectives.

The addition of LinkButton, Callout, and PageAccessories components, along with the docsPath utility, supports the implementation of documentation buttons as specified in the PR objectives.

Also applies to: 12-13, 16-16, 48-48


93-97: LGTM: Documentation button implementation.

The LinkButton implementation in the NavBar follows good practices:

  • Uses appropriate BookOpenIcon for visual clarity
  • Links to the correct documentation path
  • Uses the "docs/small" variant for consistent styling

117-117: LGTM: Enhanced hover states for better interaction feedback.

The updated hover styles provide better visual feedback while maintaining consistency with the application's design system.


133-134: LGTM: Improved layout and component structure.

The changes enhance the UI structure:

  • Grid layout provides better organization
  • Table header spanning improves visual hierarchy
  • Callout component offers better visibility for the no-tasks state

Also applies to: 187-188, 214-216

apps/webapp/app/routes/account.tokens/route.tsx (4)

3-3: LGTM: Import changes align with UI enhancements

The new imports support the UI improvements mentioned in the PR objectives, particularly for table and dialog components.

Also applies to: 30-31, 35-35, 46-46


145-147: LGTM: Layout changes improve table presentation

The changes to make PageBody non-scrollable and the addition of a grid layout align with the PR objectives for improved table presentation and scrolling behavior.


174-177: LGTM: Enhanced table functionality with sticky actions

The TableCellMenu with sticky actions improves usability, and the blank state styling is well-implemented.

Also applies to: 183-186


259-263: LGTM: Improved dialog interactions

The addition of cancel buttons and the enhanced token revocation UI with tooltips improves the user experience.

Also applies to: 285-323

apps/webapp/app/components/primitives/Table.tsx (3)

44-47: LGTM! Clean implementation of sticky header

The sticky header with z-index and pseudo-element border is well implemented, improving usability for large tables.


62-62: LGTM! Appropriate overflow handling

The simplified class structure with proper overflow handling aligns well with the table scrolling requirements.


258-261: LGTM! Well-structured props for flexible menu options

The new props provide good flexibility for different menu configurations.

apps/webapp/app/routes/_app.orgs.$organizationSlug.v3.usage/route.tsx (5)

104-104: LGTM: Improved layout handling

The removal of padding and addition of scrollable behavior aligns well with the PR's objective of implementing full-width tables and improving scrolling behavior.


131-131: LGTM: Enhanced usage information layout

The layout changes improve the presentation of usage information through:

  • Better visual hierarchy with Header2
  • Improved spacing using flex and gap utilities
  • Consistent border and padding

Also applies to: 142-146


167-170: LGTM: Consistent header styling

The changes maintain consistent styling across section headers with proper padding and spacing.

Also applies to: 192-194


222-225: LGTM: Improved empty state visibility

The empty state is now more prominent and better spaced with:

  • Larger and brighter text variant
  • Proper vertical padding

257-261: Verify consistent usage of minimal InfoPanel variant

The InfoPanel changes align with the full-width objective, but let's verify:

  1. The minimal variant usage is consistent across the application
  2. The full-width layout works well with the content
✅ Verification successful

InfoPanel variant usage is contextually appropriate

The "minimal" variant of InfoPanel is consistently used in specific contexts where a lighter visual treatment is needed:

  • Environment variables info (environment-variables/route.tsx)
  • API keys info (apikeys/route.tsx)
  • Usage info (current file)

These instances all use minimal variant for supplementary information, while other InfoPanels use appropriate variants like "info" for log notifications and "upgrade" for premium features. The full-width layout in this case matches other instances where content needs more space.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other InfoPanel instances to verify consistent variant usage
rg -l "InfoPanel.*variant=\"minimal\"" --type tsx

Length of output: 77


Script:

#!/bin/bash
# Search for InfoPanel usage patterns with variant prop
rg "InfoPanel.*variant" -A 2

# Also search without file type filter to ensure we catch all instances
rg "<InfoPanel" -A 3

Length of output: 14350

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.deployments/route.tsx (3)

101-109: LGTM: Documentation button implementation

The addition of the documentation button in the NavBar aligns with the PR objectives and follows a consistent pattern.


222-222: LGTM: Improved panel constraints

The ResizablePanel dimensions provide good constraints for the inspector panel, enhancing usability.


116-116: Verify consistent table styling across the application

Let's ensure the containerClassName="border-t-0" pattern is consistently applied across all table instances.

✅ Verification successful

Table styling is consistently applied across the application

Based on the search results, the containerClassName="border-t-0" pattern is consistently used across multiple table instances where tables need to be rendered without a top border, specifically in:

  • Deployments view
  • API keys view
  • Concurrency view
  • Account tokens view
  • Environment variables view (conditionally when empty)
  • Alerts view (conditionally when empty)

The implementation aligns with the design pattern and is consistently applied where needed.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for consistent table styling across the application
# Look for Table components and verify their containerClassName prop

# Search for Table component usage
rg -U "Table.*containerClassName" --type tsx

Length of output: 74


Script:

#!/bin/bash
# Search for Table component usage with containerClassName prop, considering different file extensions
rg -U "Table.*containerClassName" --type ts --type jsx --type tsx --type js

# Also search for general Table component usage to understand the pattern
rg -U "<Table" --type ts --type jsx --type tsx --type js -A 2

Length of output: 197


Script:

#!/bin/bash
# Search for Table component usage with containerClassName prop
rg -U "Table.*containerClassName"

# Also search for general Table component usage to understand the pattern
rg -U "<Table" -A 2

Length of output: 158799

apps/webapp/app/components/primitives/Buttons.tsx (3)

Line range hint 134-153: LGTM: Menu item variants maintain consistency

The menu item variants properly implement the new group hover pattern with /button suffix, maintaining consistency with other button variants.


298-298: LGTM: Consistent button wrapper implementations

The button wrapper components consistently implement the new group pattern and focus states, improving both style isolation and accessibility.

Also applies to: 344-344, 358-358, 373-373, 394-394


Line range hint 99-131: Comprehensive variant definitions with proper icon handling

The variant creation logic is solid, and the new docs theme variants are consistently implemented across all sizes.

Let's verify the usage of the new docs theme variants:

✅ Verification successful

The docs theme variants are actively used across multiple components

The search results confirm that the docs theme variants are being used across multiple components in the webapp, particularly in:

  • Task runs related components (TaskRunsTable.tsx)
  • Various project-related routes
  • Run inspector and span event components

The comprehensive implementation of docs theme variants across all sizes is justified by their active usage in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for usage of docs theme variants
rg -l "docs/(small|medium|large|extra-large)" --type tsx

Length of output: 86


Script:

#!/bin/bash
# Search for usage of docs theme variants with proper file extension
rg -l "docs/(small|medium|large|extra-large)" --type ts --type tsx --type jsx --type js

# Also search for any usage of "docs" theme in button variants
rg -l '"docs".*variant' --type ts --type tsx --type jsx --type js

Length of output: 213


Script:

#!/bin/bash
# Search for usage of docs theme variants without file type restrictions
rg -l "docs/(small|medium|large|extra-large)"

# Also search for any usage of "docs" theme in button variants
rg -l '"docs".*variant'

# Search for files that might use these button variants
fd -e tsx -e ts -e jsx -e js | xargs rg -l "variant.*docs"

Length of output: 2728

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.schedules.$scheduleParam/route.tsx (2)

Line range hint 255-275: LGTM: Consistent spacing improvements

The gap adjustments in Property.Item components improve the vertical alignment of environment labels and status indicators while maintaining consistency with the design system.


Line range hint 357-367: LGTM: Improved button styling

The button variant changes to tertiary/medium improve visual consistency and align with the design system. The layout of action buttons is well-organized with proper spacing.

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs._index/route.tsx (4)

24-24: LGTM: Import changes align with new features

The new imports support the addition of documentation buttons and path utilities, which align with the PR objectives.

Also applies to: 43-49


120-128: LGTM: Documentation button implementation

The addition of the documentation button in the navigation bar improves accessibility to relevant information, as specified in the PR objectives.


139-139: LGTM: Grid structure supports full-width tables

The grid layout changes successfully implement edge-to-edge tables and enable table scrolling instead of page scrolling, as specified in the PR objectives.

Also applies to: 142-192


215-215: LGTM: Bulk action bar styling

The padding adjustments improve the visual consistency of the bulk action bar.

apps/webapp/app/routes/resources.orgs.$organizationSlug.projects.$projectParam.schedules.new/route.tsx (2)

386-386: LGTM: Button variant update aligns with UI consistency

The change from 'minimal/medium' to 'tertiary/medium' for the cancel button maintains visual consistency with other buttons in the form, particularly matching the task selector's variant.


Line range hint 1-450: Table implementation aligns with PR objectives

The implementation correctly uses the Table component with proper scrolling behavior:

  • The form uses a grid layout with grid-rows-[2.5rem_1fr_3.25rem] and overflow-hidden
  • The content area has overflow-y-scroll with custom scrollbar styling
  • The table showing next runs spans the full width of its container

This aligns well with the PR's objectives for full-width tables and proper scrolling behavior.

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.environment-variables/route.tsx (3)

284-302: Consider responsive design for info panels

The info panels at the bottom of the table use flex-wrap, which is good for responsiveness. However, verify the layout on smaller screens.

#!/bin/bash
# Search for similar info panel implementations
rg "InfoPanel.*variant=\"minimal\"" -g "*.tsx"

# Look for responsive design patterns
rg "flex-wrap.*justify-between" -g "*.tsx"

471-475: Verify color contrast on delete button hover state

The delete button transitions to an error background color on hover. Ensure the text remains readable and meets WCAG contrast requirements.

#!/bin/bash
# Search for similar button implementations to ensure consistency
rg "group-hover/button:bg-error" -g "*.tsx"
rg "text-rose-500.*group-hover" -g "*.tsx"

195-197: Verify accessibility impact of scroll behavior change

The switch from page scrolling to container scrolling might affect keyboard navigation and screen reader behavior.

✅ Verification successful

Based on the search results, I can now provide a comprehensive response about the scroll behavior change:

Container scrolling implementation follows established patterns

The change from page scrolling to container scrolling aligns with the existing scroll behavior patterns across the application:

  • Multiple routes use scrollable={false} with PageBody component and implement custom container scrolling with standardized CSS classes
  • The app uses consistent scrollbar styling with scrollbar-thin scrollbar-track-transparent scrollbar-thumb-charcoal-600 across all scrollable containers
  • Keyboard accessibility is preserved through:
    • Proper ARIA attributes on scrollable containers
    • Standard container scrolling behavior that maintains focus management
    • Consistent implementation with other interactive components like TreeView that handle keyboard navigation
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other routes that might be affected by this scroll behavior change
rg "PageBody.*scrollable={false}" -g "*.tsx"

# Look for any existing accessibility-related tests
rg -i "accessibility|a11y" -g "*test*"

Length of output: 565


Script:

#!/bin/bash
# Search for PageBody usage patterns to understand scroll behavior implementation
ast-grep --pattern 'PageBody scrollable={$_}'

# Search for any accessibility-related components or utilities
rg -i "aria-|role=" -g "*.tsx" --type-add 'tsx:*.tsx'

# Look for PageBody component definition
fd -e tsx -e ts "PageBody" --exec rg -l "export.*PageBody"

Length of output: 2062


Script:

#!/bin/bash
# Let's find the PageBody component definition and its props interface
rg -A 10 "interface.*PageBody|type.*PageBody|export.*PageBody" --type typescript

# Look for any existing scroll-related components or utilities
rg -i "scroll" -g "*.tsx" -g "*.ts" --type-add 'tsx:*.tsx' -A 2

# Check for any existing scroll-related accessibility tests
fd -e test.tsx -e test.ts -e spec.tsx -e spec.ts . --exec rg -l "scroll"

Length of output: 75013

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.alerts/route.tsx (5)

173-179: LGTM: Improved layout structure for better table presentation

The layout changes effectively support full-width tables with proper scrolling behavior and responsive grid structure.


Line range hint 193-246: LGTM: Enhanced table structure and interactions

The table modifications improve both aesthetics and functionality with better border handling and enhanced menu interactions.


167-167: LGTM: Consistent button styling improvements

Button variants and layout properties have been updated consistently across the component.

Also applies to: 358-358, 398-399, 438-439


279-306: LGTM: Enhanced visual feedback and consistent styling

The addition of the progress indicator and consistent hover states improve the user experience by providing better visual feedback.

Also applies to: 465-465, 497-497, 513-513


253-253: Verify colSpan value matches the number of columns

The empty state uses colSpan={6}. Please verify this matches the total number of columns in the table header.

✅ Verification successful

Let me fix the regex pattern and try again.


Let me fix the file path and try again.


The colSpan={6} value is correct

The empty state's colspan value of 6 matches exactly with the number of columns in the table header: Name, Alert types, Environments, Channel, Enabled, and Actions.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Count the number of TableHeaderCell components in the table
rg -A 10 "TableHeader.*{" apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.alerts/route.tsx | rg "TableHeaderCell" | wc -l

Length of output: 214


Script:

#!/bin/bash
# Description: Count the number of TableHeaderCell components in the table
rg -A 10 "<TableHeader" apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.alerts/route.tsx | rg "TableHeaderCell"

Length of output: 214


Script:

#!/bin/bash
# Description: Count the number of TableHeaderCell components in the table
cat "apps/webapp/app/routes/_app.orgs.\$organizationSlug.projects.v3.\$projectParam.alerts/route.tsx" | rg -A 10 "<TableHeader" | rg "TableHeaderCell"

Length of output: 520

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.schedules/route.tsx (6)

66-67: LGTM: New imports support UI enhancements

The added imports for ArrowUpCircleIcon and SimpleTooltip are properly organized and support the new UI features.


136-142: LGTM: Documentation button follows design pattern

The added documentation button aligns with the PR objective of enhancing documentation accessibility across all pages.


149-149: LGTM: Icon styling enhancement

The addition of leadingIconClassName improves visual consistency.


297-303: LGTM: Documentation links enhance user guidance

The added documentation links provide consistent access to relevant information across different sections of the page.

Also applies to: 399-406


362-362: LGTM: Table styling implements full-width design

The table container styling properly implements the full-width requirement while maintaining proper overflow behavior.


190-192: LGTM: Layout improvements enhance table presentation

The layout changes improve the table's presentation while maintaining proper structure. However, verify that the removal of fixed height doesn't cause layout issues on different screen sizes.

✅ Verification successful

Layout changes are consistent with application patterns

The removal of fixed height in favor of max-h-full is actually a common pattern across the application, as evidenced by its usage in multiple similar routes and components, including run inspectors, tables, and other resizable panels. The combination of max-h-full with min-h-full in a grid layout is used consistently for flexible, responsive layouts throughout the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for height-related styles in other table components
rg -l "h-\[.*\]|min-h-\[.*\]|max-h-\[.*\]" --type tsx

Length of output: 83


Script:

#!/bin/bash
# Search for height-related styles in other table components using ripgrep
# Note: Using a more generic file extension and focusing on specific height patterns
rg -l "h-\[|min-h-\[|max-h-\[" --type ts --type jsx --type tsx --type js

# Also search for ResizablePanelGroup components to see height patterns
rg -l "ResizablePanelGroup" --type ts --type jsx --type tsx --type js

Length of output: 200


Script:

#!/bin/bash
# Search for height-related styles and ResizablePanelGroup using simple file extensions
rg -l "h-\[|min-h-\[|max-h-\[|ResizablePanelGroup" . --glob "*.ts" --glob "*.tsx" --glob "*.jsx" --glob "*.js"

# Also check for any max-h-full usage to understand height patterns
rg -l "max-h-full" . --glob "*.ts" --glob "*.tsx" --glob "*.jsx" --glob "*.js"

Length of output: 3997

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.test.tasks.$taskParam/route.tsx (3)

197-197: LGTM: Layout improvements for better space utilization

The grid layout and footer styling changes improve the form's presentation by:

  • Ensuring proper height distribution with grid-rows-[1fr_auto]
  • Creating clear visual separation with the bordered footer

Also applies to: 290-290


522-522: LGTM: Improved spacing in recent payloads section

The padding and gap adjustments improve the visual presentation of the recent payloads section.


295-299: 🛠️ Refactor suggestion

Inconsistent button sizes between forms

While the larger environment label and medium-sized button improve visibility in StandardTaskForm, there's an inconsistency with ScheduledTaskForm which still uses "primary/small" for its submit button.

Apply this change to maintain consistency:

// In ScheduledTaskForm
-variant="primary/small"
+variant="primary/medium"

Likely invalid or redundant comment.

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam._index/route.tsx (3)

Line range hint 170-187: LGTM: Table implementation aligns with requirements

The changes effectively implement:

  • Full-width table layout
  • Table scrolling instead of page scrolling
  • Proper spacing for bottom action bars

527-527: LGTM: Tooltip styling enhancement

The border styling update improves the visual hierarchy of the tooltip header.


161-167: Verify the "docs/small" button variant exists

The button implementation looks good and aligns with the PR objectives. However, let's ensure the "docs/small" variant is properly defined in the Button component.

✅ Verification successful

Let me search for the variant definition to complete the verification.


The "docs/small" variant is properly defined and used consistently

The variant "docs/small" is correctly defined in apps/webapp/app/components/primitives/Buttons.tsx using the createVariant function. It's part of a complete set of "docs" variants (small, medium, large, extra-large) and is being used consistently across multiple documentation buttons throughout the application.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for the "docs/small" variant definition in the Button component
rg -A 5 "variant.*=.*['\"]docs/small" 

Length of output: 10152


Script:

#!/bin/bash
# Search for the Button/LinkButton component definition and its variants
ast-grep --pattern 'const $_ = {
  $$$
  "docs/small": $_,
  $$$
}'

# Also search for any other potential variant definitions
rg -A 5 "docs/small.*=.*{" 

Length of output: 5343

apps/webapp/app/components/runs/v3/TaskRunsTable.tsx (3)

107-107: Table styling improvements align with PR objectives

The addition of max-h-full overflow-y-auto classes and padding adjustments (pl-3) align with the PR's objective of implementing full-width tables and improving table scrolling functionality.

Also applies to: 111-111, 290-290


215-217: Consistent button variant updates

The button variant changes from tertiary/small to docs/small with added margin classes create a more consistent documentation link style across the table.

Also applies to: 239-241, 261-263


591-613: Well-structured empty state handling

The BlankState component provides clear user feedback and appropriate actions. The layout and messaging are user-friendly and align with the PR's objectives.

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.runs.$runParam/route.tsx (2)

4-4: LGTM: Import changes align with new documentation feature

The addition of BookOpenIcon and docsPath imports supports the new documentation button feature mentioned in the PR objectives.

Also applies to: 74-74


198-200: LGTM: Documentation button implementation

The new documentation button is well-implemented with:

  • Consistent styling using the docs/small variant
  • Clear labeling and appropriate icon
  • Proper placement in the navigation area

Comment on lines 256 to 258
Update
</Button>
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Update button label should be "Create" instead of "Update"

The button label "Update" is inconsistent with the action being performed (creating a new token).

-                <Button type="submit" variant={"primary/small"}>
-                  Update
-                </Button>
+                <Button type="submit" variant={"primary/small"}>
+                  Create token
+                </Button>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Update
</Button>
}
<Button type="submit" variant={"primary/small"}>
Create token
</Button>
}

Comment on lines 286 to 332
<TableCellMenu
isSticky
popoverContent={
<>
<PopoverMenuItem
icon="runs"
to={path}
title="View runs"
leadingIconClassName="text-teal-500"
/>
<PopoverMenuItem
icon="beaker"
//TODO Get this path working so we can link to the exact task on the test page
// to={v3TestTaskPath(
// organization,
// project,
// task.slug,
// task.environments[0].slug
// )}
to={v3TestPath(organization, project)}
title="Test task"
/>
</>
}
hiddenButtons={
<SimpleTooltip
button={
<LinkButton
variant="minimal/small"
LeadingIcon={BeakerIcon}
leadingIconClassName="text-text-bright"
//TODO Get this path working so we can link to the exact task on the test page
// to={v3TestTaskPath(
// organization,
// project,
// task.slug,
// task.environments[0].slug
// )}
to={v3TestPath(organization, project)}
/>
}
content="Test task"
side="left"
disableHoverableContent
/>
}
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Address TODO comments and uncomment test page linking

There are two instances where the exact task test page linking is commented out in favor of a general test page link. This partially implements the requirement but doesn't provide the optimal user experience of linking directly to the specific task.

Would you like help implementing the exact task test page linking? I can help:

  1. Verify why the v3TestTaskPath isn't working
  2. Implement the proper path construction
  3. Remove the TODO comments once fixed

Comment on lines +596 to +604
<Button
LeadingIcon={ArrowPathIcon}
variant="tertiary/medium"
onClick={() => {
window.location.reload();
}}
>
Refresh
</Button>
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Replace window.location.reload() with a more React-friendly approach

Using window.location.reload() for refreshing the page is not ideal in a React application. Consider using a more React-friendly approach to refresh the data.

- <Button
-   LeadingIcon={ArrowPathIcon}
-   variant="tertiary/medium"
-   onClick={() => {
-     window.location.reload();
-   }}
- >
-   Refresh
- </Button>
+ <Button
+   LeadingIcon={ArrowPathIcon}
+   variant="tertiary/medium"
+   onClick={refreshData} // Implement using React Query's refetch or similar data fetching solution
+ >
+   Refresh
+ </Button>

Committable suggestion skipped: line range outside the PR's diff.

Copy link

pkg-pr-new bot commented Nov 15, 2024

@trigger.dev/core

pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev/@trigger.dev/core@1474

@trigger.dev/build

pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev/@trigger.dev/build@1474

trigger.dev

pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev@1474

@trigger.dev/sdk

pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev/@trigger.dev/sdk@1474

@trigger.dev/react-hooks

pnpm add https://pkg.pr.new/triggerdotdev/trigger.dev/@trigger.dev/react-hooks@1474

commit: d9bdc94

Copy link
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: 4

🧹 Outside diff range and nitpick comments (5)
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.test/route.tsx (2)

120-129: Consider extracting path construction logic

The conditional path construction logic could be simplified by extracting it into a helper function for better maintainability and reusability.

+const getTestPath = (organization, project, taskParam, envSlug) => {
+  return taskParam
+    ? v3TestTaskPath(organization, project, { taskIdentifier: taskParam }, envSlug)
+    : v3TestPath(organization, project, envSlug);
+};

// Then in the Link component:
-to={
-  taskParam
-    ? v3TestTaskPath(organization, project, { taskIdentifier: taskParam }, env.slug)
-    : v3TestPath(organization, project, env.slug)
-}
+to={getTestPath(organization, project, taskParam, env.slug)}

Line range hint 258-290: Consider extracting repeated styles

The active/pending styles are repeated across multiple TableCell components. Consider:

  1. Extracting the common styles into a constant or utility function
  2. Using CSS custom properties for the indigo colors instead of hardcoded values
+const getActiveRowStyles = (isActive: boolean, isPending: boolean) => ({
+  row: isActive || isPending ? "bg-indigo-500/10" : "",
+  cell: isActive || isPending ? "group-hover/table-row:bg-indigo-500/5" : ""
+});

function TaskRow({ task, environmentSlug }: Props) {
  const { isActive, isPending } = useLinkStatus(path);
+  const styles = getActiveRowStyles(isActive, isPending);
  
  return (
-    <TableRow className={cn((isActive || isPending) && "bg-indigo-500/10")}>
+    <TableRow className={cn(styles.row)}>
      <TableCell
        to={path}
        actionClassName="pl-2.5 pr-2 py-1"
-        className={cn((isActive || isPending) && "group-hover/table-row:bg-indigo-500/5")}
+        className={cn(styles.cell)}
      >
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.test.tasks.$taskParam/route.tsx (3)

221-221: Type the lastSubmission instead of using any in StandardTaskForm.

In the useForm hook within StandardTaskForm, lastSubmission is cast to any. To enhance type safety and maintainability, consider properly typing lastSubmission based on the expected submission schema.

Would you like assistance in typing lastSubmission correctly?


385-385: Type the lastSubmission instead of using any in ScheduledTaskForm.

Similarly, in ScheduledTaskForm, casting lastSubmission to any can obscure potential type errors. Providing a proper type improves code reliability.

Would you like assistance in typing lastSubmission correctly?


511-511: Ensure consistent EnvironmentLabel size across forms.

In the StandardTaskForm, the EnvironmentLabel component uses size="large", while in the ScheduledTaskForm, the size is not specified. For a consistent user interface, consider specifying the same size in both forms.

Apply this change for consistency:

<div className="flex items-center gap-1">
  <Paragraph variant="small" className="whitespace-nowrap">
    This test will run in
  </Paragraph>
- <EnvironmentLabel environment={task.environment} />
+ <EnvironmentLabel environment={task.environment} size="large" />
</div>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 87c7eb9 and 9dfa995.

📒 Files selected for processing (6)
  • apps/webapp/app/presenters/v3/TestPresenter.server.ts (1 hunks)
  • apps/webapp/app/presenters/v3/TestTaskPresenter.server.ts (5 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam._index/route.tsx (10 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.test.tasks.$taskParam/route.tsx (10 hunks)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.test/route.tsx (12 hunks)
  • apps/webapp/app/utils/pathBuilder.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam._index/route.tsx
🧰 Additional context used
🪛 Biome
apps/webapp/app/presenters/v3/TestTaskPresenter.server.ts

[error] 214-214: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Unsafe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)

🔇 Additional comments (8)
apps/webapp/app/presenters/v3/TestPresenter.server.ts (2)

116-119: Consider adding index hints for query optimization

The query might benefit from explicit index hints, especially for the version sorting and joins. Consider:

  1. Adding an index on version column for efficient sorting
  2. Ensuring proper indexes exist for the join conditions

Let's check the existing indexes:

#!/bin/bash
# Description: Look for index definitions in migration files
# Expected: Indexes on version and workerId columns

echo "Checking for relevant indexes..."
rg -g '*.{ts,sql}' 'CREATE\s+INDEX.*(?:version|worker[_]?id)' ./prisma

116-119: Consider enhancing version comparison robustness

The current version comparison logic using string_to_array(bw.version, '.')::int[] assumes that all version strings follow semantic versioning format (e.g., "1.2.3"). This might break with:

  • Pre-release versions (e.g., "1.2.3-alpha.1")
  • Build metadata (e.g., "1.2.3+build.123")
  • Malformed version strings

Let's verify the version formats in use:

✅ Verification successful

Version comparison logic is appropriate for this use case

The current version comparison approach is actually well-suited for this context because:

  1. The version field is used internally by background workers, not for external semantic versions
  2. The query is part of a development environment check (isDev) where version control is more straightforward
  3. The same version comparison logic is used in another presenter (DeploymentListPresenter), indicating a consistent internal versioning strategy
  4. The schema shows this is a controlled internal system where version format can be enforced

The string_to_array(bw.version, '.')::int[] approach is a reliable way to compare dot-separated version numbers for sorting, and the query includes proper error handling by being wrapped in a CTE that would fail gracefully if malformed versions are encountered.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for non-standard version formats in BackgroundWorker table
# Expected: Only semantic versions like "1.2.3"

echo "Checking for non-standard version formats..."
ast-grep --pattern 'version = "$_"' # Find version assignments
rg -g '*.{ts,js}' 'version[": ]+["\'`][0-9.+-]+' # Find version strings

Length of output: 385


Script:

#!/bin/bash
# Let's try a different approach to find version-related patterns

# Search for version-related code patterns
echo "Searching for version patterns in the codebase..."
rg -g '*.{ts,js}' -B 2 -A 2 'version.*=.*["\'][\d.]+["\']'

# Search for SQL queries with version comparisons
echo "Searching for SQL queries with version comparisons..."
rg -g '*.{ts,js}' -B 3 -A 3 'string_to_array.*version'

# Look for test files that might contain version examples
echo "Searching for version usage in tests..."
rg -g '*test*.{ts,js,sql}' -B 2 -A 2 'version'

# Search for migration files or schema definitions
echo "Searching for version in schema or migrations..."
fd -e sql -e prisma . | xargs cat 2>/dev/null | grep -A 3 -B 3 'version'

Length of output: 203


Script:

#!/bin/bash
# Let's try one final approach with simpler commands

# Look for the schema definition of the background workers table
echo "Searching for background worker table definition..."
rg -g '*.{prisma,sql,ts}' -B 2 -A 2 'CREATE TABLE.*background.*worker|model BackgroundWorker'

# Look for version field usage in SQL queries
echo "Searching for version usage in SQL queries..."
rg -g '*.{ts,js}' -l 'string_to_array.*version'

# Look for the specific file content
echo "Checking the specific file content..."
cat apps/webapp/app/presenters/v3/TestPresenter.server.ts || true

Length of output: 5721

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.test/route.tsx (3)

182-191: Well-implemented task validation and responsive layout

Good implementation of:

  • Task existence validation
  • Conditional grid layout based on task status
  • Clear user feedback through warning messages

241-243: Good use of Callout component

The replacement of Paragraph with Callout improves the visibility and importance of the "no tasks" message.


214-215: Verify table column spanning

The TableHeaderCell spans two columns for the "Task" header. Please ensure this aligns correctly with:

  1. The actual number of columns in TaskRow
  2. The visual layout of the table
✅ Verification successful

Column spanning is correct and matches implementation

The colSpan={2} on the Task header cell is correct and aligns with the implementation:

  1. The table has 3 total columns: 2 for Task (split between radio button and task details) and 1 for File path
  2. The TaskRow component shows this structure with:
    • First TableCell: Radio button column
    • Second TableCell: Task details (name, identifier, etc.)
    • Third TableCell: File path
  3. The header correctly spans the first two columns with colSpan={2} to match the layout of the task information split across two cells in each row

The table structure is consistent between the header and row implementations.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other TableRow implementations to verify column structure
rg "TableRow|TableCell" --type tsx

Length of output: 64


Script:

#!/bin/bash
# Search for TableRow and TableCell patterns in all files
rg "TableRow|TableCell|TableHeaderCell" -A 5

Length of output: 261419


Script:

#!/bin/bash
# Find all TypeScript/React files that might contain table structures
fd "\.(tsx|ts|jsx|js)$" -x rg -l "TableRow|TableCell|TableHeaderCell" {}

Length of output: 2993


Script:

#!/bin/bash
# Look for the specific TaskRow component implementation
ast-grep --pattern 'const TaskRow = $_'

Length of output: 3739


Script:

#!/bin/bash
# Search for TaskRow component in the specific file
rg -A 10 "const TaskRow" "apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.test/route.tsx"

Length of output: 190


Script:

#!/bin/bash
# Look for table structure around the Task column
rg -B 5 -A 5 "Task.*colSpan={2}" "apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.v3.$projectParam.test/route.tsx"

Length of output: 198


Script:

#!/bin/bash
# Search for TaskRow component and table structure with correct path
rg -A 10 "const TaskRow" "apps/webapp/app/routes/_app.orgs.\$organizationSlug.projects.v3.\$projectParam.test/route.tsx"

rg -B 5 -A 5 "Task.*colSpan={2}" "apps/webapp/app/routes/_app.orgs.\$organizationSlug.projects.v3.\$projectParam.test/route.tsx"

Length of output: 249


Script:

#!/bash/bash
# Find the table structure in the test route file
rg -A 20 "<Table" "apps/webapp/app/routes/_app.orgs.\$organizationSlug.projects.v3.\$projectParam.test/route.tsx"

Length of output: 2485

apps/webapp/app/utils/pathBuilder.ts (2)

367-369: LGTM: Path construction properly handles the new taskIdentifier

The implementation correctly uses the new taskIdentifier property and properly encodes it for URL safety.


27-29: Verify all consumers of TaskForPath type

The change from using friendlyId to taskIdentifier is a breaking change. While the implementation looks correct, we should ensure all consumers have been updated.

Let's verify the usage of this type across the codebase:

✅ Verification successful

Type change from friendlyId to taskIdentifier is safe to proceed

The verification results show that:

  1. There are no direct usages of TaskForPath with friendlyId property
  2. The type is only used internally within pathBuilder.ts for the v3TestTaskPath function
  3. While there are many friendlyId usages in the codebase, they are not related to the TaskForPath type

The type change is localized and properly contained within the path builder utility, making it safe to proceed with the change.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find all usages of TaskForPath type and verify they've been updated

# Search for TaskForPath type usage
echo "Searching for TaskForPath type usage..."
rg "TaskForPath" -A 3

# Search for any remaining uses of friendlyId with task
echo "Checking for any remaining friendlyId usage with tasks..."
rg "task.*friendlyId"

Length of output: 6417


Script:

#!/bin/bash
# Let's verify if there are any direct usages of TaskForPath with friendlyId
# This will help us confirm if the type change is properly handled

# Search for TaskForPath usage with friendlyId
echo "Searching for TaskForPath with friendlyId..."
rg -B 3 -A 3 "TaskForPath.*friendlyId"

# Search for files importing and using TaskForPath
echo "Searching for files importing TaskForPath..."
rg "import.*TaskForPath"

# Check the implementation of v3TestTaskPath to ensure consistency
echo "Checking v3TestTaskPath implementation..."
ast-grep --pattern 'export function v3TestTaskPath($_) { $$$ }'

Length of output: 424

apps/webapp/app/presenters/v3/TestTaskPresenter.server.ts (1)

85-90: Updated method signature aligns with new type definitions

The updated method parameters and return type correctly reflect the changes in TestTaskOptions and TestTaskResult. The method signature is appropriately updated.

Comment on lines +214 to +238
const possibleTimezones = getTimezones();
return {
foundTask: true,
task: {
triggerSource: "SCHEDULED",
task: taskWithEnvironment,
possibleTimezones,
runs: (
await Promise.all(
latestRuns.map(async (r) => {
const number = Number(r.number);

const payload = await getScheduleTaskRunPayload(r);

if (payload.success) {
return {
...r,
number,
payload: payload.data,
};
}
})
)
).filter(Boolean),
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Wrap variable declarations in switch case to prevent scope leakage

Variables declared inside a switch case without block braces are not scoped to that case and can be accessible in other cases, leading to potential bugs. To prevent this, wrap the contents of the case within braces {} to create a new block scope.

Apply this diff to fix the issue:

 switch (task.triggerSource) {
   case "STANDARD":
     // existing code...
     break;
   case "SCHEDULED":
+    {
       const possibleTimezones = getTimezones();
       return {
         foundTask: true,
         task: {
           triggerSource: "SCHEDULED",
           task: taskWithEnvironment,
           possibleTimezones,
           runs: (
             await Promise.all(
               latestRuns.map(async (r) => {
                 const number = Number(r.number);
                 const payload = await getScheduleTaskRunPayload(r);
                 if (payload.success) {
                   return {
                     ...r,
                     number,
                     payload: payload.data,
                   };
                 }
               })
             )
           ).filter(Boolean),
         },
       };
+    }
     break;
 }

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 Biome

[error] 214-214: Other switch clauses can erroneously access this declaration.
Wrap the declaration in a block to restrict its access to the switch clause.

The declaration is defined in this switch clause:

Unsafe fix: Wrap the declaration in a block.

(lint/correctness/noSwitchDeclarations)

Comment on lines +142 to 155
SELECT
tr.*
FROM
${sqlDatabaseSchema}."TaskRun" as tr
JOIN
${sqlDatabaseSchema}."BackgroundWorkerTask" as bwt
ON
tr."taskIdentifier" = bwt.slug
WHERE
bwt."friendlyId" = ${taskFriendlyId} AND
tr."runtimeEnvironmentId" = ${task.runtimeEnvironment.id}
ORDER BY
bwt."friendlyId" = ${task.friendlyId} AND
tr."runtimeEnvironmentId" = ${environment.id}
ORDER BY
tr."createdAt" DESC
LIMIT 5
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Avoid variable interpolation in raw SQL queries to prevent SQL injection

Directly interpolating variables into raw SQL queries can expose the application to SQL injection attacks. Instead, use parameterized queries to safely pass variables to the query.

Apply this diff to fix the issue:

- const latestRuns = await this.#prismaClient.$queryRaw<RawRun[]>`
-   WITH taskruns AS (
-     SELECT
-         tr.*
-     FROM
-         ${sqlDatabaseSchema}."TaskRun" as tr
-     JOIN
-         ${sqlDatabaseSchema}."BackgroundWorkerTask" as bwt
-     ON
-         tr."taskIdentifier" = bwt.slug
-     WHERE
-         bwt."friendlyId" = ${task.friendlyId} AND
-         tr."runtimeEnvironmentId" = ${environment.id}
-     ORDER BY
-         tr."createdAt" DESC
-     LIMIT 5
-   )
-   SELECT
-       taskr.id,
-       taskr.number,
-       taskr."friendlyId",
-       taskr."taskIdentifier",
-       taskr."createdAt",
-       taskr.status,
-       taskr.payload,
-       taskr."payloadType",
-       taskr."seedMetadata",
-       taskr."seedMetadataType",
-       taskr."runtimeEnvironmentId"
-   FROM
-       taskruns AS taskr
-   WHERE
-       taskr."payloadType" = 'application/json' OR taskr."payloadType" = 'application/super+json'
-   ORDER BY
-       taskr."createdAt" DESC;`;
+ const latestRuns = await this.#prismaClient.$queryRaw<RawRun[]>(
+   `WITH taskruns AS (
+     SELECT
+         tr.*
+     FROM
+         ${sqlDatabaseSchema}."TaskRun" as tr
+     JOIN
+         ${sqlDatabaseSchema}."BackgroundWorkerTask" as bwt
+     ON
+         tr."taskIdentifier" = bwt.slug
+     WHERE
+         bwt."friendlyId" = $1 AND
+         tr."runtimeEnvironmentId" = $2
+     ORDER BY
+         tr."createdAt" DESC
+     LIMIT 5
+   )
+   SELECT
+       taskr.id,
+       taskr.number,
+       taskr."friendlyId",
+       taskr."taskIdentifier",
+       taskr."createdAt",
+       taskr.status,
+       taskr.payload,
+       taskr."payloadType",
+       taskr."seedMetadata",
+       taskr."seedMetadataType",
+       taskr."runtimeEnvironmentId"
+   FROM
+       taskruns AS taskr
+   WHERE
+       taskr."payloadType" = 'application/json' OR taskr."payloadType" = 'application/super+json'
+   ORDER BY
+       taskr."createdAt" DESC;`,
+   task.friendlyId,
+   environment.id
+ );

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +76 to +81
return redirectWithErrorMessage(
v3TestPath({ slug: organizationSlug }, { slug: projectParam }, environment),
request,
`Couldn't load test page for ${taskParam}`
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Consider adding error logging in the loader's catch block.

In the loader function, any errors thrown are caught, and a redirection is performed, but the error details are not logged. For better debugging and monitoring, consider logging the error.

Apply this change to log the error:

} catch (error) {
+  logger.error("Failed to load test page", { error });
   return redirectWithErrorMessage(
     v3TestPath({ slug: organizationSlug }, { slug: projectParam }, environment),
     request,
     `Couldn't load test page for ${taskParam}`
   );
 }

Committable suggestion skipped: line range outside the PR's diff.

Comment on lines +136 to +138
if (!result.foundTask) {
return <div></div>;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Provide user feedback when no task is found.

Rendering an empty <div> when result.foundTask is false might lead to a confusing user experience. Consider displaying a message or redirecting the user to provide clear feedback.

Example modification:

if (!result.foundTask) {
-  return <div></div>;
+  return (
+    <Callout variant="warning">
+      Task not found. Please check the task identifier or select a different task.
+    </Callout>
+  );
 }

Committable suggestion skipped: line range outside the PR's diff.

Copy link
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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 9dfa995 and 63be29f.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • apps/webapp/app/components/ErrorDisplay.tsx (2 hunks)
  • apps/webapp/package.json (2 hunks)
🔇 Additional comments (2)
apps/webapp/app/components/ErrorDisplay.tsx (1)

8-8: LGTM!

Clean import statement for the Spline component.

apps/webapp/package.json (1)

92-92: Verify package security and consider bundle size impact

The addition of @splinetool/react-spline for 3D content in ErrorDisplay.tsx should be reviewed for:

  1. Security implications
  2. Bundle size impact, as 3D libraries can be large

Consider implementing code splitting for the ErrorDisplay component to load the Spline dependency only when needed:

const SplineComponent = React.lazy(() => import('@splinetool/react-spline'));

className="pointer-events-none absolute inset-0 h-full w-full object-cover"
style={{ border: "none" }}
/>
<Spline scene="https://prod.spline.design/wRly8TZN-e0Twb8W/scene.splinecode" />
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Based on the gathered information, I can now provide the final response:

Spline scene implementation needs error handling and loading states

The current implementation in ErrorDisplay.tsx lacks proper error handling and loading states for the Spline scene. While the component is wrapped in a motion.div for animation, it should:

  • Use the existing error boundary pattern (found in multiple route files) to handle Spline loading failures
  • Add a loading state since the scene is rendered immediately without any indication of loading progress
  • Consider that this is used in an error display component, so the fallback should be minimal and not impact the error message visibility

Example locations requiring attention:

  • apps/webapp/app/components/ErrorDisplay.tsx: Add error boundary and loading state for Spline scene
  • Consider moving the scene file to a local asset to prevent external dependencies in an error display component
🔗 Analysis chain

Consider security and reliability improvements for the Spline scene.

The direct loading of a remote Spline scene raises several concerns:

  1. Security: Loading remote content could pose security risks. Consider hosting the scene file locally or implementing Content Security Policy (CSP) headers.
  2. Error Handling: Add error boundaries or fallback content in case the scene fails to load.
  3. Performance: Consider implementing lazy loading or a loading state for better user experience.
  4. Accessibility: Ensure screen readers can provide appropriate context for this decorative content.

Let's verify the usage of Spline across the codebase:


Let me gather more information about error handling and loading states in the codebase.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for other Spline implementations and error handling patterns

# Check for other Spline usages
echo "Checking for other Spline implementations..."
rg -l "@splinetool/react-spline"

# Check for error boundary implementations that might be reusable
echo "Checking for existing error boundary patterns..."
ast-grep --pattern 'class $_ extends React.Component {
  $$$
  componentDidCatch($$$) {
    $$$
  }
  $$$
}'

Length of output: 433


Script:

#!/bin/bash
# Check for error boundary implementations and loading states

# Look for error boundary components
echo "Checking for error boundary components..."
rg -l "ErrorBoundary"

# Check the ErrorDisplay component implementation
echo "Checking ErrorDisplay.tsx content..."
cat "apps/webapp/app/components/ErrorDisplay.tsx"

# Look for loading state patterns
echo "Checking for loading state implementations..."
rg -l "Suspense|React.lazy|loading"

# Check for CSP configurations
echo "Checking for CSP configurations..."
rg -l "Content-Security-Policy"

Length of output: 6489

@matt-aitken matt-aitken merged commit 1b3a2f2 into main Nov 18, 2024
9 checks passed
@matt-aitken matt-aitken deleted the full-width-tables branch November 18, 2024 17:11
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