Skip to content

Feature/shared UI components - #23

Merged
priyanshuvishwakarma273403 merged 9 commits into
mainfrom
feature/shared-ui-components
Aug 24, 2026
Merged

priyanshuvishwakarma273403 merged 9 commits into
mainfrom
feature/shared-ui-components

Conversation

@priyanshuvishwakarma273403

Copy link
Copy Markdown
Collaborator

Overview

This PR sets up and integrates a shared component package (@docsgraph/ui) to prevent UI code duplication between the web and desktop client targets. It migrates the DocumentListItem component into the shared package as a proof of concept and documents the UI contribution guidelines.

Key Changes

1. Created Shared DocumentListItem Component (packages/ui/src/DocumentListItem.tsx)

  • Extracted the inline document list item button markup into a reusable functional component in the shared workspace package.
  • Enforces type safety with TypeScript props (DocumentListItemProps) extending standard HTMLAttributes<HTMLButtonElement>.
  • Includes id mapping onto the HTML element.

2. Exported Component (packages/ui/src/index.ts)

  • Added DocumentListItem and DocumentListItemProps to public exports of the @docsgraph/ui package.

3. Integrated into Frontend (apps/web/src/App.tsx)

  • Imported and utilized <DocumentListItem> inside documents.map() rendering of the "Available Documents" list.

4. Documented Guidelines (CONTRIBUTING.md)

  • Added a UI Architecture Guidelines section explaining the roles of shared workspace packages vs. platform-specific shell code:
    • Shared UI Components: Platform-agnostic elements reside in packages/ui.
    • Platform-Specific UI: Environment integration and window management code lives in apps/.

Verification & CI Status

  • pnpm lint: Passed (0 warnings/errors)
  • pnpm typecheck: Passed (0 errors)
  • pnpm build: Passed
  • pnpm test: Passed (14/14 tests)

@MaximilianRau04 MaximilianRau04 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Clean, behavior-preserving extraction. Good direction for reducing App.tsx (961 lines now) — worth applying to more components.

@priyanshuvishwakarma273403
priyanshuvishwakarma273403 merged commit 0398fc4 into main Aug 24, 2026
1 check passed
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