Skip to content

Conversation

calmh
Copy link
Member

@calmh calmh commented Jun 4, 2023

This changes the rendering of shared folders and devices to not use code generated HTML and tooltips. Instead we show the full list of devices/folders (allowing line breaks) and add an asterisk + tooltip to each device/folder that has an annotation.

Screenshot 2023-06-04 at 10 02 21 Screenshot 2023-06-04 at 10 02 34

Also removes the auto-HTML-ification of warning messages.

Both of these changes are necessary because the strings displayed here are unsafe: potentially controlled by someone on a remote device.

This changes the rendering of shared folders and devices to not use code
generated HTML and tooltips. Instead we show the full list of
devices/folders (allowing line breaks) and add a tooltip to each
device/folder that has an annotation.
@acolomb
Copy link
Member

acolomb commented Jun 4, 2023

Looks nice overall. But please don't simply use an asterisk. The superscript 1 was chosen for a good reason, as there is also a number 2 for a different cause. I'd like to keep seeing the difference on first glance, without tooltips.

@calmh
Copy link
Member Author

calmh commented Jun 4, 2023

I removed the numbers since they no longer referred to anything, but I agree that once you learn them it adds value at a glance. Re-adding.

@acolomb
Copy link
Member

acolomb commented Jun 4, 2023

Have you checked what this looks like in the Sharing tab under device / folder edit modals? I think it uses the same functions you removed from the controller.

@calmh
Copy link
Member Author

calmh commented Jun 4, 2023

Ah, indeed, there's one more thing to fix.

@tomasz1986
Copy link
Member

tomasz1986 commented Jun 4, 2023

Would it be possible to update the screenshots to display the final iteration?

Edit:

Is there any special reason for using the middle dot instead of commas as before? To be honest, I find them kind of weird and also it seems easier, at least for me, to see where one name ends and the next starts with commas…

@calmh
Copy link
Member Author

calmh commented Jun 4, 2023

I wasn't super excited about the appearance of the spacing with superscript and comma, but I don't really care that much. Sure, have commas.

Screenshot 2023-06-04 at 13 49 24

@tomasz1986
Copy link
Member

Thank you!

I've tested the code locally and it does look nice, although the list, which was hidden previously, can now get quite lengthy with a lot of folders, e.g.

image

On the other hand, I personally do like having them visible all the time.

@calmh
Copy link
Member Author

calmh commented Jun 4, 2023

Yes, this is the tradeoff. I think this is how it should be, if we want to list the folders in the GUI. A large list is a large list, it isn't really easier to read stuffed into a tooltip, I think.

Copy link
Member

@imsodin imsodin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So much on me not finding any usages of html...

One potential whitespace nit.

@tomasz1986
Copy link
Member

Just one comment. There is a problem when using super-long, non-breaking labels, e.g.

image

The label gets truncated and cannot be viewed in full at all, which wasn't the case with the tooltip. A simple/dirty fix I can think of is to add the file-path class to the relevant table cell. I call it "dirty" because the class name doesn't really match the content, but it does allow the long text to break.

calmh added 2 commits June 5, 2023 10:25
* main:
  build: Tests should run with Go 1.20 on Windows (syncthing#8924)
  gui, man, authors: Update docs, translations, and contributors
  lib/model: Improve test for unignored parent directories (syncthing#8926)
  build: Update dependencies (syncthing#8925)
@calmh
Copy link
Member Author

calmh commented Jun 5, 2023

fixd

@calmh
Copy link
Member Author

calmh commented Jun 5, 2023

Screenshot 2023-06-05 at 10 28 55

@calmh calmh merged commit 4e2bb58 into syncthing:main Jun 5, 2023
@calmh calmh deleted the nogeneratehtml branch June 6, 2023 07:05
calmh added a commit that referenced this pull request Jun 6, 2023
calmh added a commit to calmh/syncthing that referenced this pull request Jun 6, 2023
* release:
  gui: Avoid code generating HTML (syncthing#8923)
  gui: Remove HTML support in tooltips
calmh added a commit to calmh/syncthing that referenced this pull request Jun 14, 2023
* main:
  gui, man, authors: Update docs, translations, and contributors
  Don't add empty device to config on init (syncthing#8933)
  build: Push release files to cloud storage
  build: Generate .asc files for release packages (fixes syncthing#8897)
  build: Properly build all Debian archs (fixes syncthing#8898)
  gui: Avoid code generating HTML (syncthing#8923)
  gui: Remove HTML support in tooltips
  gui: Avoid code generating HTML (syncthing#8923)
  build: Tests should run with Go 1.20 on Windows (syncthing#8924)
  gui, man, authors: Update docs, translations, and contributors
  lib/model: Improve test for unignored parent directories (syncthing#8926)
  build: Update dependencies (syncthing#8925)
  gui: Remove HTML support in tooltips
@calmh calmh added this to the v1.23.6 milestone Jun 14, 2023
calmh added a commit to calmh/syncthing that referenced this pull request Jun 14, 2023
* main:
  build: Update some dependencies
  build: Make sure we get the latest matching Go version
  build: Multi arch Docker images with GitHub actions (ref syncthing#8834)
  lib/config, gui: Disallow some options in combination with "untrusted" (fixes syncthing#8920) (syncthing#8921)
  gui, man, authors: Update docs, translations, and contributors
  Don't add empty device to config on init (syncthing#8933)
  build: Push release files to cloud storage
  build: Generate .asc files for release packages (fixes syncthing#8897)
  build: Properly build all Debian archs (fixes syncthing#8898)
  gui: Avoid code generating HTML (syncthing#8923)
  gui: Remove HTML support in tooltips
  gui: Avoid code generating HTML (syncthing#8923)
  build: Tests should run with Go 1.20 on Windows (syncthing#8924)
  gui, man, authors: Update docs, translations, and contributors
  lib/model: Improve test for unignored parent directories (syncthing#8926)
  build: Update dependencies (syncthing#8925)
  gui: Remove HTML support in tooltips
  cmd/syncthing: Use correct binary when restarting monitor (syncthing#8919)
tomasz1986 added a commit to tomasz1986/syncthing that referenced this pull request Jan 20, 2024
…yncthing#8923)

Since [1], it is no longer possible to use HTML in tooltips. This was
addressed in [2], however the commit missed one instance of HTML that
was used to change the font type of the External versioning command
tooltip. This remaining HTML is removed in this commit.

[1] f5e5af3
[2] 73c52ea

Signed-off-by: Tomasz Wilczyński <twilczynski@naver.com>
calmh pushed a commit that referenced this pull request Jan 20, 2024
…8923) (#9358)

gui: Remove non-functional HTML from External Versioning tooltip (ref
#8923)

Since [1], it is no longer possible to use HTML in tooltips. This was
addressed in [2], however the commit missed one instance of HTML that
was used to change the font type of the External versioning command
tooltip. This remaining HTML is removed in this commit.

[1] f5e5af3
[2] 73c52ea

Signed-off-by: Tomasz Wilczyński <twilczynski@naver.com>

### Screenshots


![image](https://github.com/syncthing/syncthing/assets/5626656/d5f6c553-35cb-48c2-b654-809d8bbe93b8)

Signed-off-by: Tomasz Wilczyński <twilczynski@naver.com>
calmh added a commit to calmh/syncthing that referenced this pull request Feb 2, 2024
* main:
  lib/model: Typo in method name (fixes syncthing#9389)
  lib/model: Typo in debug print (fixes syncthing#9386)
  build: Update dependencies (syncthing#9379)
  build(deps): bump actions/cache from 3 to 4 (syncthing#9363)
  lib/api: Improve folder summary event, verbose service (syncthing#9370)
  lib/protocol: Refactor interface (syncthing#9375)
  gui, man, authors: Update docs, translations, and contributors
  lib/fs: Add invalid UTF-8 guards to watcher (fixes syncthing#9369) (syncthing#9372)
  lib/api: Remove remnants of CSRF tokens file mentions (ref syncthing#9284)
  gui, man, authors: Update docs, translations, and contributors
  gui: Remove non-functional HTML from External Versioning tooltip (ref syncthing#8923) (syncthing#9358)
  cmd/ursrv: Add FreeBSD detection  (syncthing#9351)
  cmd/ursrv: Fix Arch detection (syncthing#9350)
  lib/ignore: Optimise ignoring directories for filesystem watcher (fixes syncthing#9339) (syncthing#9340)
  gui, man, authors: Update docs, translations, and contributors
  lib/ignore: Refactor out result type (syncthing#9343)
@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 Jun 4, 2024
@syncthing syncthing locked and limited conversation to collaborators Jun 4, 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.

5 participants