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

feat: Add "Query File Defaults" facility #3300

Merged
merged 98 commits into from
Feb 4, 2025
Merged

Conversation

claremacrae
Copy link
Collaborator

@claremacrae claremacrae commented Feb 4, 2025

Types of changes

Changes visible to users:

Internal changes:

  • Tests (prefix: test - additions and improvements to unit tests and the smoke tests)

Description

Introduce a new facility which I have named Query File Defaults.

This defines a set of properties that users can define in a query file to control the behaviour of all Tasks searches in that file:

---
tasks_query_explain:
tasks_query_short_mode:
tasks_query_show_tree:
tasks_query_show_tags:
tasks_query_show_id:
tasks_query_show_depends_on:
tasks_query_show_priority:
tasks_query_show_recurrence_rule:
tasks_query_show_on_completion:
tasks_query_show_created_date:
tasks_query_show_start_date:
tasks_query_show_scheduled_date:
tasks_query_show_due_date:
tasks_query_show_cancelled_date:
tasks_query_show_done_date:
tasks_query_show_urgency:
tasks_query_show_backlink:
tasks_query_show_edit_button:
tasks_query_show_postpone_button:
tasks_query_show_task_count:
tasks_query_extra_instructions:
---

Document two ways to edit these properties:

  • Obsidian's File Properties
  • Meta Bind plugin widgets

Other changes:

  • Add a snippet widen-property-labels.css to make longer property names readable in the Properties view

Motivation and Context

I started off by documenting how users could define these variables themselves, and use filter by function, but those user queries were going to be so complex and repetitive - to document and to use - that I opted for building-in the facility from the outset.

How has this been tested?

  • Automated tests
  • Exploratory testing

Screenshots (if appropriate)

image

Image caption: Using Obsidian's File Properties to edit "Query File Defaults"

image

Image caption: Using the Meta Bind plugin's widgets to edit "Query File Defaults"

Checklist

Terms

…perty names

This makes the names be double-clickable to select the whole property name,
which is really nice in Source mode.
I am about to add a lot more cases, and this will be easier to maintain.
This is in preparation for adding another version, for use as a snippet.
So it can be easily added to a callout
@claremacrae claremacrae added scope: filters Additions and modifications to the search filters scope: frontmatter Anything to do with YAML frontmatter, also known as Obsidian properties labels Feb 4, 2025
Copy link

sonarqubecloud bot commented Feb 4, 2025

@claremacrae claremacrae merged commit 4cfca48 into main Feb 4, 2025
4 checks passed
@claremacrae claremacrae deleted the query-file-defaults branch February 4, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: filters Additions and modifications to the search filters scope: frontmatter Anything to do with YAML frontmatter, also known as Obsidian properties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant