feat: design-first magic_example (full-set app + DESIGN.md + /preview catalog + agent infra)#1
Open
anilcancakir wants to merge 6 commits into
Open
feat: design-first magic_example (full-set app + DESIGN.md + /preview catalog + agent infra)#1anilcancakir wants to merge 6 commits into
anilcancakir wants to merge 6 commits into
Conversation
… catalog + agent infra) Ready-to-start reference app for the fluttersdk ecosystem: - Full set installed: magic, magic_starter, dusk, telescope, magic_deeplink, magic_notifications, magic_social_auth, on fluttersdk_artisan; a Laravel api/v1 backend (magic-starter-laravel) under backend/. - DESIGN.md is the single source of truth; design:sync generates the wind theme (lib/config/wind_theme.g.dart), consumed in main.dart. - Dev-only /preview catalog (magic_devtools) listing foundations, the component library, and feature-screen previews driven by a backend-free mock harness; stripped from release builds. - Design-first agent infra: CLAUDE.md + AGENTS.md + .claude/rules + 3 skills + a component-visual-reviewer agent + docs/design-culture + component-registry. Verified locally end to end: flutter analyze 0, the app boots and renders (login/dashboard/profile + the catalog) in light and dark, the real backend api/v1/auth/login returns a Sanctum token, and release builds tree-shake the catalog.
There was a problem hiding this comment.
Pull request overview
Brings up a design-first magic_example reference application, including Flutter multi-platform runner scaffolding, a dev-only /preview component catalog with mock harness, DESIGN.md-driven Wind theme generation, and a Laravel backend/ skeleton intended to support api/v1 and Magic Starter features.
Changes:
- Adds platform runner scaffolding for Android/iOS/macOS/Linux/Windows/Web, plus basic smoke tests.
- Introduces Magic app bootstrapping/config (providers, routes, middleware) and a debug-only preview catalog with generated registry.
- Adds a Laravel backend skeleton with Magic Starter-oriented models, policies, and migrations, plus frontend build tooling (Vite/Tailwind).
Reviewed changes
Copilot reviewed 230 out of 277 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| windows/runner/win32_window.h | Adds Win32 window abstraction header |
| windows/runner/utils.h | Declares Windows runner utilities |
| windows/runner/utils.cpp | Implements console + argv UTF conversion |
| windows/runner/Runner.rc | Adds Windows resources/version/icon |
| windows/runner/runner.exe.manifest | Enables PerMonitorV2 DPI awareness |
| windows/runner/resource.h | Defines Windows resource IDs |
| windows/runner/main.cpp | Windows runner entrypoint wiring |
| windows/runner/flutter_window.h | Declares Flutter-hosting Win32 window |
| windows/runner/flutter_window.cpp | Implements Flutter window lifecycle |
| windows/runner/CMakeLists.txt | Windows runner build target setup |
| windows/flutter/generated_plugins.cmake | Generated Windows plugin wiring |
| windows/flutter/generated_plugin_registrant.h | Generated Windows plugin registrant header |
| windows/flutter/generated_plugin_registrant.cc | Generated Windows plugin registrant impl |
| windows/flutter/CMakeLists.txt | Flutter Windows build integration |
| windows/CMakeLists.txt | Windows top-level CMake wiring/install |
| windows/.gitignore | Ignores Windows ephemeral/build artifacts |
| web/manifest.json | Web app manifest for Flutter web |
| web/index.html | Web host page for Flutter web |
| test/widget_test.dart | Adds Flutter widget smoke test |
| macos/RunnerTests/RunnerTests.swift | Adds macOS test target stub |
| macos/Runner/Release.entitlements | macOS release entitlements |
| macos/Runner/MainFlutterWindow.swift | macOS window bootstrapping |
| macos/Runner/Info.plist | macOS app plist metadata |
| macos/Runner/DebugProfile.entitlements | macOS debug entitlements |
| macos/Runner/Configs/Warnings.xcconfig | macOS warning flags config |
| macos/Runner/Configs/Release.xcconfig | macOS release xcconfig includes |
| macos/Runner/Configs/Debug.xcconfig | macOS debug xcconfig includes |
| macos/Runner/Configs/AppInfo.xcconfig | macOS app name/bundle id config |
| macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json | macOS app icon asset catalog |
| macos/Runner/AppDelegate.swift | macOS app delegate behaviors |
| macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved | macOS SPM lockfile |
| macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist | macOS workspace checks |
| macos/Runner.xcworkspace/contents.xcworkspacedata | macOS workspace definition |
| macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme | macOS scheme configuration |
| macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved | macOS project workspace SPM lockfile |
| macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist | macOS project workspace checks |
| macos/Flutter/GeneratedPluginRegistrant.swift | Generated macOS plugin registrant |
| macos/Flutter/Flutter-Release.xcconfig | macOS Flutter release include |
| macos/Flutter/Flutter-Debug.xcconfig | macOS Flutter debug include |
| macos/.gitignore | Ignores macOS ephemeral/Pods/user data |
| linux/runner/my_application.h | Linux GTK runner application header |
| linux/runner/main.cc | Linux runner main entrypoint |
| linux/runner/CMakeLists.txt | Linux runner build wiring |
| linux/flutter/generated_plugins.cmake | Generated Linux plugin wiring |
| linux/flutter/generated_plugin_registrant.h | Generated Linux plugin registrant header |
| linux/flutter/generated_plugin_registrant.cc | Generated Linux plugin registrant impl |
| linux/flutter/CMakeLists.txt | Flutter Linux build integration |
| linux/.gitignore | Ignores Linux ephemeral artifacts |
| lib/routes/app.dart | Registers app routes (dashboard) |
| lib/preview/teams_screen.preview.dart | Adds teams screen preview wrapper |
| lib/preview/settings_screen.preview.dart | Adds settings screen preview wrapper |
| lib/preview/screen_preview_scaffold.dart | Adds shared preview scaffold/harness mounting |
| lib/preview/register_screen.preview.dart | Adds register screen preview wrapper |
| lib/preview/profile_screen.preview.dart | Adds profile screen preview wrapper |
| lib/preview/login_screen.preview.dart | Adds login screen preview wrapper |
| lib/preview/dashboard_screen.preview.dart | Adds dashboard screen preview wrapper |
| lib/preview/_previews.g.dart | Generated preview registry list |
| lib/main.dart | Boots Magic app + devtool integrations + theme |
| lib/config/wind_theme.g.dart | Generated Wind theme + aliases from DESIGN.md |
| lib/config/view.dart | UI config for dialogs/confirms |
| lib/config/routing.dart | Routing/url strategy config |
| lib/config/network.dart | HTTP/network driver config |
| lib/config/magic_starter.dart | Magic Starter feature/routes toggles |
| lib/config/logging.dart | Logging channel configuration |
| lib/config/deeplink.dart | Deeplink configuration |
| lib/config/database.dart | Database connection configuration |
| lib/config/cache.dart | Cache driver/ttl configuration |
| lib/config/broadcasting.dart | Broadcasting connections configuration |
| lib/config/auth.dart | Auth guard/token/endpoint config |
| lib/config/app.dart | App providers + plugin service providers |
| lib/app/providers/route_service_provider.dart | Boots kernel/routes + debug preview routes |
| lib/app/providers/app_service_provider.dart | Boots Magic Starter user/nav/logout/team hooks |
| lib/app/middleware/redirect_if_authenticated.dart | Guest-only redirect middleware |
| lib/app/middleware/ensure_authenticated.dart | Auth-only redirect middleware |
| lib/app/kernel.dart | Registers middleware aliases |
| lib/app/commands/_index.g.dart | Generated artisan consumer command barrel |
| lib/app/_plugins.g.dart | Generated artisan plugin provider registry |
| ios/RunnerTests/RunnerTests.swift | Adds iOS test target stub |
| ios/Runner/SceneDelegate.swift | iOS scene delegate scaffold |
| ios/Runner/Runner-Bridging-Header.h | iOS bridging header |
| ios/Runner/Info.plist | iOS app plist metadata |
| ios/Runner/Base.lproj/Main.storyboard | iOS main storyboard |
| ios/Runner/Base.lproj/LaunchScreen.storyboard | iOS launch screen storyboard |
| ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md | iOS launch assets readme |
| ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json | iOS launch image assets manifest |
| ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json | iOS app icon asset catalog |
| ios/Runner/AppDelegate.swift | iOS app delegate + implicit engine plugins |
| ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings | iOS workspace settings |
| ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist | iOS workspace checks |
| ios/Runner.xcworkspace/contents.xcworkspacedata | iOS workspace definition |
| ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme | iOS scheme configuration |
| ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings | iOS project workspace settings |
| ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist | iOS project workspace checks |
| ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata | iOS project workspace definition |
| ios/Flutter/Release.xcconfig | iOS Flutter release include |
| ios/Flutter/Debug.xcconfig | iOS Flutter debug include |
| ios/Flutter/AppFrameworkInfo.plist | iOS Flutter framework plist |
| ios/.gitignore | Ignores iOS derived/Pods/ephemeral assets |
| CLAUDE.md | Repo agent/dev workflow + design-first rules |
| bin/fsa | Fast CLI wrapper/build cache for dispatcher |
| bin/dispatcher.dart | Artisan dispatcher wiring for plugins/commands |
| backend/vite.config.js | Vite config with Laravel + Tailwind |
| backend/tests/Unit/ExampleTest.php | Laravel unit test stub |
| backend/tests/TestCase.php | Laravel base test case |
| backend/tests/Feature/ExampleTest.php | Laravel feature test stub |
| backend/storage/logs/.gitignore | Storage ignore rules |
| backend/storage/framework/views/.gitignore | Storage ignore rules |
| backend/storage/framework/testing/.gitignore | Storage ignore rules |
| backend/storage/framework/sessions/.gitignore | Storage ignore rules |
| backend/storage/framework/cache/data/.gitignore | Storage ignore rules |
| backend/storage/framework/cache/.gitignore | Storage ignore rules |
| backend/storage/framework/.gitignore | Storage ignore rules |
| backend/storage/app/public/.gitignore | Storage ignore rules |
| backend/storage/app/private/.gitignore | Storage ignore rules |
| backend/storage/app/.gitignore | Storage ignore rules |
| backend/routes/web.php | Laravel web route (welcome) |
| backend/routes/console.php | Laravel console route stub |
| backend/resources/js/app.js | Laravel frontend JS entry stub |
| backend/resources/css/app.css | Tailwind CSS entry + theme font |
| backend/README.md | Laravel skeleton README |
| backend/public/robots.txt | Robots policy |
| backend/public/index.php | Laravel front controller |
| backend/public/favicon.ico | Backend favicon asset |
| backend/public/.htaccess | Apache rewrite rules |
| backend/phpunit.xml | PHPUnit config for backend |
| backend/package.json | Backend JS deps/scripts |
| backend/lang/vendor/magic-starter/tr/teams.php | TR translation strings for teams |
| backend/lang/vendor/magic-starter/en/teams.php | EN translation strings for teams |
| backend/database/seeders/DatabaseSeeder.php | Seeds a test user |
| backend/database/migrations/2026_06_24_200110_drop_language_column_from_users_table.php | Drops users.language if present |
| backend/database/migrations/2026_06_24_200100_add_two_factor_columns_to_users_table.php | Adds 2FA columns to user model table |
| backend/database/migrations/2026_06_24_200090_add_timezone_to_users_table.php | Adds users.timezone if missing |
| backend/database/migrations/2026_06_24_200080_add_profile_photo_path_to_users_table.php | Adds users.profile_photo_path |
| backend/database/migrations/2026_06_24_200070_add_profile_photo_path_to_teams_table.php | Adds teams.profile_photo_path |
| backend/database/migrations/2026_06_24_200060_add_profile_fields_to_users_table.php | Adds users.phone |
| backend/database/migrations/2026_06_24_200050_add_localization_fields_to_users_table.php | Adds users.locale/timezone |
| backend/database/migrations/2026_06_24_200040_add_guest_and_phone_fields_to_users_table.php | Adds guest/phone fields + alters columns |
| backend/database/migrations/2026_06_24_200030_add_expires_at_to_team_invitations_table.php | Adds team_invitations.expires_at |
| backend/database/migrations/2026_06_24_200020_add_device_info_to_personal_access_tokens_table.php | Adds token ip/user_agent columns |
| backend/database/migrations/2026_06_24_200010_add_current_team_id_to_users_table.php | Adds users.current_team_id FK |
| backend/database/migrations/2026_06_24_100070_create_newsletter_subscribers_table.php | Creates newsletter_subscribers table |
| backend/database/migrations/2026_06_24_100060_create_notification_settings_table.php | Creates notification_settings table |
| backend/database/migrations/2026_06_24_100050_create_notifications_table.php | Creates notifications table |
| backend/database/migrations/2026_06_24_100040_create_personal_access_tokens_table.php | Creates personal_access_tokens table |
| backend/database/migrations/2026_06_24_100030_create_team_invitations_table.php | Creates team_invitations table |
| backend/database/migrations/2026_06_24_100020_create_team_user_table.php | Creates team_user pivot table |
| backend/database/migrations/2026_06_24_100010_create_teams_table.php | Creates teams table |
| backend/database/migrations/0001_01_01_000002_create_jobs_table.php | Creates jobs/batches/failed_jobs |
| backend/database/migrations/0001_01_01_000001_create_cache_table.php | Creates cache/cache_locks tables |
| backend/database/migrations/0001_01_01_000000_create_users_table.php | Creates users/sessions/password_reset tables |
| backend/database/factories/UserFactory.php | User factory definition |
| backend/database/.gitignore | Ignores sqlite db files |
| backend/config/services.php | Third-party service placeholders |
| backend/config/queue.php | Queue connection configuration |
| backend/config/mail.php | Mailers configuration |
| backend/config/logging.php | Backend logging channels config |
| backend/config/filesystems.php | Storage disks and links |
| backend/config/cache.php | Cache stores configuration |
| backend/config/auth.php | Auth providers/guards configuration |
| backend/config/app.php | Backend app core config |
| backend/composer.json | Backend PHP deps (Laravel + magic starter) |
| backend/bootstrap/providers.php | Bootstrap provider list |
| backend/bootstrap/cache/.gitignore | Bootstrap cache ignore rules |
| backend/bootstrap/app.php | Laravel app bootstrap configuration |
| backend/artisan | Laravel artisan entrypoint |
| backend/app/Providers/AppServiceProvider.php | Backend service provider scaffold |
| backend/app/Policies/TeamPolicy.php | Team authorization policy stub |
| backend/app/Models/User.php | User model with Magic Starter traits |
| backend/app/Models/TeamUser.php | TeamUser model passthrough |
| backend/app/Models/TeamInvitation.php | TeamInvitation model passthrough |
| backend/app/Models/Team.php | Team model passthrough + fillable |
| backend/app/Http/Controllers/Controller.php | Backend controller base class |
| backend/app/Actions/MagicStarter/UpdateUserProfile.php | Stub action for profile updates |
| backend/app/Actions/MagicStarter/UpdateUserPassword.php | Stub action for password updates |
| backend/app/Actions/MagicStarter/UpdateTeamMemberRole.php | Stub action for team role updates |
| backend/app/Actions/MagicStarter/UpdateTeam.php | Stub action for team updates |
| backend/app/Actions/MagicStarter/RemoveTeamMember.php | Stub action for removing members |
| backend/app/Actions/MagicStarter/InviteTeamMember.php | Stub action for invitations |
| backend/app/Actions/MagicStarter/DeleteUser.php | Stub action for deleting users |
| backend/app/Actions/MagicStarter/DeleteTeam.php | Stub action for deleting teams |
| backend/app/Actions/MagicStarter/CreateUser.php | Stub action for creating users |
| backend/app/Actions/MagicStarter/CreateTeam.php | Stub action for creating teams |
| backend/app/Actions/MagicStarter/AddTeamMember.php | Stub action for adding members |
| backend/.npmrc | Backend npm safety defaults |
| backend/.gitignore | Backend ignore rules |
| backend/.gitattributes | Backend attributes (diff drivers/export-ignore) |
| backend/.env.example | Backend environment example |
| backend/.editorconfig | Backend editor config |
| android/settings.gradle.kts | Android Gradle settings/plugin management |
| android/gradle/wrapper/gradle-wrapper.properties | Gradle wrapper version pin |
| android/gradle.properties | Android/Gradle flags |
| android/build.gradle.kts | Android root build logic |
| android/app/src/profile/AndroidManifest.xml | Profile manifest permissions |
| android/app/src/main/res/values/styles.xml | Android light launch theme |
| android/app/src/main/res/values-night/styles.xml | Android dark launch theme |
| android/app/src/main/res/drawable/launch_background.xml | Android splash background |
| android/app/src/main/res/drawable-v21/launch_background.xml | Android v21 splash background |
| android/app/src/main/kotlin/com/fluttersdk/magic_example/MainActivity.kt | Android MainActivity |
| android/app/src/main/AndroidManifest.xml | Android app manifest |
| android/app/src/debug/AndroidManifest.xml | Debug manifest permissions |
| android/app/build.gradle.kts | Android app module build config |
| android/.gitignore | Android ignore rules |
| analysis_options.yaml | Dart analyzer/lints configuration |
| AGENTS.md | Agent workflow + design-first rules |
| .metadata | Flutter project metadata |
| .env.example | App env example (API_URL etc.) |
Files not reviewed (3)
- ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: Generated file
- ios/Runner.xcworkspace/contents.xcworkspacedata: Generated file
- macos/Runner.xcworkspace/contents.xcworkspacedata: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+13
to
+18
| if (freopen_s(&unused, "CONOUT$", "w", stdout)) { | ||
| _dup2(_fileno(stdout), 1); | ||
| } | ||
| if (freopen_s(&unused, "CONOUT$", "w", stderr)) { | ||
| _dup2(_fileno(stdout), 2); | ||
| } |
Comment on lines
+64
to
+68
| switch (message) { | ||
| case WM_FONTCHANGE: | ||
| flutter_controller_->engine()->ReloadSystemFonts(); | ||
| break; | ||
| } |
Comment on lines
+53
to
+54
| // Theme generated from DESIGN.md via `design:sync`. Regenerate with: | ||
| // dart run magic_example:artisan design:sync |
Comment on lines
+8
to
+10
| 'dialog': { | ||
| 'class': 'bg-white dark:bg-gray-800 rounded-xl p-6 shadow-2xl max-w-lg', | ||
| }, |
Comment on lines
+11
to
+19
| 'confirm': { | ||
| 'container_class': | ||
| 'bg-white dark:bg-gray-800 rounded-xl p-6 shadow-2xl w-80', | ||
| 'title_class': 'text-lg font-bold text-gray-900 dark:text-white', | ||
| 'message_class': 'text-gray-600 dark:text-gray-400 mt-2', | ||
| 'button_cancel_class': 'px-4 py-2 text-gray-600 dark:text-gray-300', | ||
| 'button_confirm_class': 'px-4 py-2 bg-primary text-white rounded-lg', | ||
| 'button_danger_class': 'px-4 py-2 bg-red-500 text-white rounded-lg', | ||
| }, |
Comment on lines
+1
to
+4
| // GENERATED: do not edit by hand. | ||
| // Regenerate via: dart run magic:artisan design:sync | ||
| // | ||
| // Source of truth: DESIGN.md |
Comment on lines
+15
to
+18
| Schema::table('users', function (Blueprint $table) { | ||
| $table->string('email')->nullable()->change(); | ||
| $table->string('password')->nullable()->change(); | ||
|
|
…flow ComponentsPreview is now stateful so the switch, tabs, and select are live (toggle/select to see real behavior). Variant rows use Wind's `wrap` utility instead of the no-op `flex-wrap` so they reflow rather than overflow. The feature-screen scaffold drops its phone-frame MediaQuery override so screens render at their real size in the single-pane catalog.
The app shell picks sidebar-vs-bottom-nav off the window width (wScreenIs reads MediaQuery.size), so the two layouts never show at the same time and the bottom nav was invisible at the catalog's desktop width. Add two dedicated previews that pin each layout by overriding the ambient MediaQuery width: SidebarMenu (desktop rail + user menu, full width) and BottomMenu (mobile header + bottom bar, in a phone frame). ScreenPreviewScaffold gains appDesktop/appMobile chrome modes; feature screens stay bare content. Also flex-1 the dashboard card title so it fits/wraps instead of overflowing (yellow stripe) in the narrow shell.
…ign parity) Match the idea-design catalog's one-component-per-preview model: split the lumped components.preview.dart into dedicated Badge/Button/Card/Input/ Select/Switch/Tabs preview files, each its own auto-discovered section. With the catalog now a single scrolling page, bare screen previews (chrome: none) no longer wrap their own SingleChildScrollView (a nested vertical scroll broke the outer scroll geometry and sidebar scroll-to-section); the catalog page provides the scroll.
SidebarMenu/BottomMenu previews showcase the navigation shell, so their
body is now an empty placeholder card instead of the full DashboardView.
The dashboard's 3-column cards crammed into the narrow content area beside
the sidebar and broke titles mid-word ("Docum entatio n"); a neutral
"Page content" card keeps the focus on the nav chrome.
…talog Register magic_starter's 30 component previews via its dev-only previews.dart barrel (User Profile Dropdown, Team Selector, Notification Dropdown, Accordion, Checkbox, Radio, Dialog, Toast, etc.), merged with the app-owned previews (foundations, screens, nav shells) and sorted by label. The 7 hand-written component preview duplicates are removed; the catalog now mirrors the whole library with no duplication. Registration stays kDebugMode-gated so the starter preview set tree-shakes from release.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings up the design-first
magic_examplereference app: the full fluttersdk set (magic, magic_starter, dusk, telescope, magic_deeplink, magic_notifications, magic_social_auth) on fluttersdk_artisan, a Laravelapi/v1backend underbackend/, aDESIGN.md-driven wind theme (design:sync->lib/config/wind_theme.g.dart), a dev-only/previewcomponent catalog (foundations + component library + feature-screen previews via a backend-free mock harness, tree-shaken from release), and the design-first agent infra (CLAUDE.md + AGENTS.md + .claude/rules + skills + component-visual-reviewer + docs/design-culture + component-registry).Verified locally end to end:
flutter analyze0; the app boots and renders login/dashboard/profile + the catalog in light and dark (real-browser e2e); the real backendapi/v1/auth/loginreturns a Sanctum token; release builds strip the catalog.Cross-repo: consumes the sibling
feat/design-first-component-systemPRs (wind #120, magic #102, magic_devtools #7, magic_starter #78) via local path overrides; land those first.