mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7707] [MERGED] feat(client): autocomplete macros in macro fields #7890
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7890
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7707
Author: @ylli-selmani
Created: 10/15/2026
Status: ✅ Merged
Merged: 10/16/2026
Merged by: @ylli-selmani
Base:
staging← Head:feat/macro-field-autosuggest-66c36p📝 Commits (7)
a340c04feat(client): grey in macro names in macro fields7277027feat(client): tap the macro suggestion to accept it535ef6dfeat(client): tap the omnibar and Prof. Mari suggestions to accept themfc15270fix(client): tighten macro ghost tap and sizing115ccb0fix(client): address CodeRabbit review on macro completion5f6c893Merge remote-tracking branch 'origin/staging' into feat/macro-field-autosuggest-66c36p7d01126fix(client): keep the expanded editor's focus effect keyed on open only📊 Changes
8 files changed (+420 additions, -22 deletions)
View changed files
📝
packages/client/src/components/chat/mari/MariComposer.tsx(+2 -0)📝
packages/client/src/components/layout/GlobalOmnibar.tsx(+1 -0)📝
packages/client/src/components/ui/InlineGhostText.tsx(+31 -2)➕
packages/client/src/components/ui/MacroCompletionGhost.tsx(+188 -0)📝
packages/client/src/components/ui/MacroTextarea.tsx(+80 -20)➕
packages/client/src/lib/macro-completion.ts(+67 -0)📝
packages/client/src/lib/textarea-editing.ts(+13 -0)➕
scripts/regressions/macro-completion.regression.ts(+38 -0)📄 Description
Linked issue
Closes #7706
Closes #7709
Why this change
Before: in prompt fields you had to type macro names from memory or open the macro reference. On a phone, the omnibar's grey completion couldn't be accepted at all, because phone keyboards have no Tab key.
After: in every field with the macro reference button, typing
{{chgreys inar}}. Tab accepts it, and so does tapping the grey text. Tapping works in the omnibar and the Professor Mari composer too.What changed
lib/macro-completion.ts: builds the candidates fromSUPPORTED_MACROS, so new macros complete with no extra work. Plain macros close themselves (char}}), macros with arguments stop at the separator (getvar::,roll:), block openers stop after the keyword (#if). Placeholders like{{NAME}}and card IDs are skipped.MacroCompletionGhost.tsx: a small hook plus overlay that reusesInlineGhostText. It copies the textarea's computed font and padding, so it lines up in every caller without repeating their classes.MacroTextarea(inline field and expanded editor) wires it in when the macro reference button is shown and the field is editable. Tab accepts through the same native-undo insert as Tab indenting. With no suggestion, Tab indents as before.InlineGhostTexttakes an optionalonAccept. The suffix accepts on pointer down without taking focus from the field. On touch screens (pointer-coarse) it gets a faint chip so it reads as tappable. The macro fields, the omnibar and the Mari composer all pass it.InlineGhostTextalso takes an optionalstyle.macro-completion.regression.ts.Validation
pnpm checkpasses locallyCONTRIBUTING.mdRan: client lint +
tsc,pnpm localization:check,pnpm impeccable:check, and the new regression.Manual verification notes
{{us, ander}}showed in grey at the caret. Tab gave{{user}}, the field kept focus, and{{chthen suggestedar}}.{{user}}, and the field kept focus and stayed in the same place.alb, then tapped the ghostedo. The query becamealbedoand the search box kept focus.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)UI evidence (if applicable)
Screenshots to be added.
🤖 Generated with Claude Code
Summary by CodeRabbit
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.