Skip to content

WebUI: optional New interface (opt-in, Classic stays default) - #47

Open
ash-iir wants to merge 14 commits into
VD171:mainfrom
ash-iir:ui-next-upstream
Open

ash-iir wants to merge 14 commits into
VD171:mainfrom
ash-iir:ui-next-upstream

Conversation

@ash-iir

@ash-iir ash-iir commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Adds an opt-in second WebUI. Classic stays the default and is unchanged apart from one script tag, one Settings field and one line in scripts.js.

How it works

  • Lives in module/webroot/next/ and reuses scripts.js, i18n.js, lang/ and the helper(verb,args) contract with the same element ids, so every Classic control behaves the same in both interfaces (199/199 controls checked in the mock harness).
  • Switch: Settings > Interface > New. Back: Settings > Interface > Classic, or More > "Switch to the classic interface".

What is in it

  • Bottom tabs: Home, Backup, Restore, Schedule, More. Backup and Restore each have Apps / System data / Files / /data/adb sections.
  • Restore lists local, Telegram, rclone, Google Drive, restic snapshots and mirror backups in one list, with filter chips (source, type, encrypted, pinned, tags) and sort. Remote sources load in the background, each with its own error and Retry.
  • Home counters include remote backups and show count and size per source.
  • Compact progress bar above the tabs; optional progress notification via the existing cmd notification post path, off by default.
  • One dialog stack, so a confirm always opens above the sheet it came from; Back closes only the top one.
  • Startup renders from the last good snapshot, then refreshes.
  • RTL mirroring, no web fonts, no new dependencies.

Backend (additive)

  • helper.sh: new bootstrap and restic-list verbs; rclone-list accepts mirrors:true; list-backups adds size. Existing verbs and their default output are unchanged.
  • worker.sh: progress notification behind the new setting.

Strings

New keys in en.js, en.json and every lang/<code>.json (AR, DE, RU translated, others fall back to English).

Testing

sh -n, shellcheck -s sh, node --check, JSON validation, and the tools/screenshots mock harness (shoot_ui_next.py) in EN/AR/DE, light and dark, at 360 and 412 dp, including a 400 apps / 1000 backups fixture. Not tested on a device.

Round 3 (device feedback on v1.19-next2)

  • Back: each level the user opens (a tab after the first, a dialog, the ops sheet) gets one history entry, pushed from the tap that opened it. WebView skips history entries a page adds without a user gesture, so the re-armed sentinel let Back from More > Settings close the whole WebUI. One popstate handler now closes the top dialog, the ops sheet or the last tab, in that order.
  • Sheets: children of a dialog card no longer shrink, so long lists (folder picker, /data/adb options) scroll with the card instead of being clipped. When the keyboard opens, the focused field is scrolled back into view.
  • Ops bar: a tap opens the full sheet only when the bar cannot show everything (several ops, or a batch's skipped/failed list).
  • Restore: a finished op marks every remote source stale and reloads the list at once when Restore is showing, so a new Telegram/cloud backup appears right away. Select mode lists the local backups batch restore and delete work on, and Select > All picks only the rows on screen, never rows the filter chips hide. Source updates redraw once per frame.
  • Notifications (worker.sh): posts go through su 2000 as the shell user and fall back to root. A post from uid 0 goes out as package root, which some ROMs (seen on OxygenOS) drop silently, so neither the progress notification nor the start/done notices showed.

Round 4 (UI/UX audit)

  • Back: in Backup or Restore select mode, Back ends select mode first. Back from a main tab goes to Home, as Android apps do; sub pages still return to where they were opened.
  • Empty search: Restore and Backup > Apps show the no-match text instead of a blank screen.
  • Phone widths: Home counters use a 2x2 grid on phones (no word breaks in any language), accent swatches wrap, the Telegram phone field gets the input style, Restore's select bar sticks under the app bar, Home source rows are 40px tap targets, and a remote backup with no label wraps its package name.
  • Keyboard: bottom nav and ops bar hide while it is open.
  • Long lists: row size estimates match the rows, so 300+ item lists no longer jump while scrolling.

Round 5 (Files and Telegram)

  • Backup > Files keeps a list of folders (Add, Enter or Browse) and backs them up together.
  • Schedules get What: Apps / Files with the same folder editor.
  • Restore > Files lists folder backups held on Telegram, with Restore and Delete.
  • Settings gets Telegram parallel transfers.

The backend for these is a separate PR (#48); without it the worker keeps taking the first folder only.

Round 6

  • Restore select mode drops picks a filter chip or search hides, so batch Delete and Restore act only on the backups on screen.
  • Restore > Files shows its empty message again after the last Telegram folder backup is removed.
  • Long labels: nav labels hyphenate instead of breaking mid-word; the Schedule folder row keeps the path readable in de and ru.
  • i18n: the New interface strings (nx_*, interface choice, folder/schedule/Telegram keys) are translated in every language; only values that were English copies changed.

Round 7

  • Restore safety: OK stays disabled until an item is ticked (the worker reads an empty list as everything); Snapshot and Mirror restores no longer offer Test restore or item picks their worker paths ignore, and they pass the user.
  • Backup dialog opens with Dry run off.
  • Dialogs queue instead of replacing the open one.
  • Per-app tags, notes and items that are removed now stay removed (sent as null through the config merge).
  • Double taps on direct op buttons start one op.
  • Restore redraws after a language change and follows destination changes at once.
  • Uninstalled (Delete backups of uninstalled apps #40): picks the backups of uninstalled apps the filters show and offers to delete them with the total size. Batch restore offers ART profiles (More options for restoring backups in bulk #39). The shared engine part is also its own PR (Restore: ART profiles in batch restore; Uninstalled skips mirrors and failed app lists (#39, #40) #49).

Screenshots

Classic vs New:
compare
compare 2
dialogs
arabic

Restore list and nested confirm:

Happy to split this up or change anything you'd prefer done differently.

Adds an opt-in second WebUI under module/webroot/next/ that reuses
scripts.js, i18n and lang/ and keeps the same element ids, so every
Classic control works the same in both interfaces.

- Settings > Interface switches between Classic (default) and New.
- Bottom tabs: Home, Backup, Restore, Schedule, More.
- Restore shows local, Telegram, rclone, Google Drive, restic and
  mirror backups in one list with source/type/encrypted/pinned/tag
  filters and sort.
- Compact progress bar; optional progress notification (off by
  default).
- One dialog stack so a confirm always opens above its sheet.
- helper.sh: bootstrap, restic-list; rclone-list mirrors flag;
  list-backups includes size. Existing verbs and outputs unchanged.

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
…ps bar

- Back: every level the user opens (a tab after the first, a dialog, the ops
  sheet) gets one history entry, pushed from the tap that opened it. WebView
  skips entries a page adds without a user gesture, so the re-armed sentinel
  let Back from More > Settings close the whole WebUI. One popstate handler in
  shell.js now closes the top dialog, the ops sheet or the last tab, in that
  order; a level closed by its own button drops its entry again.
- Sheets: children of .modal-card no longer shrink, so long lists (folder
  picker, /data/adb options) scroll with the card instead of being clipped.
- Keyboard: when it opens, the focused field in a sheet is scrolled back into
  view instead of staying under the keyboard.
- Ops bar: a tap opens the full sheet only when the bar cannot show
  everything (several ops, or a batch's skipped/failed list).

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
…e visible rows

- A finished op marks every remote source stale and, when Restore is on
  screen, reloads the list at once (a new Telegram/cloud backup no longer
  waits for the 5 minute cache).
- Select mode lists local backups only, the ones batch restore and delete
  take; Select > All picks the rows on screen, never rows the filter chips
  hide.
- Source updates redraw the list once per frame.

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
A post from uid 0 goes out as package "root", which some ROMs (seen on
OxygenOS) drop without an error, so neither the progress notification nor
the start/done notices showed. npost posts through su 2000 and falls back to
root when su cannot switch users.

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
…hen a search finds nothing

- Back in Backup or Restore select mode ends select mode instead of leaving
  the tab with the picks still on; leaving the tab ends it too.
- Back from a main tab goes to Home, as Android apps do; sub pages still
  return to where they were opened.
- A search with no hits shows the no-match text in Restore and in Backup >
  Apps instead of a blank screen.
- A remote backup with no known label wraps its package name after the dots.

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
- Home counters use a 2x2 grid on phones, so no language breaks a word.
- Accent swatches wrap (40px) instead of hiding behind a scrollbar.
- The Telegram phone field gets the input style (type="tel").
- Restore's select bar sticks under the app bar, like Backup's.
- Bottom nav and ops bar hide while the keyboard is open.
- Home source rows are 40px tap targets.
- Row size estimates match the rows, so long lists stop jumping on scroll.

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
…der restores

- Backup > Files keeps a list of folders (Add, Enter or Browse) and sends
  them as paths[] in one backup.
- The schedule form gets What: Apps / Files with the same folder editor.
- Restore > Files lists folder backups held on Telegram that are not on the
  device, with Restore (pull, then the normal path restore) and Delete.
- Settings gets Telegram parallel transfers (tg_parallel, 1 to 8).

The backend side is in the tg-files-parallel PR; without it the old
worker keeps taking a single path.

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
…te; long labels

- Restore select mode drops picks that a filter chip or search hides, so
  batch Delete and Restore act only on the backups on screen.
- Restore > Files shows its empty message again after the last Telegram
  folder backup is removed.
- Nav labels hyphenate long words instead of breaking them mid-word, and the
  Schedule folder row puts the path on its own line so long button labels
  in de and ru no longer squeeze it.

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
Adds the folder, schedule and Telegram parallel keys to every lang file and
translates the nx_* and interface strings that were still English copies.
Only values equal to en.json were touched.

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
- Restore OK stays disabled until an item is ticked: the worker reads an
  empty items list as everything.
- Snapshot and Mirror restores offer only the overwrite confirm and the
  installer spoof, since their worker paths ignore test, items, SSAID and
  network policy, and they now pass the user.
- The backup dialog opens with Dry run off.
- Shared dialogs queue instead of replacing the open one, so an answer
  never lands in another flow; an identical pending request is dropped.

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
- config-set merges maps, so a tag, note or item choice the engine removes
  came back on reload. Removed keys of app_items, app_tags and app_note are
  sent as null, which every reader treats as unset.
- An identical op request already in flight shares its answer, so a double
  tap on Telegram Restore or System Back up starts one op.

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
Restore and Files lists redraw when a new language is applied, and the
Restore sources update as soon as destinations reload.

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
…1#39, VD171#40)

- Batch restore lists ART profiles like single restore: the engine left
  profiles out of BITEMS_ORDER, so a batch never restored them.
- Batch delete confirm shows the total size when it is known.
- Uninstalled skips Mirror backups (they have no checkbox and batch actions
  do not handle them) and selects nothing when the app list fails.
- New interface: Uninstalled picks exactly the backups of uninstalled apps
  the filters show and offers to delete them; Cancel keeps the picks.

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
…rings

Signed-off-by: ash-iir <254348575+ash-iir@users.noreply.github.com>
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