diff --git a/.app_version b/.app_version index 16235ea2..68d0e0ab 100644 --- a/.app_version +++ b/.app_version @@ -1 +1 @@ -0.19.5 +0.19.6 diff --git a/CHANGELOG.md b/CHANGELOG.md index 31d488f3..d1d8e836 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +# 0.19.6 - 2024-12-11 + +### Fixed + +- Flash messages are now being removed after 5 seconds. +- Fixed broken migration that was preventing the app from starting. +- Visits page is now loading a lot faster than before. + +### Changed + +- Places page is now accessible from the Visits & Places tab on the navbar. + # 0.19.5 - 2024-12-10 ### Fixed diff --git a/app/assets/stylesheets/application.tailwind.css b/app/assets/stylesheets/application.tailwind.css index 3bff5194..48e213d2 100644 --- a/app/assets/stylesheets/application.tailwind.css +++ b/app/assets/stylesheets/application.tailwind.css @@ -12,4 +12,11 @@ } */ -@import 'actiontext.css'; \ No newline at end of file +@import 'actiontext.css'; + +@layer components { + .fade-out { + opacity: 0; + transition: opacity 150ms ease-in-out; + } +} diff --git a/app/controllers/visits_controller.rb b/app/controllers/visits_controller.rb index cde2c8fd..a8469831 100644 --- a/app/controllers/visits_controller.rb +++ b/app/controllers/visits_controller.rb @@ -13,12 +13,10 @@ class VisitsController < ApplicationController .where(status:) .includes(%i[suggested_places area]) .order(started_at: order_by) - .group_by { |visit| visit.started_at.to_date } - .map { |k, v| { date: k, visits: v } } @suggested_visits_count = current_user.visits.suggested.count - @visits = Kaminari.paginate_array(visits).page(params[:page]).per(10) + @visits = visits.page(params[:page]).per(10) end def update diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3fe89204..08b341ef 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -101,6 +101,10 @@ module ApplicationHelper 'tab-active' if current_page?(link_path) end + def active_visit_places_tab?(controller_name) + 'tab-active' if current_page?(controller: controller_name) + end + def notification_link_color(notification) return 'text-gray-600' if notification.read? diff --git a/app/javascript/controllers/removals_controller.js b/app/javascript/controllers/removals_controller.js index 9d4172df..cf487d07 100644 --- a/app/javascript/controllers/removals_controller.js +++ b/app/javascript/controllers/removals_controller.js @@ -1,7 +1,28 @@ import { Controller } from "@hotwired/stimulus" export default class extends Controller { + static values = { + timeout: Number + } + + connect() { + if (this.timeoutValue) { + setTimeout(() => { + this.remove() + }, this.timeoutValue) + } + } + remove() { - this.element.remove() + this.element.classList.add('fade-out') + setTimeout(() => { + this.element.remove() + + // Remove the container if it's empty + const container = document.getElementById('flash-messages') + if (container && !container.hasChildNodes()) { + container.remove() + } + }, 150) } } diff --git a/app/views/places/index.html.erb b/app/views/places/index.html.erb index 4d93a744..939cca3b 100644 --- a/app/views/places/index.html.erb +++ b/app/views/places/index.html.erb @@ -1,8 +1,9 @@ <% content_for :title, "Places" %>