posit-dev / publisher

MIT License
5 stars 0 forks source link

Use `indeterminate` state in Project Files with new API attributes #2219

Open mmarchetti opened 2 months ago

mmarchetti commented 2 months ago

2163 gave us new attributes to do indeterminate states in the Project Files tree view. This will greatly improve readability for directories in that view.

dotNomad commented 2 months ago

Question I ran into while working on this:

If I have explicitly included a directory (like /.posit in the below example) should it show as indeterminate if there are built in exclusions?

Image

(The descriptions are included for debugging purposes)

mmarchetti commented 2 months ago

Interesting question. On the one hand, it's super-accurate. On the other hand, it's frustrating to click it off and back on to get "everything" and it still doesn't get the checkmark.

dotNomad commented 2 months ago

On the one hand, it's super-accurate. On the other hand, it's frustrating to click it off and back on to get "everything" and it still doesn't get the checkmark.

It feels like this wouldn't be super common, but I did run into it with .DS_Store so maybe I'm underestimating it here. The frustration was definitely felt. I thought I wrote a bug initially.

dotNomad commented 2 months ago

Another question for this work - if a directory is included, but none of its children are how should we show that?

For example: CleanShot 2024-08-30 at 12 13 35@2x

Here files includes * to have all files, but has an exclusion for !/_extensions/jmbuhr. So _extensions is included as a directory, but none of its children are.

sagerb commented 1 month ago

If we update the tooltip descriptions to include these contextual details (of why the node is indeterminate), then we can limit this more to a visual concern.

I wondered if we needed to use additional icons to represent each one of these possibilities. I wasn't able to find exactly what I was looking for from the readily available icons, so we might need to consider drawing them ourselves or bringing in another source.

I toyed with the idea of doing something like this, but I have come to realize that the check-all icon I was referencing doesn't come in a box to match the checkbox functionality. :-(

Original idea:

  • check-all for when a subdirectory wasn't indeterminate
  • check for when only the subdirectory is included, but no files/dirs underneath
  • diff-renamed or diff-ignored for when the state is truly indeterminate (I'm not a fan of the indeterminate icon selected (as shown in the comment above). The filled-in box feels too heavy to me.) 2024-09-04 at 9 26 AM 2024-09-04 at 9 20 AM

Icon source: https://code.visualstudio.com/api/references/icons-in-labels