feat(builder): advertise the format-token autocomplete#1561
Conversation
Deploying quickadd with
|
| Latest commit: |
5dc16fe
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://91e8d695.quickadd.pages.dev |
| Branch Preview URL: | https://chhoumann-1542-advertise-tok.quickadd.pages.dev |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
f74ae6c to
16153ee
Compare
37c4629 to
f9f28b4
Compare
16153ee to
6e98a51
Compare
f9f28b4 to
54bee88
Compare
a159c3e to
f98929b
Compare
Closes #1542. Typing `{{` in a format field opens a list of every token, each with a one-line description (shipped in #1549). Nothing in the UI said so - the reporter only found it by typing `{{` on a hunch while looking for the syntax. Ask 1 of #1542 was deliberately left open because its two natural homes belonged to #1541 (docs links in the UI) and #1544 (a worked-example placeholder); both have shipped, and #1541 explicitly left "docs links inside the builders" here. The affordance is two characters, so the honest fix is to name the two characters, right below the caret: Type {{ to insert a token · Format syntax "Format syntax" is the docs entry point #1541 deferred: the token language is the one part of the builder you cannot work out by looking at it. The hint hides once the value contains `{{`. It has done its job, and a line that never goes away is the permanent chrome an "Insert token" button was rejected for. On three of the five token-autocomplete fields: Capture format, File name format, and Capture to - the only one a brand-new Capture builder renders, since the other two sit behind default-off toggles. Deliberately NOT on insert-after / insert-before: their own descriptions tell you to type a literal heading like `## Tasks`, so a token-less value is the documented normal state there and the hint would nag forever. Also considered and rejected: - Triggering the popup on a single `{`, which would make `{` + Enter insert a token instead of a newline in a capture format holding JSON or code. - Opening the list on focus: fires on every builder open, and races the file suggester on "Capture to". - Persisting a `hasUsedTokenAutocomplete` setting. Settings mutations rewrite the whole data.json, so the suggester would write to disk on a keystroke; no Svelte component subscribes to the store, so it would not be reactive; settings are per-vault, so "user lifetime" is false; and one stray `{{` would delete the affordance vault-wide with no way back. - Teaching via the placeholder alone: it vanishes on the first keystroke and on every existing choice, and cannot carry the docs link.
f98929b to
5dc16fe
Compare
|
Superseded by #1570. GitHub closed this permanently when #1560 merged and its base branch was deleted — a closed PR's base cannot be changed and it cannot be reopened, so the rebased work moved to a fresh PR against Same single commit, cherry-picked onto |
Closes #1542. Stacked on #1560 — review that first; this branch adds one commit.
The problem
Typing
{{in a format field opens a list of every token, each with a one-linedescription (that part shipped in #1549). Nothing in the UI said so. The reporter
found it by typing
{{on a hunch while looking for the syntax; a new user hasno reason to try that, and no other in-app way to learn which tokens exist.
Ask 1 was deliberately left out of #1549 because its two natural homes belonged
to siblings from the same walkthrough: #1541 (docs links in the UI) and #1544 (a
worked-example placeholder). Both have now shipped, and #1541 explicitly left
"docs links inside the builders" to this issue. So this closes #1542.
The change
The affordance is two characters, so the honest fix is to name the two
characters, right below the caret:
"Format syntax" is the docs entry point #1541 deferred here: the token language
is the one part of the builder you cannot work out by looking at it.
Decisions worth arguing with
It hides once the value contains
{{. The hint has done its job, and a linethat never goes away is exactly the permanent chrome an "Insert token" button
was rejected for in the issue thread. Stateless — no setting, no migration.
Three of the five token fields, not all five. Capture format, File name
format, and Capture to — the last being the only format field a brand-new
Capture builder renders, since the other two sit behind default-off toggles.
Deliberately not on insert-after / insert-before: their own descriptions tell
you to type a literal heading like
## Tasks, so a token-less value is thedocumented normal state there and the hint would nag forever. Not on the template
path field either — it has no token autocomplete at all.
Not a persisted "you've seen this" flag. It was the obvious alternative and
it is worse in four ways:
settingsStoremutations rewrite the wholedata.json, so the suggester would write to disk on a keystroke; no Sveltecomponent subscribes to the store, so the flag would not be reactive and the
hint would linger until the builder was reopened; settings are per-vault, so
"user lifetime" is false; and one stray
{{would delete the affordancevault-wide with no way to bring it back.
Not the placeholder alone. It vanishes on the first keystroke and on every
existing choice, and cannot carry the docs link. #1544 already shipped that
pattern on "Capture to" without closing this ask.
Not
{as the trigger, and not open-on-focus. Both were rejected in theissue thread:
{+ Enter would insert a token instead of a newline in a captureformat holding JSON or code, and open-on-focus fires on every builder open and
races the file suggester on "Capture to".
Validation
pnpm run build,pnpm lint, full suite: 4042 passed, 0 failed.rel/target, hide-on-{{,show-again-when-tokens-removed).
both link to the live docs URL, and the hint disappears the moment a token is
typed.