Files
magpie/internal/gui/assets/plugins/redact
yetone 2f22cc7e80 redact: Settings › Privacy's masking rules are imported in bulk and copied out (hgk0x on X)
hgk0x on X had many fields to mask, and adding custom rules one at a
time was slow. The Masking rules row now has Import… and Copy beside its
words, as the word lists have:

- Import… opens a box under the row's fields. One rule a line: a name,
  then a tab, =, : or comma, then the pattern; a bare pattern is CUSTOM.
  The box's Regex/Prefix choice says how a pattern is read. A JSON list
  (what Copy writes) is taken as it is, prefix and regex rules alike.
  What was read is listed (the first eight, then "and N more"); a rule
  the list has, or one pasted twice, is passed over. Import saves once,
  after the rules there are. Escape and Cancel save nothing; a redraw
  keeps the box, its text and its choice; a list the gateway refuses is
  said in the box and the paste is kept.
- Copy writes the rules as JSON.

MaxRules stays 32. Measured on this machine: 32 rules took 83ms on a
190KB body, 100 took 343ms, and that cost is on every request. One
rule's regex with alternation (a|b|c) covers many fields, which the
reply says. There is no CLI for masking rules, so none was added.

Run (GUI, mote/mica, both engines):
- new redact-rules-import.test.cjs: 5 languages x chromium/webkit at
  400px, 10/10 ok.
- the 56 GUI files that reach the privacy page, masking or i18n
  (i18n-keys, i18n-en-no-cjk, plugin-own-words, redact-*, mask-*,
  privacy-*, settings-*): 1333 tests, 27 red on loaded mica. The reds,
  run again on mote at base 5d54a990d and at this change: the same 20
  in settings-hints, settings-search and settings-lines-wrap de 440px
  on both (#6353, #6156, #6133). provider-mask's 6 reds were mica's
  load (load 60-85); it passed in both mote runs.
Broken by hand: reading every line as unnamed (named = false) turns
the new test red in every language and engine.
Not tried: the whole GUI suite, and the real app.
2026-11-13 18:17:36 +08:00
..