Skip to content

Creates the ability to dynamically query tasks based on a selected note. Selectable notes come from configuration of front matter property and value - #4

Merged
ichris007 merged 2 commits into
ichris007:mainfrom
wernsting:feat-query.file
Sep 29, 2026

Conversation

@wernsting

Copy link
Copy Markdown
Contributor

feat: selectable note for task queries with query.file use.
add configurable task limit

@wernsting

Copy link
Copy Markdown
Contributor Author

My idea built out, works exactly how I'd like it to work and links into GTD methodology: #2 (comment)

@ichris007 ichris007 closed this Sep 28, 2026
@ichris007 ichris007 reopened this Sep 28, 2026
@ichris007
ichris007 self-requested a review September 28, 2026 09:37
@ichris007

Copy link
Copy Markdown
Owner

Thanks a lot for the work on this — the feature idea (per-group note selector feeding
query.file) is a good fit for the plugin and the implementation is well scoped.
CI is now running on this PR and it reports one real failure plus a few packaging issues.
None of them affect the feature itself; they should all be quick to fix.

1. CI failure: type check

The Build & Lint job fails at the Type check step:

src/view.ts:373:3 - error TS2322: Type 'string | undefined' is not assignable to type 'string'.
  Type 'undefined' is not assignable to type 'string'.

373   select.value = selectedPath;
      ~~~~~~~~~~~~

selectedGroupNotePaths is typed Record<string, string> and this repo has
"noUncheckedIndexedAccess": true in tsconfig.json, so an indexed read is
string | undefined. A one-line fix:

-		let selectedPath = this.selectedGroupNotePaths[this.activeGroup];
+		let selectedPath = this.selectedGroupNotePaths[this.activeGroup] ?? '';

Please also run the build locally with the real compiler before pushing — see the next point.

2. Please remove the tsc dependency

  "dependencies": {
-   "sortablejs": "^1.15.7",
+   "sortablejs": "^1.15.7"
-   "tsc": "^2.0.4"
  },

tsc@2.x on npm is an unrelated, unmaintained package ("A deprecated release of the
TypeScript compiler") that shadows the real TypeScript compiler. It is not used by this
project, and installing it actively breaks the local build — after npm ci,
node_modules/.bin/tsc points at the fake package, so:

$ npm run build
> tsc -noEmit -skipLibCheck && node esbuild.config.mjs production

                This is not the tsc command you are looking for
...

That command exits with code 1, so npm run build never reaches esbuild. This is almost
certainly why the type error above was not caught locally. Please remove it and re-run
npm ci.

(Side note: it also triggers a npm warn deprecated tsc@2.0.4 on every install.)

3. Please drop data.json

data.json is the plugin's runtime, per-user state — it contains my inbox path, my tab
and query configuration. It must never be committed. Please delete it from this PR and add
it to .gitignore. Thanks for adding a .gitignore; it would be good to extend it:

node_modules
data.json

4. Please drop the pnpm files

pnpm-lock.yaml (3159 lines), pnpm-workspace.yaml and the "allowScripts" block in
package.json are pnpm-specific. This repo uses npm (npm ci + package-lock.json), and
CI installs with npm ci. Two lockfiles will drift apart and make CI and local builds
disagree. Please remove all three.

5. Please revert the TypeScript bump

- "typescript": "^5.9.3",
+ "typescript": "^5.8.3",

Unrelated to this feature, and it invalidates the lockfile. If a bump is desirable, let's do
it in a separate PR.

6. Please update the branch onto current main

This branch is 5 commits behind main, and main has since picked up CI
(.github/workflows/ci.yml), scripts/check-i18n.mjs, CONTRIBUTING.md and the ESLint
config. A rebase (or updating the branch) will pick those up.

Notes / things that look good

  • Your i18n additions in src/i18n.ts are correctly symmetric — ZH and EN both complete.
    Thanks for that; it is easy to get wrong.
  • I rebuilt main.js from the current source with esbuild and it is byte-identical to
    the committed one, so the build artefact is in sync — no action needed there.
  • styles.css, src/view.ts and src/modals/board-config-modal.ts look reasonable on a
    first read; I'll do a proper pass once CI is green.

Once the above is addressed I'll re-review. Thanks again for the contribution!

@ichris007 ichris007 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Details are in my comment above. Please address items 1–6 and push an update —
CI will re-run automatically. Thanks!

@ichris007 ichris007 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Regarding the "note filter + limit" row added in this PR, I noticed an aesthetic issue: when a group has no frontmatter property configured, the note selector doesn't appear on the front end, but the limit input box is still shown there all by itself — it looks out of place and breaks the overall layout.

Two suggested fixes:

  1. Move the limit setting into the group configuration modal (leaving only the note selector in that front-end row);
  2. Only show the limit together with the note selector, i.e. only when the note selector appears.

I'd recommend option 1: a limit is essentially a group-level config, so it fits better in the group edit modal; whereas "which note to filter by" is a runtime, per-session selection and makes more sense on the front end — this keeps their responsibilities cleanly separated. Also, with option 1 the limit still applies to the whole group even when no note filter is configured, unlike option 2 which would also disable the "group-wide limit without a note filter" capability. Implementation-wise, the taskLimit field already exists in the data model, so this is mainly relocating the input from the front-end renderGroupNoteSelector() to GroupEditModal — a fairly small change.

Would you be open to going with option 1? Once it's done I'll verify it on my end.

@wernsting

Copy link
Copy Markdown
Contributor Author

I understand what you are saying and agree in principle, however my use case (and so for you to inform what you think) is expanding the returned results dynamically when I "feel" I'm missing tasks I expected to be returned and so in runtime works better.

You could leave it out all together too and make it a feature if you think it adds value to your plugin

@ichris007

Copy link
Copy Markdown
Owner

Thanks, merging — I'll refine the limit UI on top

@ichris007
ichris007 dismissed their stale review September 29, 2026 10:23

Resolved. Merging now and will refine the limit UI in a follow-up commit.

@ichris007
ichris007 merged commit 675ca71 into ichris007:main Sep 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants