Skip to content

feat(ui): implement snippet dependency and library metadata editor and details panel (#211) - #231

Closed
jeffrey-graham wants to merge 1 commit into
SudiptaPaul-31:mainfrom
jeffrey-graham:feat/snippet-dependency-metadata-ui-211
Closed

jeffrey-graham wants to merge 1 commit into
SudiptaPaul-31:mainfrom
jeffrey-graham:feat/snippet-dependency-metadata-ui-211

Conversation

@jeffrey-graham

Copy link
Copy Markdown

Summary

Implements the snippet dependency and library metadata UI components (SnippetDependencyEditor and SnippetDependencyPanel) for managing and displaying package names, version numbers, ecosystems, and compatibility notes.

Key Changes

  • Snippet Dependency Editor (SnippetDependencyEditor):
    • Allows snippet owners to add, edit, and remove multiple dependencies (library/package name, version number, ecosystem selector npm/pip/Maven/NuGet/Cargo/Other, optional description, and compatibility notes).
    • Enforces client-side validation rejecting empty entries, invalid package identifiers, duplicate packages, or malformed version strings with accessible role="alert" and aria-invalid attributes.
    • Enforces ownership authorization (canEdit) and persists changes so updates immediately reflect in the details panel and across refreshes.
  • Snippet Dependency Details Panel (SnippetDependencyPanel):
    • Displays dependency cards, formatted version badges (v18.3.1), ecosystem badges, and summary metadata (Package Ecosystem, Total Dependencies, Last Updated, Author, Compatibility).
    • Sanitizes rendered user-generated metadata as inert text to prevent HTML/script injection.
    • Implements loading, empty, and error states (with retry support).
  • Automated Tests (components/snippets/__tests__/SnippetDependencyMetadata.test.tsx):
    • Covers creating, editing, and removing dependencies, input validation errors, unauthorized edit blocking, details panel rendering, XSS sanitization, persistence across remounts, and empty/loading/error states.

Closes #211

@vercel

vercel Bot commented Nov 10, 2026

Copy link
Copy Markdown

@jeffrey-graham is attempting to deploy a commit to the Sudipta 's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Implement Snippet Dependency & Library Metadata UI

1 participant