* feat(message-scroller): add Brain and Helm chat transcript scroller Port shadcn message-scroller behavior (auto-follow, scroll anchors, prepend preserve, overflow signals) with CLI generator, registry CSS, docs previews, and Storybook stories. * fix(message-scroller): pin CLI brain peer to 1.3.1 Match the rest of supported-ui-libraries.json and libs/brain so generators do not install an older Brain that lacks the message-scroller entrypoint. * fix(message-scroller): rebuild visibility observer on margin changes IntersectionObserver rootMargin is fixed at construction. Recreate the observer when scrollMargin or scrollPreviousItemPeek change while visibility tracking is active so visible ids stay aligned with geometry. * fix(message-scroller): polish demos and harden configure/destroy * style(message-scroller): apply prettier formatting * fix(message-scroller): move stable layout to Helm and Brain attrs Keep theme CSS for sizing/visual knobs only; host data-direction and first-frame hide on Brain so Helm stays styling-only. * fix(message-scroller): move Helm styles out of theme CSS Keep scrollbar width stable during autoScroll, put Tailwind classes on Helm so the CLI does not drop non-@apply rules, and center the jump button with start-1/2. Co-authored-by: Cursor <cursoragent@cursor.com> * feat(message-scroller): move scroller content gap into styles * docs: add message scroller nav item * chore: update tailwind 4.3 for scrollbar-* utils * feat(message-scroller): add data-autoscrolling classes to viewport * feat(message-scroller): update scroller button classes --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Marc Stammerjohann <8985933+marcjulian@users.noreply.github.com>
7.5 KiB
Contributing
spartan is an MIT-licensed open source project with its ongoing development made by contributors.
Contributing to the UI library
Folder structure
Source code for the UI primitives exists under the libs/brain and libs/helm folders. To contribute features or bug fixes to the project,
locate the relevant code in one of these sub-folders.
Setup
spartan uses PNPM to manage its dependencies.
Before opening a pull request, run the following command from the root folder to make sure your development dependencies are up-to-date:
pnpm install
Running locally
When working on UI primitives you most likely want to work with our storybook. To start storybook you can simply run and go to http://localhost:4400:
pnpm run storybook
Build
spartan uses Nx for builds. To build all projects locally, run the following command from the root folder:
pnpm run build
Testing
spartan uses Vitest for tests. To test all projects locally, run the following command from the root folder:
pnpm run test
We also have e2e tests set up with Cypress that run against our storybook. Run them with:
pnpm run e2e
Contributing to the docs and spartan website
To serve the documentation and example application locally, run the following command from the root folder:
pnpm run dev
The code is inside apps/app and runs on AnalogJs.
Creating a new Brain feature
Brain features should be added as a secondary entrypoint to the brain library. This can be done by running the following
command:
nx g @spartan-ng/tools:brain-secondary-entrypoint --name=feature-name
Creating a new Helm feature
Helm features should be added as a secondary entrypoint to the helm library. This can be done by running the following
command:
nx g @spartan-ng/tools:helm-secondary-entrypoint --name=feature-name
Submitting pull requests
Please follow these basic steps to simplify pull request reviews. If you don't you'll probably just be asked to anyway.
- Please rebase your branch against the current master.
- Run the
Setupcommand to make sure your development dependencies are up-to-date. - Please ensure the test suite passes before submitting a PR.
- If you've added new functionality, please include tests which validate its behavior.
- Make reference to possible issues on PR comment.
Submitting bug reports
- Search through issues to see if a previous issue has already been reported and/or fixed.
- Provide a small reproduction using a StackBlitz project or a GitHub repository.
- Please detail the affected browser(s) and operating system(s).
- Please be sure to state which version of Angular, node and npm you're using.
Submitting new features
- We value keeping the API surface small and concise, which factors into whether new features are accepted.
- Submit an issue with the prefix
RFC:with your feature request. - The feature will be discussed and considered.
- Once the PR is submitted, it will be reviewed and merged once approved.
Questions and requests for support
Questions and requests for support should not be opened as issues and should be handled in the following ways:
- Start a new Q&A Discussion on GitHub.
Commit message guidelines
We have very precise rules over how our git commit messages can be formatted. This leads to more readable messages that are easy to follow when looking through the project history. But also, we use the git commit messages to generate the changelog.
Commit message format
Each commit message consists of a header, a body and a footer. The header has a special format that includes a type, a scope and a subject:
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
The header is mandatory and the scope of the header is optional.
Any line of the commit message cannot be longer than 100 characters! This allows the message to be easier to read on GitHub as well as in various git tools.
The footer should contain a closing reference to an issue if any.
Samples: (even more samples)
docs(changelog): update changelog to beta.5
fix(release): need to depend on latest rxjs and zone.js
The version in our package.json gets copied to the one we publish, and users need the latest of these.
Revert
If the commit reverts a previous commit, it should begin with revert:, followed by the header of the reverted commit.
In the body it should say: This reverts commit <hash>., where the hash is the SHA of the commit being reverted.
Type
Must be one of the following:
- build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
- ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
- docs: Documentation only changes
- feat: A new feature
- fix: A bug fix
- perf: A code change that improves performance
- refactor: A code change that neither fixes a bug nor adds a feature
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)
- test: Adding missing tests or correcting existing tests
Scope
The scope should be the name of the npm package affected (as perceived by the person reading the changelog generated from commit messages.
The following is the list of supported scopes:
Primitives
- accordion
- alert
- alert-dialog
- aspect-ratio
- attachment
- avatar
- badge
- breadcrumb
- bubble
- button
- button-group
- calendar
- card
- carousel
- checkbox
- collapsible
- combobox
- command
- context-menu
- data-table
- date-picker
- dialog
- dropdown-menu
- empty
- field
- hover-card
- icon
- input
- input-otp
- label
- marker
- menubar
- message
- message-scroller
- navigation-menu
- pagination
- popover
- progress
- radio-group
- scroll-area
- select
- separator
- sheet
- skeleton
- slider
- sonner
- spinner
- switch
- table
- tabs
- textarea
- toggle
- toggle-group
- tooltip
- typography
And others
- trpc
- nx
- repo
- cli
Subject
The subject contains a succinct description of the change:
- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize the first letter
- no dot (.) at the end
Body
Just as in the subject, use the imperative, present tense: "change" not "changed" nor "changes". The body should include the motivation for the change and contrast this with previous behavior.
Footer
The footer should contain any information about Breaking Changes and is also the place to reference GitHub issues that this commit Closes.
Breaking Changes should start with the word BREAKING CHANGE: with a space or two newlines. The rest of the commit
message is then used for this.
Example:
feat(scope): commit message
BREAKING CHANGES:
Describe breaking changes here
BEFORE:
Previous code example here
AFTER:
New code example here