-
Notifications
You must be signed in to change notification settings - Fork 84
chore(.storybook): forenkle og standardiser live code editorer #3031
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://black-beach-0d62d0d03-3031.westeurope.2.azurestaticapps.net |
a3a894c to
42f0192
Compare
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://black-beach-0d62d0d03-3031.westeurope.2.azurestaticapps.net |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://black-beach-0d62d0d03-3031.westeurope.2.azurestaticapps.net |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR standardizes and simplifies live code editors across the FFE design system by introducing a shared utility and implementing live code editors for 12 packages. The solution replaces manual code transformation approaches with a Monaco Editor-based system that provides real-time preview, syntax highlighting, and template management.
- Creates a unified
LiveCodeEditorutility with consistent implementation patterns - Implements live code editors for 12 core packages including buttons, forms, grids, and more
- Introduces automation scripts for generating and auditing live code implementations
Reviewed Changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/generate-livecode.js | Automation script for generating standardized live code stories |
| .storybook/shared/LiveCodeEditor.tsx | Core shared utility component with Monaco editor integration |
| packages/*/src/LiveCodeEditor.stories.tsx | Live code editor implementations for 12 packages |
| .storybook/shared/LIVE_CODE_GUIDE.md | Documentation for implementing live code editors |
| package.json | Added dependencies for Monaco editor and React Live |
Comments suppressed due to low confidence (1)
packages/ffe-lists-react/src/LiveCodeEditor.stories.tsx:231
- BulletList component is referenced in the template code but may not be available in the live code scope, potentially causing runtime errors.
<h3 style={{ margin: '0 0 8px 0' }}>📖 Produktspesifikasjoner</h3>
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
5456364 to
25a0d94
Compare
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://black-beach-0d62d0d03-3031.westeurope.2.azurestaticapps.net |
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://black-beach-0d62d0d03-3031.westeurope.2.azurestaticapps.net |
- Fjern icon-egenskaper fra alle LiveCodeEditor-maler - Fjern emoji-ikoner fra template-kode i grid-react og andre pakker - Erstatt native confirm() med tilpasset bekreftelsesdialog for tilbakestill-knappen - Legg til Enter/Escape tastaturstøtte for bekreftelsesdialogene - Gjør Template.icon valgfri i shared LiveCodeEditor interface
35ce576 to
f89ce37
Compare
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://black-beach-0d62d0d03-3031.westeurope.2.azurestaticapps.net |
- Fjern alle emojier fra LiveCodeEditor.stories.tsx filer - Skjul template-dropdown når kun én template eksisterer - Flytt Tilbakestill-knapp til øvre høyre hjørne av kodeeditoren - Forbedre dialog-tekster og oversettelser til norsk - Standardiser import-rekkefølge og code formatting - Rette template-referanse feil i Accordion stories - Forenkle AccountSelector templates ved å fjerne komplekse eksempler Endringene gjør grensesnittet renere og mer profesjonelt ved å fjerne dekorative emojier, samtidig som UX forbedres med betinget visning av kontroller og bedre posisjonering av handlingsknapper.
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://black-beach-0d62d0d03-3031.westeurope.2.azurestaticapps.net |
.storybook/shared/LiveCodeEditor.tsx
Outdated
| return ( | ||
| <div style={{ fontFamily: 'system-ui, -apple-system, sans-serif' }}> | ||
| <h3 className="ffe-h3"> | ||
| {title} - {theme === 'light' ? 'Light' : 'Dark'} mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sånn som her 😊
| {/* Custom confirmation dialog */} | ||
| {showConfirmDialog && ( | ||
| <div | ||
| style={{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ikke viktig, men hvorfor ikke bruke ffe-modal her? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kan ta det i en ny PR =)
.storybook/shared/LiveCodeEditor.tsx
Outdated
| ` | ||
| **🔥 Live ${storageKey} Code Editor** | ||
| Skriv JSX-kode og se resultatet umiddelbart! Editoren støtter: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hvor dukker det her opp? Er det bare når man skal bruke den?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dette er hvis man ikke gir noen description når man lager en live code editor spesifikt for en komponent. Har kortet ned denne alternative beskrivelsen betraktelig nå.
| defaultTemplate: 'basic', | ||
| title: 'Accordion Live Code Editor', | ||
| description: | ||
| 'Live code editor for Accordion komponenten med alle templates og funksjonalitet.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"med alle templates og funksjonalitet." er litt intentsigende 😅
Kanskje det kan stå noe som at "Her kan du endre på et eksempel med bruk av Accordion" eller noe?
| docs: { | ||
| description: { | ||
| component: | ||
| 'Comprehensive live code editor for all account selector components in the FFE AccountSelector package. Explore AccountSelector and AccountSelectorMulti with interactive examples for single and multi-account selection scenarios.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dette burde være på norsk. Gjelder alle live kode editorene! Og burde kanskje ikke si at det er flere eksempler når det bare er ett nå 🤔
| defaultTemplate: 'simple', | ||
| title: 'AccountSelector Live Code Editor', | ||
| description: | ||
| 'Comprehensive live code editor for all account selector components in the FFE AccountSelector package. Explore AccountSelector and AccountSelectorMulti with interactive examples for single and multi-account selection scenarios.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Norsk? 🫶
.storybook/shared/LiveCodeEditor.tsx
Outdated
| defaultTemplate = Object.keys(templates)[0], | ||
| storageKey, | ||
| title = 'Live Code Editor', | ||
| description = 'Skriv JSX-kode og se resultatet umiddelbart!', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha, det blir så tydelig at det ikke er vi som har skrevet det 🙃
Hva med "Her kan du redigere komponenten og se resultatet før du tar den i bruk." eller noe?
|
Azure Static Web Apps: Your stage site is ready! Visit it here: https://black-beach-0d62d0d03-3031.westeurope.2.azurestaticapps.net |


























Nye live code editorer opprettet for 12 pakker:
Infrastruktur og verktøy:
Designprinsipper:
Resultat:
Introduserer en standardisert live code editor løsning som dekker 12 pakker og forbedrer utvikleropplevelsen betydelig på tvers av hele FFE design systemet.