Skip to content

Conversation

@cte
Copy link
Collaborator

@cte cte commented Jan 30, 2025

Description

Now that we have Tailwind, let's add shadcn/ui as our component library and set up Storybook so we can start building out re-usable components for our webview. Using shadcn will allow us to utilize v0.dev.

Demo

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Checklist:

  • My code follows the patterns of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

Additional context

Related Issues

Reviewers


Important

Integrate shadcn/ui and set up Storybook for component development in the webview-ui project.

  • New Features:
    • Integrate shadcn/ui component library for reusable UI components.
    • Set up Storybook in webview-ui/.storybook for component development and testing.
  • Configuration Changes:
    • Add Storybook configuration files: main.ts, preview.ts, and vscode.css.
    • Update package.json scripts to include Storybook commands.
    • Modify vite.config.ts for Vite server settings and build output.
  • Code Changes:
    • Add button.tsx in src/components/ui for button component with variants.
    • Update ChatRow.tsx to use new UI components and styles.
    • Add utility function cn in src/lib/utils.ts for class name merging.
  • Miscellaneous:
    • Update .gitignore to exclude Storybook logs.
    • Remove unused files from public directory.
    • Update README.md with new development instructions.

This description was created by Ellipsis for eefb721. It will automatically update as commits are pushed.

@changeset-bot
Copy link

changeset-bot bot commented Jan 30, 2025

⚠️ No Changeset found

Latest commit: eefb721

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
Collaborator Author

Choose a reason for hiding this comment

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

This is the default button generated by the shadcn cli. We'll need to make it look more like the native VSCode UI (similar to https://github.com/estruyf/vscrui).


const config: StorybookConfig = {
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
addons: [
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure which of these are actually needed; this was auto-generated by Storybook.

@cte cte merged commit d78da19 into main Jan 31, 2025
4 checks passed
@cte cte deleted the cte/shadcn-ui-storybook branch January 31, 2025 06:23
@layer theme, base, components, utilities;

@import "tailwindcss/theme.css" layer(theme);
/* https://tailwindcss.com/docs/preflight */
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

CC @samhvw8 - When we added Tailwind some of the webview UI looked strange b/c Tailwind removes a lot of default styling via their preflight mechanism. I disabled it for now per https://tailwindcss.com/docs/preflight#disabling-preflight.

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.

4 participants