Global Replace: set or replace a field’s value for all caches in the current filter

Aperta
#1,092 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
12/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Attiva
Ambito
database, desktop

Direzione di ricerca

Start with docs/architecture/gsak-fields.md to see which fields are planned for writes, then read the Update Location bulk-write code and the opensak.set_corrected macro path that the issue names as the existing write pattern. The open questions (v1 field list, whether imported Groundspeak fields are editable, and undo via #942) need maintainer decisions before any code. Done means those decisions are recorded and a shared write layer is agreed on.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area: UI improvement

Background

Requested on the GSAK forum (OpenSAK thread) by a user on 1.22.0-beta.4:

How can I edit/update more than one cache in one go. Like the Global Replace in GSAK.

GSAK's Global Replace changes one field on every cache in the current filter in a single operation. The user picks a field, then either sets a fixed value or does a search-and-replace within the field's text. The typical workflow is: build a filter, then run Global Replace on the result. It's widely used for cleanup and for tagging caches before export.

Current state in OpenSAK

There's no general equivalent. Existing bulk operations on the active filter are:

  • User flags: set/clear for filtered caches (#293), clear all flags
  • Delete flagged / filtered caches
  • Move / copy caches to another database
  • Update Location (country/state/county)

The Lua macro system (#938) can iterate over filtered caches. Its write access is still limited to corrected coordinates (opensak.set_corrected). General field writes are in progress, and opensak.set_custom for custom fields is still only planned (docs/architecture/gsak-fields.md).

Proposal

A Global Replace dialog (e.g. under the Waypoints menu) that applies to all caches in the current filter:

  1. Field: a dropdown of user-editable fields. Which fields to include is to be decided; see open questions.
  2. Mode:
    • Replace with: set the field to a fixed value
    • Search and replace: replace text within the field, with an optional regex toggle (reuse the existing regex support)
    • Possibly append/prepend for text fields
  3. Preview / confirmation: show the number of affected caches before applying.
  4. Single transaction, using the same bulk-write pattern as Update Location.
  5. Locked caches: decide whether to skip them or include them.

Ideally the dialog and macro field writes share one write layer, so opensak.* macros and the UI behave the same.

Open questions

  • Which fields? I've asked the forum user which fields they typically use Global Replace on, to drive a v1 field list. Candidates: user note, user flag, found status/date, custom fields (once #1028 lands), name, placed by, country/state/county.
  • Should imported Groundspeak fields be editable at all, given a re-import would overwrite them (unless the cache is locked)?
  • Undo: rely on backup support (#942), or offer a simple "undo last Global Replace"?

Related

  • #293: bulk user-flag actions
  • #938: Lua macro system (general field writes)
  • #1028: Full GSAK Field Compatibility (custom fields)
  • #942: Backup Support
Lingua principale
Python
Stelle
37
Fork
17
Merge medio
16h 7m
PR unite (30g)
128

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenSAK-Org/OpenSAK

Tutte le issue di OpenSAK-Org/OpenSAK

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.