Skip to content

Claudio/fix hydration#264

Merged
claudfuen merged 4 commits into
mainfrom
claudio/fix-hydration
Apr 3, 2025
Merged

Claudio/fix hydration#264
claudfuen merged 4 commits into
mainfrom
claudio/fix-hydration

Conversation

@claudfuen

@claudfuen claudfuen commented Apr 3, 2025

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Introduced interactive tables for viewing artifacts and requirements with built-in search, sorting, and pagination.
  • UI Enhancements

    • Updated breadcrumb navigation to clearly highlight the current page.
    • Refined table displays with persistent pagination and detailed visual cues for mapped data.
  • Localization

    • Added new prompts and messages for artifact and requirement searches, improving overall guidance in the interface.

@vercel

vercel Bot commented Apr 3, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
app ❌ Failed (Inspect) Apr 3, 2025 9:37pm
comp-portal ❌ Failed (Inspect) Apr 3, 2025 9:37pm

@CLAassistant

CLAassistant commented Apr 3, 2025

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@claudfuen claudfuen merged commit 907e4d2 into main Apr 3, 2025
@coderabbitai

coderabbitai Bot commented Apr 3, 2025

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request introduces two new React table components—ArtifactsTable and RequirementsTable—to display sorted, searchable, and paginated lists of artifacts and requirements respectively. The SingleControl component is refactored to leverage these new tables and now accepts an additional prop for related artifacts. A new helper, getRelatedArtifacts, is implemented for data fetching with caching and error handling. Breadcrumbs across several pages are updated to mark the current page. Additionally, several DataTable components and the associated hook now support URL query state management via an optional table ID, and locale files are enhanced with artifacts and framework messages.

Changes

File(s) Summary
.../controls/[controlId]/components/ArtifactsTable.tsx Introduces the ArtifactsTable component for displaying artifact data with search, sorting, and pagination.
.../controls/[controlId]/components/RequirementsTable.tsx Introduces the RequirementsTable component for displaying requirements with filtering, custom sorting, and row click navigation.
.../controls/[controlId]/components/SingleControl.tsx Refactors SingleControl to remove inline requirements rendering and integrate ArtifactsTable and RequirementsTable; updates props to include relatedArtifacts and changes requirementsMapped type.
.../controls/[controlId]/data/getRelatedArtifacts.ts Adds a new helper function and RelatedArtifact interface for fetching related artifacts with caching and error handling.
.../controls/[controlId]/page.tsx Updates page component from SingleControlPage to ControlPage; adds async call to getRelatedArtifacts and modifies breadcrumbs using orgId.
.../controls/components/controls-table-columns.tsx Updates column definitions: changes requirementsMapped to include frameworkInstance and refines cell renderers (status and mapped requirements).
.../controls/data/queries.ts Modifies the query to include a detailed requirementsMapped object that fetches frameworkInstance data.
.../controls/page.tsx, multiple frameworks pages Updates breadcrumb items to include current: true for clearer navigation indication.
.../data-table/data-table-column-header.tsx
.../data-table/data-table-pagination.tsx
.../data-table/data-table-sort-list.tsx
.../data-table/data-table.tsx
Adds an optional tableId property and integrates URL query state management for pagination and sorting; enhances error handling in sorting state retrieval.
.../pages/PageWithBreadcrumb.tsx Modifies breadcrumb trigger rendering to conditionally apply a styled wrapper when current is true.
.../hooks/use-data-table.ts Introduces an optional tableId prop to generate dynamic query keys for pagination and sorting state management.
.../locales/features/controls.ts
.../locales/features/frameworks.ts
Extends locale definitions by adding an artifacts section and updating search/placeholders for frameworks and controls.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant CP as ControlPage
    participant GA as getRelatedArtifacts
    participant SC as SingleControl
    participant RT as RequirementsTable
    participant AT as ArtifactsTable

    U->>CP: Request control page
    CP->>GA: Fetch related artifacts
    GA-->>CP: Return artifact data
    CP->>SC: Render control with requirements & artifacts
    SC->>RT: Render Requirements Table
    SC->>AT: Render Artifacts Table
Loading
sequenceDiagram
    participant U as User
    participant DTP as DataTablePagination
    participant QS as useQueryState
    participant DT as DataTable

    U->>DTP: Click next page
    DTP->>QS: Update URL parameter (page via tableId)
    QS-->>DTP: Return updated page state
    DTP->>DT: Re-render table with new pagination state
Loading

Possibly related PRs

  • Lewis/shared tables #252: Introduces changes in the ControlsTable component that deal with presenting structured, tabular data—similar in nature to the new components and URL state handling introduced in this PR.

Poem

Oh, I’m a rabbit with code so bright,
Hopping through tables deep into the night.
Artifacts and requirements in lines so neat,
Sorting and searching for a rhythm sweet.
With each little hop, my joy is complete!
🐰✨


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f5af021 and 027d2b3.

📒 Files selected for processing (19)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/controls/[controlId]/components/ArtifactsTable.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/controls/[controlId]/components/RequirementsTable.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/controls/[controlId]/components/SingleControl.tsx (2 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/controls/[controlId]/data/getRelatedArtifacts.ts (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/controls/[controlId]/page.tsx (2 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/controls/components/controls-table-columns.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/controls/data/queries.ts (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/controls/page.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/frameworks/[frameworkInstanceId]/page.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/frameworks/[frameworkInstanceId]/requirements/[requirementKey]/page.tsx (1 hunks)
  • apps/app/src/app/[locale]/(app)/(dashboard)/[orgId]/frameworks/page.tsx (1 hunks)
  • apps/app/src/components/data-table/data-table-column-header.tsx (2 hunks)
  • apps/app/src/components/data-table/data-table-pagination.tsx (1 hunks)
  • apps/app/src/components/data-table/data-table-sort-list.tsx (7 hunks)
  • apps/app/src/components/data-table/data-table.tsx (3 hunks)
  • apps/app/src/components/pages/PageWithBreadcrumb.tsx (1 hunks)
  • apps/app/src/hooks/use-data-table.ts (5 hunks)
  • apps/app/src/locales/features/controls.ts (1 hunks)
  • apps/app/src/locales/features/frameworks.ts (1 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings

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

❤️ Share
🪧 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

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