Skip to content

Stage D part 6: Backup & Recovery, completing Stage D - #1315

Merged
Paul Lizer (paullizer) merged 1 commit into
feature/admin-settings-iafrom
admin-ia-stage-d6
Aug 19, 2026
Merged

Stage D part 6: Backup & Recovery, completing Stage D#1315
Paul Lizer (paullizer) merged 1 commit into
feature/admin-settings-iafrom
admin-ia-stage-d6

Conversation

@paullizer

Copy link
Copy Markdown
Contributor

Sixth and final batch of Stage D. Splits Backup, Migrate & Restore, the hardest pane in Admin Settings.

Base: feature/admin-settings-ia.

Why

One tab carried the entire backup, migration, restore, Cosmos editing and job history surface — 1,622 lines in a single scroll.

Tab Cards
Backup readiness, backup, schedule, storage, encryption
Migrate migration workflow
Restore backup inventory and restore
Cosmos Editor direct database editor
Jobs job history

Navigation is now 14 groups / 44 tabs / 88 sections. Stage D is complete, from an original 17 flat tabs.

Three problems the existing tools could not handle

1. The migration card is a <section>, not a <div>. Every div-balancing helper walked straight past it — the tools reported 5 top-level cards where there were 6, and would have silently swept 576 lines of migration workflow into the Backup tab. Its boundaries were found by balancing <section> instead, and the split was driven from explicit ranges with a check that every one of the 1,183 remaining lines lands in exactly one output.

2. Eleven dialogs, six opened from JavaScript rather than a button, serving what became five different tabs. A dialog inside a tab pane cannot appear while another tab is showing, because the pane is hidden. All eleven moved outside the panes.

Checked first that none carried a name= attribute — moving a form field outside the <form> would silently change the save payload. The pane's twelve form fields are all radio groups inside the migration card, which stayed put.

3. Shared controls. One save button, one status line and one operational-hours warning serve all five tabs.

Group-shared regions

Shared controls cannot be copied into each pane — that repeats element ids and admin_data_management.js would bind to the wrong one. They cannot live in one pane either — an inactive pane is hidden, so the other four tabs would lose the save button entirely.

They now sit outside the panes:

<div data-admin-group-shared="backup-recovery" hidden>

revealed only while that group is active, synced from every path that activates a tab including Bootstrap's own shown.bs.tab event.

A real bug caught while building this: syncAdminGroupSharedRegions() originally resolved the group from the top tab strip. That strip is not rendered at all in the sidebar layout, so the Backup & Recovery save button would have been hidden permanently for anyone using the sidebar. It now resolves from either navigation, verified against a simulated DOM:

tab layout       backup=SHOWN  migrate=SHOWN  branding=hidden
sidebar layout   backup=SHOWN  migrate=SHOWN  branding=hidden

New test

test_admin_settings_group_shared_regions.py asserts shared regions name a real group, sit outside the tab content container, are synced from every activation path, resolve in both layouts — and that every element id in the composed template is unique (1,608 of them). That last check is a broad guard against exactly the duplication this change had to avoid.

No settings changed

Not one name= attribute was touched.

Check Result
Field contract 462 names / 110 card ids, byte-identical
Regression set (75 files) 32 failures, identical set to baseline
Jinja compile 46/46 admin templates
XSS sinks pass
Element ids all 1,608 unique
Modal placement every dialog reachable from its trigger

Next

Stage E: split system-settings-section (currently parked in Security → Session; four of its eight fields are idle-timeout, the rest belong elsewhere) and mirror the ten role toggles into Access & Roles. Then revert the six CI branch filters and open the staging → Development PR.

One tab carried the entire backup, migration, restore, Cosmos editing
and job history surface: 1,622 lines in a single scroll.

  Backup          readiness, backup, schedule, storage, encryption
  Migrate         migration workflow
  Restore         backup inventory and restore
  Cosmos Editor   direct database editor
  Jobs            job history

Navigation is now 14 groups / 44 tabs / 88 sections. Stage D is done,
from an original 17 flat tabs.

Three problems the existing tools could not handle

  The migration card is a <section>, not a <div>, so every div
  balancing helper walked straight past it and the tools reported five
  top level cards where there were six. Its boundaries were found by
  balancing <section> instead, and the split was driven from explicit
  ranges with a check that every one of the 1,183 lines lands in
  exactly one output.

  Eleven dialogs, six of them opened from JavaScript rather than a
  button, serving what became five different tabs. A dialog inside a
  tab pane cannot appear while another tab is showing, so all eleven
  moved outside the panes. Checked first that none carried a name=
  attribute: the pane's twelve form fields are all radio groups inside
  the migration card, which stayed put.

  One save button, one status line and one operational warning serve
  all five tabs.

Group-shared regions

  Shared controls cannot be copied into each pane, because that repeats
  element ids and the JavaScript module would bind to the wrong one,
  and cannot live in one pane, because an inactive pane is hidden and
  the other four tabs would lose the save button.

  They now sit outside the panes marked
  data-admin-group-shared="backup-recovery" and are revealed only while
  that group is active, synced from every path that activates a tab
  including Bootstrap's own shown.bs.tab event.

  syncAdminGroupSharedRegions resolves the owning group from either
  navigation. Reading only the top tab strip was a real bug: that strip
  is not rendered at all in the sidebar layout, so the save button
  would have been hidden permanently. Verified against a simulated DOM
  in both layouts.

Verified
  field contract     462 names / 110 card ids, unchanged
  regression set     32 failures, identical to baseline
  jinja compile      46/46 admin templates
  xss sinks          pass
  element ids        all 1,608 ids in the composed template are unique
  modal placement    every dialog reachable from its trigger

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@paullizer
Paul Lizer (paullizer) merged commit f69ceae into feature/admin-settings-ia Aug 19, 2026
11 checks passed
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.

1 participant