Copy view components, previews, specs, and JS from rails_template#122
Merged
Copy view components, previews, specs, and JS from rails_template#122
Conversation
Adds ViewComponent infrastructure with all components from rails_template: form (input, group), alerts (flash_messages, object_errors), navbar, and UI (alert, badge, button, button_link, card, chart, dropdown, header, modal, pagination, table, table_column, time). Includes Lookbook previews, RSpec specs, Stimulus controllers (alert, collapse, dropdown, modal, theme), collapse_utils.js, SethTemplateFormBuilder, and @floating-ui/dom. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes FrozenError in test environment caused by Lookbook trying to modify frozen autoload paths in Rails 8.1. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fixes FrozenError caused by Rails 8.1 freezing autoload paths before engine initializers run. Also adds ViewComponent preview layout config and component view paths initializer. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
view_component 4.6.0 causes FrozenError when trying to modify autoload_paths in Rails 8.1. Pinning to 4.5.0 which is known to work with Rails 8.1.3. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The view components use `module UI` but Zeitwerk maps the `ui/` directory to `Ui` by default. This only fails in CI where eager_load is enabled. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This project doesn't have capybara in its bundle. These system specs (which test JS interactions via browser) can be added back if capybara is added later. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This reverts commit 472f5c6.
- Add capybara, selenium-webdriver, axe-core-rspec to test group - Move lookbook to development+test group (needed for preview URLs in system specs) - Configure ViewComponent test helpers, Capybara matchers, and headless Chrome - Define SKIPPABLE_AXE_RULES constant for accessibility testing Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace cssbundling-rails with tailwindcss-rails gem - Add config/tailwind.config.js matching rails_template setup - Create app/assets/tailwind/application.css with Tailwind v4 syntax - Includes existing section CSS imports - Adds rails_template component styles (dark mode, .twlink, dropdown, table) - Custom theme values (@theme) for colors, spacing, fonts - Remove PostCSS/Tailwind/autoprefixer Node dependencies from package.json - Remove postcss.config.js (no longer needed) - Copy tom-select CSS to vendor directory (standalone binary can't resolve node_modules) - Update Procfile.dev to use tailwindcss:watch - Update layouts to reference tailwind stylesheet - Fix @apply of custom classes for Tailwind v4 compatibility Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update all components to match rails_template: slot-based dropdown API, link color for buttons, flattened module syntax for badge/card/chart, new radio_button_group form component, and updated previews/specs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Mount Lookbook in test env for system specs (auto-mounts only in dev) - Fix system spec URLs to use actual preview method names, not group names - Fix form specs to use :username instead of :name (User has no name column) - Fix time spec expectations to match project's localize_time format - Add nil guard in UsernameValidator for blank username_slug - Skip pagination specs (project uses kaminari, not pagy) - Simplify table cache_key tests (test env uses null_store) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Set view_component.preview_paths to app/components (previews are colocated) - Set lookbook.preview_paths to app/components (separate from VC config) - Enable view_component.show_previews in test env - Revert system spec URLs back to Lookbook group names (they were correct) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add config/initializers/lookbook.rb with theme and preview_paths - Remove redundant lookbook.preview_paths from application.rb - Add view_component.instrumentation_enabled for rack-mini-profiler - Mount Lookbook in all envs (not just test), matching rails_template - Remove show_previews from test.rb (Lookbook handles its own discovery) - Add view_component/system_test_helpers to rails_helper Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add super_diff gem for better test output diffs - Add Capybara colon-escaping helpers for Tailwind CSS class selectors - Unpin view_component version (was ~> 4.5.0, now matches rails_template) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
@floating-ui/domnpm package for dropdown positioning