Skip to content

feat: implement structured DML-Usecase mapping artifact display #2752

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

Merged
merged 7 commits into from
Aug 4, 2025

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Issue

Why is this change needed?

This change implements the frontend display enhancement for structured DML-Usecase mapping artifacts as specified in issue #2741. The current markdown-based display needs to be replaced with React components that provide better UX through collapsible sections, proper styling, syntax highlighting for SQL, and clear validation result indicators.

Summary of Changes

This PR completely replaces the markdown-based artifact display with a structured React component approach:

New Components Created

  • StructuredArtifact - Main component that displays business requirements and categorized functional/non-functional requirements
  • UseCaseSection - Collapsible sections for individual use cases with DML operations
  • DmlOperationCard - Cards displaying SQL operations with syntax highlighting and execution logs
  • ValidationResultBadge - Success/failure indicators for DML execution results
  • SqlCodeBlock - SQL syntax highlighting using existing patterns

Removed Components

  • Artifact.tsx (markdown display component)
  • ExecutableDMLBlock/ (old DML display)
  • SeverityBadge/ (replaced with ValidationResultBadge)
  • formatArtifactToMarkdown.ts utility
  • rehype-raw dependency (no longer needed)

Key Features

  • ✅ Collapsible use case sections with expand/collapse icons
  • ✅ SQL syntax highlighting using existing Prism.js setup
  • ✅ Success/failure badges for DML execution logs
  • ✅ Responsive design with mobile support
  • ✅ Follows existing CSS variable conventions
  • ✅ TypeScript strict typing throughout
  • ✅ Reuses UI components from @liam-hq/ui

Architecture Diagram

%%{ init : { "theme" : "default" }}%%
graph TD
    A[ArtifactContainer] --> B[StructuredArtifact]
    B --> C[Business Requirement Section]
    B --> D[Functional Requirements]
    B --> E[Non-Functional Requirements]
    D --> F[UseCaseSection]
    F --> G[DmlOperationCard]
    G --> H[SqlCodeBlock]
    G --> I[ValidationResultBadge]
    G --> J[Execution Logs]
Loading

Human Review Checklist

⚠️ Critical Items to Test:

  1. Visual Verification - Load a design session with artifact data and verify the structured display renders correctly
  2. Collapsible Functionality - Test expand/collapse behavior on use case sections
  3. SQL Syntax Highlighting - Verify SQL code blocks display with proper syntax highlighting
  4. Validation Badges - Check success/failure badges show correct states and colors
  5. Responsive Design - Test on mobile devices to ensure proper layout
  6. Real-time Updates - Verify artifact updates still work with the new components
  7. CSS Variables - Confirm all CSS variables exist and render correctly
  8. Accessibility - Test keyboard navigation and screen reader compatibility

Risk Assessment

⚠️ High Risk Areas:

  • Untested UI Implementation - Could not fully test the visual display locally due to dev environment issues
  • Complete Architecture Change - Replaced entire markdown system with structured components
  • Complex Component Interactions - Multiple interconnected components with potential for runtime errors

Testing Notes

  • All linting checks pass (Biome, Knip, Syncpack)
  • TypeScript compilation successful
  • Pre-commit hooks pass
  • ⚠️ Visual testing required - Could not access running application for UI verification

Link to Devin run: https://app.devin.ai/sessions/6d9d6e49248b4cb5a8a5dbb06bd7b038
Requested by: [email protected]

- Create StructuredArtifact component to replace markdown display
- Add UseCaseSection with collapsible functionality for use cases
- Add DmlOperationCard to display individual DML operations with SQL syntax highlighting
- Add ValidationResultBadge to show execution success/failure status
- Add SqlCodeBlock component with proper syntax highlighting
- Update ArtifactContainer to use structured display instead of markdown conversion
- Remove unused components (Artifact.tsx, ExecutableDMLBlock, SeverityBadge, formatArtifactToMarkdown)
- Remove unused rehype-raw dependency
- Follow existing UI patterns and CSS variable conventions
- Implement responsive design with mobile support

Resolves #2741

Co-Authored-By: [email protected] <[email protected]>
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link

changeset-bot bot commented Jul 29, 2025

⚠️ No Changeset found

Latest commit: ce65a03

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

vercel bot commented Jul 29, 2025

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

Name Status Preview Comments Updated (UTC)
liam-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 1, 2025 10:53am
liam-erd-sample ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 1, 2025 10:53am
liam-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 1, 2025 10:53am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
liam-docs ⬜️ Ignored (Inspect) Visit Preview Aug 1, 2025 10:53am

Copy link

supabase bot commented Jul 29, 2025

Updates to Preview Branch (devin/1753776370-frontend-display-artifacts) ↗︎

Deployments Status Updated
Database Fri, 01 Aug 2025 10:49:59 UTC
Services Fri, 01 Aug 2025 10:49:59 UTC
APIs Fri, 01 Aug 2025 10:49:59 UTC

Tasks are run on every commit but only new migration files are pushed.
Close and reopen this PR if you want to apply changes from existing seed or migration files.

Tasks Status Updated
Configurations Fri, 01 Aug 2025 10:50:00 UTC
Migrations Fri, 01 Aug 2025 10:50:00 UTC
Seeding Fri, 01 Aug 2025 10:50:00 UTC
Edge Functions Fri, 01 Aug 2025 10:50:00 UTC

View logs for this Workflow Run ↗︎.
Learn more about Supabase for Git ↗︎.

Copy link
Contributor

coderabbitai bot commented Jul 31, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


🪧 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Join our Discord community for assistance with any issues or questions.

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 sequence diagram to generate a sequence diagram of the changes in this 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.

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.

- Restored Artifact.tsx to use simple markdown rendering with rehype-raw
- Created formatArtifactToMarkdown utility to convert Artifact data to markdown
- Removed unnecessary structured components (StructuredArtifact, ExecutableDMLBlock, etc.)
- Updated ArtifactContainer to use markdown formatting function
- Added rehype-raw dependency for HTML support in markdown
- Cleaned up component file structure and removed unused CSS modules

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@NoritakaIkeda
Copy link
Member

We have not been able to verify that it works through because the agent fails to generate the DML, but the logic on the front end side has been carefully examined and is Open.

@NoritakaIkeda NoritakaIkeda marked this pull request as ready for review August 1, 2025 12:53
@Copilot Copilot AI review requested due to automatic review settings August 1, 2025 12:53
@NoritakaIkeda NoritakaIkeda requested a review from a team as a code owner August 1, 2025 12:53
@NoritakaIkeda NoritakaIkeda requested review from hoshinotsuyoshi, FunamaYukina, junkisai, MH4GF and NoritakaIkeda and removed request for a team August 1, 2025 12:53
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a structured React component-based display for DML-Usecase mapping artifacts, replacing the previous markdown-based rendering system. The change provides enhanced UX through collapsible sections, SQL syntax highlighting, and clear validation indicators.

  • Replaces markdown display with structured React components for better interactivity
  • Adds collapsible use case sections and SQL syntax highlighting capabilities
  • Implements validation result badges for DML execution status indicators

Reviewed Changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
eslint-suppressions.json Removes suppressions for deleted components
formatArtifactToMarkdown.ts Enhances markdown formatting with improved structure and DML operation display
SeverityBadge/ Removes old severity badge component (replaced by ValidationResultBadge)
ExecutableDMLBlock/ Removes old DML block component (replaced by new structured components)
ArtifactContainer.tsx Simplifies artifact rendering by removing markdown conversion comment
Artifact.tsx Removes custom components for severity badges and DML blocks from markdown renderer
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

return sections.join('\n')
}

export function formatArtifactToMarkdown(artifact: Artifact): string {
Copy link
Preview

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

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

[nitpick] The function signature changed from arrow function to function declaration, which is inconsistent with the original implementation. Consider maintaining the same export pattern for consistency.

Suggested change
export function formatArtifactToMarkdown(artifact: Artifact): string {
export const formatArtifactToMarkdown = (artifact: Artifact): string => {

Copilot uses AI. Check for mistakes.

Comment on lines 27 to 28
const markdownContent = formatArtifactToMarkdown(artifact)

return <Artifact doc={markdownContent} />
Copy link
Preview

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

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

The code still calls formatArtifactToMarkdown and renders with the old Artifact component, but according to the PR description, this should be replaced with the new StructuredArtifact component. This suggests the implementation is incomplete.

Copilot uses AI. Check for mistakes.

Comment on lines 27 to 28
const markdownContent = formatArtifactToMarkdown(artifact)

return <Artifact doc={markdownContent} />
Copy link
Preview

Copilot AI Aug 1, 2025

Choose a reason for hiding this comment

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

The component still renders the old Artifact component instead of the new StructuredArtifact component mentioned in the PR description. This indicates the new components were not properly integrated.

Copilot uses AI. Check for mistakes.

Copy link
Member

@junkisai junkisai left a comment

Choose a reason for hiding this comment

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

The implementation seems to be good. 👍

@junkisai junkisai added this pull request to the merge queue Aug 4, 2025
code: sqlCode,
}
return <ExecutableDMLBlock dmlBlock={dmlBlock} />
}
Copy link
Member

Choose a reason for hiding this comment

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

I see 👀

Merged via the queue into main with commit a2c3251 Aug 4, 2025
29 of 31 checks passed
@junkisai junkisai deleted the devin/1753776370-frontend-display-artifacts branch August 4, 2025 02:22
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.

Frontend Display Enhancement - Display Structured Artifacts
3 participants