Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support of heterogeneous data types in a given property/column. #315

Open
m-beau opened this issue Jan 4, 2023 · 5 comments
Open

Support of heterogeneous data types in a given property/column. #315

m-beau opened this issue Jan 4, 2023 · 5 comments
Labels
kind/feature New feature request lifecycle/backlog Issues that are ready to be worked on. triage/confirmed Issue is well-defined and understood. Needs to have a priority/* label.

Comments

@m-beau
Copy link

m-beau commented Jan 4, 2023

What would you like to be added?

  1. In particular, being able to make internal links or images be respectively clickable and visible in Text columns (it works with dataview tables!)

  2. Related but not similar: manually enforce the data type of a given column. For instance, enforcing the conversion of a Links column in a Text column (similarly to what can be done in Notion or even obsidian-database-plugin).

Why is this needed?

Sometimes, a given property can have several data types. For instance, a mixture of internal links, images and text. Currently, when this happens, the column data type falls back to 'Text' and the links become unclickable and the images invisible.

@m-beau m-beau added kind/feature New feature request needs-triage Issue needs a triage/* label labels Jan 4, 2023
@marcusolsson
Copy link
Owner

Both of your suggestions are definitely coming! To be honest, I'm not super happy with the Link field type at the moment.

Since it's two different features however, would you mind extracting one of them into its own issue so that we can track them separately?

@marcusolsson marcusolsson added triage/confirmed Issue is well-defined and understood. Needs to have a priority/* label. lifecycle/backlog Issues that are ready to be worked on. and removed needs-triage Issue needs a triage/* label labels Jan 4, 2023
@m-beau
Copy link
Author

m-beau commented Jan 5, 2023

Done!

I am not sure of what the best implementation might be, but maybe something like the following:

  • If various data types are detected in a given column, and by default in general, fallback to 'miscellaneous' (with its own icon, e.g. one denoting binary data in general, 0s and 1s). Miscellaneous would support, text, links, images, dates, tags.
  • If all the fields are filled with strings, set the column data type to 'text'
  • If all the fields with links, to 'link'
  • same for dates, images etc
    Expliciting the data type of the column as above would allow the user to manually enforce either. For instance, one might want to make links non-clickable for aesthetic reasons and enforce the field 'text'. Or one might want to auto-extract dates from strings such as '2022-10-02' by switching from text to date (this requires fancy date formatting in the background).

OR

Always support diverse data types in the background, and rather name the data type of columns purely based on their meta-type (multi-select, single-select, formula...), not caring at all whether the elements returned by these meta types are strings, images, links, tags... And the 'status' field of the board views would require the column meta-type to be 'single select', very much like Notion.

@scottbolte
Copy link

Rather than create a new feature request, I have two use cases for this one:

  1. If the property's value is an internal link please make it clickable. For example, in the frontmatter I have parent: "[[Obsidian MOC]]". In each project view (e.g., Table, Board) I currently see the simple text "[[Obsidian MOC]]". Even if the enclosing square brackets are still shown for clarity, or perhaps to allow direct editing, having the contents to be a clickable link would be very handy.

  2. A variation on use case 1 is when the frontmatter property is actually a list of links. I use depends on: [...] and then refer to other project tasks ala [[Project A]] and [[Project B]]. Would be nice if in a project views each note's presentation of depends on could have multiple links, each clickable and each on their own line.

@Acylation
Copy link
Collaborator

Hi @scottbolte , for these cases you mentioned, you can try richText formatting. This can be found in Table view column drop-down. Once enabled for text/list fields, the internal links should be recognized and parsed to be clickable. Feel free to ask if there are something still unclear.

@scottbolte
Copy link

Thank you @Acylation, richText formatting is the feature I did not know I needed!

Enabling richText works great for singular values in the Table, Gallery and Board views. It also works for a list of links, but only in the Table view. In the other views the links still retain the [[...]], are not clickable, and are shown in red (see below). Unless I'm missing something, that's a bug. Do you want me to open a bug report?

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature request lifecycle/backlog Issues that are ready to be worked on. triage/confirmed Issue is well-defined and understood. Needs to have a priority/* label.
Projects
None yet
Development

No branches or pull requests

4 participants