chore: storybook support for app components#18749
Conversation
📝 WalkthroughWalkthroughThis pull request extracts shared global styles and CSS utilities into the form-component library, establishes Storybook infrastructure for component documentation with a React Vite setup, and integrates the form-component library into the frontend application via a workspace dependency. ChangesStorybook & Shared Styles Integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…github.com/Altinn/altinn-studio into chore/storybook-support-for-app-components
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #18749 +/- ##
==========================================
+ Coverage 95.71% 95.84% +0.12%
==========================================
Files 2587 3016 +429
Lines 33007 39548 +6541
Branches 4080 4842 +762
==========================================
+ Hits 31593 37904 +6311
- Misses 1069 1230 +161
- Partials 345 414 +69 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
phlipsterit
left a comment
There was a problem hiding this comment.
Great work :) I think it will be very nice to have storybook for this project.
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@libs/form-component/src/styles/global.css`:
- Line 1: Replace the problematic CSS patterns to satisfy Stylelint: change the
`@import` url('https://altinncdn.no/fonts/altinn-din/altinn-din.css'); rule to the
import-notation form `@import`
"https://altinncdn.no/fonts/altinn-din/altinn-din.css"; ensure there are no
unexpected blank lines before declarations (fix declaration-empty-line-before by
removing or adding required spacing around the affected declarations), and
normalize any inline comments to have proper spacing inside comment markers
(e.g., convert /*bad-comment*/ to /* good comment */) for the occurrences
flagged (including the other occurrences around the same file).
- Line 175: The .sr-only rule uses the deprecated clip property; update it to
use modern clipping by replacing clip: rect(0, 0, 0, 0) with a clip-path
fallback strategy: keep the existing clip line for legacy support, add
clip-path: inset(50%) (and -webkit-clip-path: inset(50%) for older WebKit) so
screen-reader-only behavior remains, and ensure the .sr-only selector (in
styles/global.css) still includes the other accessibility rules (position,
width/height, overflow, white-space) unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 35f1b1b4-8d7e-4b5b-8f7a-116fdaf4cc2e
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (10)
libs/form-component/.storybook/main.tslibs/form-component/.storybook/preview.tsxlibs/form-component/package.jsonlibs/form-component/src/app-components/Card/Card.stories.tsxlibs/form-component/src/styles/global.csslibs/form-component/tsconfig.jsonlibs/form-engine/package.jsonsrc/App/frontend/monorepo-changed-paths.txtsrc/App/frontend/package.jsonsrc/App/frontend/src/index.css
Storybook now implemented in app-components.
#18742
Description
App/frontend/src/index.cssto app-components for easy reuseVerification
Summary by CodeRabbit
New Features
Chores