Skip to content

Add Agenda “fresh start” action that archives active events#64

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/add-calendar-reset-button
Draft

Add Agenda “fresh start” action that archives active events#64
Copilot wants to merge 3 commits into
mainfrom
copilot/add-calendar-reset-button

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 3, 2026

Users need a one-click “start over” flow in Calendar/Agenda that clears visible events without deleting history. This change adds that reset action and moves existing events into an archive state so they remain recoverable.

  • What changed

    • Added soft-archive support for agenda events via archived_at.
    • Added a bulk archive operation for a user+agenda (archive_all_agenda_events/2).
    • Updated active event listing to exclude archived rows.
    • Added a new Agenda UI action/button (fuck this) with confirmation, wired to archive all current events and reset the LiveView stream.
  • Data model

    • New nullable column on agenda_events:
      • archived_at :utc_datetime
  • Behavioral flow

    • Triggering fresh start:
      1. Set archived_at for all currently active events in the user’s agenda.
      2. Clear the rendered event stream so the user starts with an empty agenda view.
  • Focused tests added

    • Context test verifies archived events are excluded from active listings.
    • LiveView test verifies clicking the button clears the list and persists archive state.
def archive_all_agenda_events(user_id, agenda_id) do
  now = DateTime.utc_now() |> DateTime.truncate(:second)

  from(ae in AgendaEvent,
    where:
      ae.agenda_id == ^agenda_id and ae.user_id == ^user_id and is_nil(ae.archived_at)
  )
  |> Repo.update_all(set: [archived_at: now])
end
![Agenda fresh start button](https://github.com/user-attachments/assets/7603c74c-5dd1-4e6d-93d8-9d9968e3aa68)

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • builds.hex.pm
    • Triggering command: /usr/local/lib/erlang/erts-15.2.3/bin/inet_gethost 4 (dns block)
  • repo.hex.pm
    • Triggering command: /usr/local/lib/erlang/erts-15.2.3/bin/inet_gethost 4 (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI linked an issue Apr 3, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add 'fresh start' button to calendar for clearing events Add Agenda “fresh start” action that archives active events Apr 3, 2026
Copilot AI requested a review from spookyorange April 3, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calendar -> "fuck this" button

2 participants