- Update links in cities index to include country emoji
- Modify display in cities show view to use emoji and country name
- Clean up random scope method in weather_art model for consistency
These changes enhance the user interface presentation by making
country names visually enriched with emojis, improving the overall
user experience with clearer visual cues.
- Update to include a new 'random' scope in WeatherArt model.
- Modify HomeController to fetch random and popular arts along with latest arts.
- Refactor index.html.erb to utilize a partial for rendering arts.
This update improves the display of weather art by adding a new
random selection of arts alongside popular ones, increasing user
engagement and variety. The code structure is also cleaner due
to the use of a partial view for rendering arts, promoting
the DRY principle.
- Change the order of displayed city attributes in logs
- Adjust tabulation for clearer output
This commit modifies the logging format used in the
BatchGenerateWeatherArtsWorker class. The attribute order for
city information in the log output has been changed to ensure
a more intuitive display, with regions now appearing before
countries and states. This will enhance readability during
logging without altering any functionality.
- Changed description for the 'batch_generate_weather' job from
'Generate weather arts every 2 hours' to 'Batch Generate weather
arts'.
- This change provides a more concise description of the job's
purpose without altering its functionality.
- Implement daily generation limit for weather arts
- Improve city selection by prioritizing active cities
- Introduce logging for city generation start time and list
This update enhances the efficiency of the `BatchGenerateWeatherArtsWorker`. It ensures that the system respects a daily limit on the number of generated images and improves how cities are selected for processing by prioritizing active cities while also conditionally selecting others if slots remain. Additionally, the added logging provides better insights into the generation process.
- Remove deprecated `image_with_watermark` attachment.
- Introduce `webp_image`, `preview_image`, and `watermarked_image` methods in `WeatherArt` model for optimized image formats.
- Update views to use new image variants, including webp and previews, improving loading times and visual quality.
- Ensure images are processed with relevant attributes such as quality and dimensions for better performance and user experience.
These changes enhance the image handling capabilities of the application by ensuring images are served in a more efficient format (WebP) and with improved resizing options, leading to better performance overall.
- Adjusted join statement in SQLite and PostgreSQL
- Ensure consistent use of whitespace for better readability
This change improves code clarity without changing any
query behavior, making it easier for future developers
to maintain and read the SQL join conditions.
- Add padding and flex layout to the sign out button
- Wrap the icon and text in a div for better structure
These changes update the sign out button in the navbar for improved
accessibility and aesthetics, aligning it better with the overall UI
style.
- Adjust main navigation layout for better spacing
- Improve mobile menu accessibility and usability
- Introduce a separate user menu partial for cleaner structure
- Update button styles and sizes for consistency
These changes aim to enhance the user experience by ensuring that the navbar is visually appealing and functional across different screen sizes, making navigation easier.
- Change `limit:` to `limit =` in the scopes for
`latest` and `by_popularity`.
- This allows for a default value of 100 to be used
if no argument is provided, making the code more
user-friendly and consistent.
This refactor does not alter the behavior of the
existing functionality but streamlines the syntax.
- Change `by_popularity` method in `City` model to use `start_time` for filtering views.
- Update `by_popularity` in `WeatherArt` model to limit results and incorporate the correct popularity calculation.
- Adjust `HomeController` to define `@popular_shuffle_arts` and `@latest_arts` with appropriate scopes.
These changes improve the accuracy of popularity retrieval for both cities and weather arts, simplifying the logic in the controller and leveraging updated model methods for performance.
- Introduce filtering of cities by selected country
- Retrieve current country using friendly find method
- Apply city filtering if country is provided in parameters
This change allows users to efficiently filter cities based on the
selected country, providing a more tailored experience and
encouraging better navigation through the list of cities.
- Update buttons to include data attribute for Turbo frames
- Ensure proper behavior of navigation with turbo-enabled requests
This change enhances the functionality of the buttons by allowing them
to interact with Turbo frames, improving performance and user
experience when transitioning between different views on the application.
- Implement loading state in the search input with spinner.
- Optimize the search request to handle pending requests and cancels.
- Add dynamic response handling for Turbo frames to load search results.
- Create a new partial for city search results.
- Update the cities controller to support Turbo stream responses.
These enhancements improve user experience during searches by showing a loading
spinner and addressing potential issues with overlapping requests, ensuring
that the application remains responsive and functional when fetching city
search results.
- Implement search_by_name scope in City model
- Add SearchController for handling search input
- Include _search_city partial in cities index view
- Update cities_controller to filter cities based on search query
This commit introduces a new feature that allows users to search for
cities by name using an input field. The search is implemented as a
scope in the City model, and it is integrated into the existing
CitiesController. A dedicated SearchController manages the input
submission with a debouncing mechanism for better performance. The
search field is rendered in the cities index view, enhancing user
interactivity and experience.
- Implement new scope in City model to fetch popular cities
- Query modified to consider different time periods: today, week, month, and year
- Update Ahoy Dashboard to show top cities for each time period
This change enhances the dashboard, providing insights into city popularity over varying durations, facilitating better data analysis.
- Change 'belongs_to :country' association to be optional
- Change 'belongs_to :state' association to be optional
This refactoring allows a City record to exist without having
an associated Country or State, thus increasing the flexibility
of the data model for various use cases.
- Add requirements for clearer and brighter images
- Specify maintenance of brightness even in overcast conditions
- Include enhancements for sunny day imagery
- Revise output prompt to remove unnecessary prefix and suffix
These changes improve the clarity and effectiveness of prompts
used in AI-generated imagery. The additional specifications help
guide the AI in producing visually appealing and contextually
relevant images for various weather conditions.
- Refactor prompt generation to separate location
description functionality
- Update user prompt generation for DALL-E 3
- Improve AI service's response handling
This change enhances the AiService by creating a more
modular approach to generating prompts. The introduction
of a `generate_location_desc` method improves the
detail and context provided in the generated prompts.
Furthermore, the `ask_ai` method centralizes AI request
logic, allowing for cleaner and more organized code.
These adjustments should improve the overall robustness
and readability of the prompt generation process.
- Include state, country, and region in the DALL-E prompt
- Enhance context for the generated weather scene
This change improves the specificity of the prompts generated
for the AI, providing more contextual information such as
state, country, and region alongside the city name. This
enhancement can lead to more accurate and relevant outputs
from the DALL-E 3 model for weather scenes.
- Clean up trailing whitespace in app/admin/state.rb
- Clean up trailing whitespace in app/admin/subregions.rb
- Clean up trailing whitespace in app/admin/users.rb
- Adjust formatting in cities_controller.rb for consistency
These changes improve code readability and maintainability by
removing unnecessary whitespace. It is a small clean-up that prepares
files for better version control parsing and reduces the diff clutter.
- Change generation interval from 24 hours to 36 hours
This change provides more flexibility in scheduling weather arts generation, which could lead to better resource management or accommodate changes in data availability.
- Clean up trailing whitespace in app/admin/state.rb
- Clean up trailing whitespace in app/admin/subregions.rb
- Clean up trailing whitespace in app/admin/users.rb
- Adjust formatting in cities_controller.rb for consistency
These changes improve code readability and maintainability by
removing unnecessary whitespace. It is a small clean-up that prepares
files for better version control parsing and reduces the diff clutter.
- Include assignment of country code when creating a city
- Ensure that all relevant geographical data is accounted for during
the city creation process
This change addresses a missing assignment of the country code for new
city records, ensuring that instances are complete and accurate.
- Update menu labels for cities, countries, and regions
- Introduce new entities for states and subregions in Admin Panel
- Implement admin authentication for weather art generation
- Modify application controller to check for admin user
- Refactor view to display admin panel based on user permissions
- Update routes to include weather art generation action
These changes enhance the admin interface for better management of cities
and related entities. The new admin checks ensure that only authorized users
can generate weather art, improving security and functionality.
- Update development database URL to use a fallback
if no URL is provided in credentials.
- Modify production SMTP password retrieval to use
dig method for more robust access.
These changes allow for smoother local development and
ensure that the production environment correctly
accesses the SMTP password, enhancing overall stability.
- Implemented a new admin panel that allows administrators to view
statistics and manage weather art. The panel includes:
- A card displaying total images and today's images
- Buttons to generate new art and edit the city
- Added `admin?` helper method to check if the current user is an
administrator.
- Updated database configuration to use safer credentials lookup
method `dig` for development database URL instead of the
previous method, improving reliability in accessing nested
credentials.
- Adjusted the spacing in the 'unlock_keys' configuration
- Ensured uniform spacing around array elements
This change does not affect the functionality of the unlock
keys in Devise but improves the consistency of the code
formatting to enhance readability.
- Updated confirmation, password, unlock, and session views to use a
card-based layout for improved visual appeal.
- Added responsive design features to ensure compatibility across devices.
- Enhanced usability by providing clear placeholders in form fields.
These changes improve the user experience during account recovery and
management processes. The design promotes a modern interface while
maintaining functionality.
- Add confirmable and lockable modules to user model
- Update error messages display with improved UI
- Modify navbar links for better accessibility and styling
- Add unique indexes for confirmation and unlock tokens in migration
These changes improve user management and user experience by
adding features for account activation and security, along
with styling enhancements for the authentication views.
- Implement Stimulus controller for closing flash messages
- Replace inline alerts with a partial for better organization
- Enhance styling for user registration and login forms
This update introduces a new flash message component that allows
for user notifications to be displayed on the screen and closed by
the user. The forms also include improved styles for a better
user experience.
- Improve the user registration form layout with card styling.
- Add input classes for better design consistency.
- Introduce a new navbar partial for better component management.
- Removed the old navbar code to streamline application layout.
These changes provide a more modern and user-friendly experience during
user registration and improve the overall site's navigation structure.
- Integrate Devise for user authentication
- Create User model and necessary views
- Implement email confirmation and password reset functionality
- Add routing for user sign-up and login
- Customize error messages display
This commit initiates user authentication in the application
using the Devise gem. It includes user registration, login,
password reset, and email confirmation features. Additionally,
the necessary views and mailer templates are included to
support these functionalities. This enhances the security
and usability of the application by allowing users to create
accounts and manage their passwords effectively.
- Include 'devise' gem for user management
- Update database access URLs in configurations
- Refactor schema types from bigint to integer for resource and author IDs
- Enhance geo synchronization by updating region and subregion handling
These changes are aimed at improving the user management functionality while ensuring efficient data handling and connections for production environment.
- Replace verbose conditional checks with a ternary operator
- Use 'find_by!' for better error handling if country not found
- Maintain the functionality of state creation associated with the country
- Replace country name lookup with country code lookup
- Replace state name lookup with state code lookup
- Change city creation to ensure country association
This update modifies the existing logic for synchronizing city data to
use country and state codes instead of names. This aids in ensuring
more robust data integrity by relying on unique identifiers.
- Remove unnecessary debug output for country syncing.
- Improve country determination logic by adding checks for
both country code and country name.
- Ensure state records are associated with the correct
country ID post-refactor.
These changes enhance the clarity and efficiency
of the geo data synchronization code, making it easier to
maintain and reducing the risk of errors during data
syncing.
- Change output to include country name during state syncing
- Update record creation from `find_or_initialize_by!` to `find_or_create_by!`
This fix ensures that when syncing state data, the output provides
better context by showing the associated country name, and it also
ensures that states are created if they do not already exist, thus
eliminating potential issues with duplicate state entries.
- Refactor the country creation process to use a block for setting
the name attribute.
- Ensure that the name is set explicitly when a new country is
created with the appropriate ISO code.
This change optimizes the way country records are created and
ensures the name is always correctly assigned during the
creation process.
- Replace `find_or_create_by` and `find_or_initialize_by` with `find_or_create_by!` and `find_or_initialize_by!` for better error handling.
- Use the `update!` method instead of `update` to raise exceptions on failure.
- These changes improve the reliability of geographic data synchronization by ensuring failures are not silently ignored and facilitate easier troubleshooting.
- Change from find_or_initialize_by to find_or_create_by for
regions.
- Set region code to the name instead of nil.
This refactor reduces complexity in how regions are created and
ensures the code attribute is properly populated with the
region's name, enhancing data consistency.
- Update region name with data from the input
- Set code to nil to reset any previous values
- Preserve other attributes like translations, flag, and wiki_data_id
This change ensures that region data is updated correctly with the
provided input while eliminating any previous code settings that may
no longer be relevant.
- Change the method of finding or initializing subregions to use
the name attribute instead of the id.
- This improves accuracy when synchronizing subregion data, as it
ensures that subregions are correctly matched by name.
- Eliminates potential issues with duplicate IDs if they happen
to be reused across different data sources.