Skip to content

Conversation

er-pa
Copy link
Member

@er-pa er-pa commented Dec 28, 2022

Purpose

Added a GUI element in the advanced folder configuration panel to be able to manipulate the extended attribute filter settings.

I intended to keep it as simple as possible, no automatic additions or other magic behind the screens. Mostly because I expect that the users who will use this will know what they are doing. But also because I'm not a fan myself of automatically added rules/lines when manipulating settings, unnecessary complexity. However, some information will still be shown when appropriate;

  • Default behaviour if a wild-card/any is not present as last element
  • A reminder in case that only deny-rules exist while the default in that case is deny - suggesting the addition of a permit-any rule in the end.

Otherwise empty rules are being cleaned up on saving the configuration and new entries are being pushed before a wild-card/any rule, if that one is present as last element.

Any further logic/validation is not present, on purpose.

Testing

  • Manipulate a folder's xattr filter using the new part in the GUI -> check result in the config file.
  • Manipulate the default folder configuration -> add a new folder -> verify that the settings are correct for the newly added folder (and default settings).

Screenshots

Screenshot 2022-12-28 at 11 51 46
Screenshot 2022-12-28 at 11 51 54
Screenshot 2022-12-28 at 11 52 03

Documentation

Supporting documentation is prepared as well, syncthing/docs#779

@tomasz1986
Copy link
Member

tomasz1986 commented Dec 28, 2022

I've had a quick look just at the GUI side of things.

  1. Would it be possible not to use arrow functions? They're not used anywhere else in the GUI, and using them here breaks the whole Web GUI in older browsers that don't support them.
  2. How about moving the whole "Checking the check-box..." help-block up between the "Xattr Filter" and "Active filter rules" labels? Alternatively, right below "Active filter rules"? Doing so should match the convention used in the rest of the GUI and also eliminate the need for the hr.
  3. How about only showing this section when syncing/sending extended attributes has actually been enabled (checked)? Just to remove the unnecessary clutter from the GUI for those that don't use these features.

Edit:

  1. Just one last comment. The trash icon gets cut off on smaller screens.

    image

@er-pa
Copy link
Member Author

er-pa commented Dec 28, 2022

I've had a quick look just at the GUI side of things.

  1. Would it be possible not to use arrow functions? They're not used anywhere else in the GUI, and using them here breaks the whole Web GUI in older browsers that don't support them.
  2. How about moving the whole "Checking the check-box..." help-block up between the "Xattr Filter" and "Active filter rules" labels? Alternatively, right below "Active filter rules"? Doing so should match the convention used in the rest of the GUI and also eliminate the need for the hr.
  3. How about only showing this section when syncing/sending extended attributes has actually been enabled (checked)? Just to remove the unnecessary clutter from the GUI for those that don't use these features.

1.) Probably. But the reasoning I'm not entirely behind. If I'm not wrong any browser post april-2016 has support for this, we talk about almost 7 years without updates. How far back do we go?...can't use this argument till eternity ;)
2.) I've tried a lot in that area, also with a drop-down box instead of checkbox to make that entire help-box obsolete. So that's surely an option and something to consider.
3.) Uhm, yeah, that's absolutely a possibility

@tomasz1986
Copy link
Member

tomasz1986 commented Dec 28, 2022

1.) Probably. But the reasoning I'm not entirely behind. If I'm not wrong any browser post-2016 has support for this, we talk about almost 7 years without updates. How far back do we go?...can't use this argument till eternity ;)

For me, it's mainly about Internet Explorer. The current Web GUI supports IE11 which used to be the only browser bundled into some editions of Windows (e.g. Windows Server and the whole Enterprise LTSB/C line). This state has only started to change last and this year (with Enterprise LTSC 2021 and Server 2022 which come with Edge, although IE11 is still present). I don't think it's worth to break the perfectly functioning GUI in those systems just yet. Just for the record, IE11 still receives security updates, although it shouldn't really matter that much in this case, as we're talking about controlling a local application here.

There's also the Android app but that's probably not important anymore, as support for pre-5 Android has recently been dropped in it, and the Android 5+ WebView does seem to support arrow functions.

@er-pa
Copy link
Member Author

er-pa commented Jan 16, 2023

Textual update:

  • Arrow-functions have been converted
  • Explanatory text moved upwards
  • Xattr renamed
  • Attempted to fix the 'out of bound' of the delete-button. Can't reproduce it here on any device or screen-size, so I'm not sure if it's fixed.

@tomasz1986
Copy link
Member

Textual update:

  • Arrow-functions have been converted
  • Explanatory text moved upwards
  • Xattr renamed
  • Attempted to fix the 'out of bound' of the delete-button. Can't reproduce it here on any device or screen-size, so I'm not sure if it's fixed.

Thank you for all the fixes! Everything GUI-wise seems to work as expected (including in IE11) with the exception for the last item.

image

Not a deal breaker, as the buttons are still functional. Just for the record, I test in Chromium using DevTools and toggling the device toolbar to switch to phone/tablet mode. Then, I set the screen size either to iPhone SE or responsive and shrink it horizontally. I would test and try to find the culprit to this one myself but I'll only have the time around the weekend or so.

@calmh calmh merged commit 0530f0e into syncthing:main Feb 9, 2023
@calmh calmh added this to the v1.23.2 milestone Feb 12, 2023
calmh added a commit to calmh/syncthing that referenced this pull request Feb 22, 2023
* main: (48 commits)
  build: Use Go 1.19.6 for Windows
  build: Update dependencies
  gui, man, authors: Update docs, translations, and contributors
  gui: Remove duplicate Spanish (Spain) translation (fixes syncthing#8781) (syncthing#8782)
  gui: Add xattr filter editor (fixes syncthing#8660) (syncthing#8734)
  gui: Switch to Weblate for translations (syncthing#8777)
  all: Use new Go 1.19 atomic types (syncthing#8772)
  gui, man, authors: Update docs, translations, and contributors
  build: Update quic-go and pfilter for Go 1.20 (fixes syncthing#8768) (syncthing#8769)
  Add forgotten copyright notices
  cmd, docker: Updates for infrastructure
  cmd/ursrv: The driver import is important, though
  cmd/ursrv: Remove old, unused migration code
  cmd/ursrv: Harmonize timespan of charts
  cmd/ursrv: Remove broken and unsustainable join/leave chart
  cmd/ursrv: Fix broken block transfer chart
  gui, man, authors: Update docs, translations, and contributors
  gui: Fix broken link to Transifex in lang/README.txt (syncthing#8761)
  gui, man, authors: Update docs, translations, and contributors
  Handle relay connect timeout (fixes syncthing#8749) (syncthing#8755)
  ...
calmh added a commit to imsodin/syncthing that referenced this pull request Mar 10, 2023
* main: (46 commits)
  build: Update dependencies
  lib/api: Expose `blocksHash` in file info (syncthing#8810)
  gui, man, authors: Update docs, translations, and contributors
  lib/discover: Don't leak relay-tokens to discovery (syncthing#8762)
  gui, man, authors: Update docs, translations, and contributors
  gui: Add Croatian (hr) translation template (syncthing#8801)
  build(deps): bump github.com/quic-go/quic-go from 0.32.0 to 0.33.0 (syncthing#8800)
  cmd/stupgrades: Cache should apply to HEAD as well as GET
  build: Add more GitHub Actions
  gui: Remove non-existent customicons.css file reference (fixes syncthing#8797) (syncthing#8798)
  Only fail after chmod error if permissions differ (e.g. on config file) (syncthing#8771)
  gui, man, authors: Update docs, translations, and contributors
  build: Use Go 1.19.6 for Windows
  build: Update dependencies
  gui, man, authors: Update docs, translations, and contributors
  gui: Remove duplicate Spanish (Spain) translation (fixes syncthing#8781) (syncthing#8782)
  gui: Add xattr filter editor (fixes syncthing#8660) (syncthing#8734)
  gui: Switch to Weblate for translations (syncthing#8777)
  all: Use new Go 1.19 atomic types (syncthing#8772)
  gui, man, authors: Update docs, translations, and contributors
  ...
@er-pa er-pa deleted the xattrfilter branch March 10, 2023 19:09
calmh pushed a commit that referenced this pull request Nov 21, 2023
### Purpose

Discovered while working on the WebAuthn credentials table in #9175:
there's a style on `td input[type="checkbox"]` that modifies margins for
all checkboxes in `<table>`s. It looks like this style is specially
tailored to the particular table that added it (PR #8734), so it should
have a correspondingly special-purpose class to not accidentally apply
it to other tables.

As best as I could tell there are only 2 instances of `<input
type="checkbox">` in `<td>`s, shown in the screenshots below.

### Testing

- Open "Actions > Logging > Debugging Facilities" and observe the
vertical spacing of the checkboxes.
- Open "Edit Folder > Advanced", check "Sync Extended Attributes" or
"Send Extended Attributes", click "Add filter entry" and observe the
vertical spacing of the checkbox that appears.

### Screenshots

#### Before

![Logs > Debugging
Facilities](https://github.com/syncthing/syncthing/assets/1367758/998fc66d-a0ad-41d9-a476-7a2b3da622d1)
![Add filter
entry](https://github.com/syncthing/syncthing/assets/1367758/647cb565-fcd0-4a81-a6ca-1f75137039b0)

#### After

Logs > Debugging Facilities now more compact:
![Logs > Debugging Facilities now
](https://github.com/syncthing/syncthing/assets/1367758/7cf8fc77-610e-4b4a-be21-c50d30be7bb9)

Add filter entry unchanged:
![Add filter
entry](https://github.com/syncthing/syncthing/assets/1367758/0ba710d6-cee1-49b4-92bc-acfc0c22c2bd)
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Feb 9, 2024
@syncthing syncthing locked and limited conversation to collaborators Feb 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants