Skip to content

Manage gsheet tabs (4th, last iteraton)#82

Open
gazdagergo wants to merge 4 commits intomainfrom
manage-gsheet-tabs
Open

Manage gsheet tabs (4th, last iteraton)#82
gazdagergo wants to merge 4 commits intomainfrom
manage-gsheet-tabs

Conversation

@gazdagergo
Copy link
Collaborator

@gazdagergo gazdagergo commented Mar 13, 2026

Summary

This PR adds the Manage Generated Tabs feature to the backoffice
Selection tab, allowing users to list and delete old selection output
tabs from their Google Spreadsheet.

Key Features

Manage Generated Tabs

  • List Old Tabs: View all tabs created by previous selection runs
  • Delete Old Tabs: Clean up old tabs that are no longer needed
  • Progress modal with real-time status updates via HTMX polling
  • Cancel running tasks support

Design System Improvements

  • Add reusable progress_modal macro with helpers (spinner,
    status_badge, modal_footer_start/end, etc.)
  • Refactor selection_progress_modal.html to use new design system
    macros
  • Add modal component to design system showcase

Bug Fixes & Improvements

  • Fix CSP issues with modal close handlers (use nonce-based scripts)
  • Add auto-scroll for message logs in progress modals
  • Add @require_assembly_management decorator to selection POST
    routes

New Routes

Route Method Description
/assembly/<id>/manage-tabs/start-list POST Start listing old
tabs task
/assembly/<id>/manage-tabs/start-delete POST Start deleting
old tabs task
/assembly/<id>/manage-tabs/<run_id>/progress GET HTMX modal
polling endpoint
/assembly/<id>/manage-tabs/<run_id>/cancel POST Cancel
running task

Files Changed

  • backoffice.py: New routes and _get_manage_tabs_context helper
  • modal.html: New progress_modal macro and helpers
  • manage_tabs_progress_modal.html: New modal template
  • assembly_selection.html: Enable "List Old Tabs" button with modal
    include
  • AGENTS.md: Add code style rule for empty except clauses

Test Plan

  • Manual testing: List tabs flow
  • Manual testing: Delete tabs flow
  • Manual testing: Cancel functionality
  • Manual testing: Error states
  • BDD tests (future)

gazdagergo and others added 3 commits March 11, 2026 13:32
- Add progress_modal macro and helpers (spinner, status_badge, message_log,
  labeled_value, modal_footer_start/end) to modal.html
- Refactor selection_progress_modal.html to use the new design system macros
- Add progressModalDemo Alpine component for interactive showcase demo
- Create modal_component.html showcase section with state demos
- Add modal section to showcase.html components tab

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add routes for listing/deleting old tabs (start-list, start-delete, progress, cancel)
- Add _get_manage_tabs_context helper for view_assembly_selection
- Add manage_tabs_progress_modal.html template
- Add implementation plan documentation

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Address code quality review feedback. Also document the rule in AGENTS.md.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gazdagergo gazdagergo marked this pull request as ready for review March 13, 2026 08:39
@gazdagergo gazdagergo changed the title WIP: Manage gsheet tabs (4th, last iteraton) Manage gsheet tabs (4th, last iteraton) Mar 13, 2026
@gazdagergo gazdagergo requested a review from foobacca March 13, 2026 08:39
{# JavaScript for close handlers - CSP compliant with nonce #}
<script nonce="{{ csp_nonce }}">
(function() {
var closeUrl = '{{ close_url }}';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we added this JavaScript function to one of the static/js/ files - so it is used by all the modals and doesn't need to be added inline here.

Actually just checked, and we didn't. But we do have almost the same JS in selection_progress_modal.html - and presumably also need it for the replacement modal as well. So it probably ought to be a shared piece of JS.

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.

2 participants