feat(ProsePrompt): new component#6362
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughAdds a new Prose "Prompt" component (src/runtime/components/prose/Prompt.vue) with typed props (description, icon, actions, class, ui), slot support, clipboard copy and deep-link actions (cursor:// and windsurf://). Registers the component in the module mapping (src/module.ts), adds theme support (src/theme/prose/prompt.ts, exported via src/theme/prose/index.ts), and re-exports the component types (src/runtime/types/prose.ts). Introduces new documentation (prompt page and expanded callout examples), a minor callout icon spacing tweak, and adds Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (4)
src/runtime/locale/en.ts (1)
123-127: Nit:chatReasoningordering inconsistent with other locales.In other locale files (e.g.,
vi.ts,hi.ts,bg.ts),chatReasoningis grouped with the otherchat*entries near the top. Here it sits afterprose. No functional impact — just a consistency nit for future maintenance.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/runtime/locale/en.ts` around lines 123 - 127, Move the chatReasoning block so it sits with the other chat* entries near the top of the locale file (instead of after prose) to match the ordering used in vi.ts, hi.ts, and bg.ts; locate the chatReasoning identifier and relocate its object (thinking, thought, thoughtFor) into the same group as chatPrompt, chatPlaceholder, chatEmpty, etc., preserving keys and values for consistency.src/runtime/locale/uz.ts (1)
123-126: LGTM!Uzbek translations for the new
prose.promptkeys look correct.Nit (optional): In Uzbek, the locative suffix
-dais typically attached directly to the noun (e.g.,{name}da ochish) rather than separated by a space. Since{name}is a dynamic token (e.g., "Cursor"/"Windsurf"), either form is acceptable — feel free to disregard.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/runtime/locale/uz.ts` around lines 123 - 126, The translation for prompt.openIn currently uses a space before the locative suffix ("{name} da ochish"); update the string in src/runtime/locale/uz.ts by removing the space so the dynamic token and suffix are attached ("{name}da ochish") to match Uzbek locative usage—locate the prompt object (prompt.openIn) and change its value accordingly.src/runtime/locale/pt.ts (1)
123-126: Minor: consider preposition contraction foropenIn.In Portuguese, IDE names are often used with the contracted article (e.g., "Abrir no Cursor" works, but "Abrir no Windsurf" is fine too). Since
{name}is interpolated and the gender/article varies per IDE, the current'Abrir no {name}'may read awkwardly for some names. A neutral alternative is'Abrir em {name}', which avoids article/gender mismatches across different IDE names.Optional fix
prompt: { copy: 'Copiar prompt', - openIn: 'Abrir no {name}' + openIn: 'Abrir em {name}' }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/runtime/locale/pt.ts` around lines 123 - 126, The Portuguese locale string prompt.openIn currently uses "Abrir no {name}", which can produce awkward gender/article matches for different IDE names; update the value of prompt.openIn in src runtime locale (the prompt object) to a neutral form such as "Abrir em {name}" so the interpolated {name} reads correctly across IDEs.src/runtime/components/prose/Prompt.vue (1)
10-19: Align@defaultValuedocumentation format.
@defaultValue '["copy"]'with outer single quotes is inconsistent with other components (e.g., ContentSearchButton.vue uses@defaultValue ['meta', 'k']). Remove the outer quotes to match the pattern used throughout the codebase.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/runtime/components/prose/Prompt.vue` around lines 10 - 19, The JSDoc for the actions prop in the ProsePromptProps interface uses inconsistent quoting: change the annotation on the actions property from `@defaultValue` '["copy"]' to `@defaultValue` ['copy'] so it matches the project's JSDoc style (edit the comment above the actions field in the ProsePromptProps declaration).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/runtime/components/prose/Prompt.vue`:
- Around line 61-73: The deep-link handlers openInCursor and openInWindsurf
currently call window.open with custom-protocol URLs and can silently fail if
the protocol isn't registered; modify these functions to perform the open
attempt but also detect failure and show a user-visible fallback (toast/modal)
and/or documentation link: invoke the URL (via location.href or a clicked
anchor) then start a short timeout (e.g., 1–2s) that is cleared if the page
unloads or document.visibilityState changes, and if the timeout fires show a
toast explaining "Cursor/Windsurf not installed" with next steps; also add a
brief note in the UI/docs about the prerequisite and ensure getPromptText() is
still used to populate the URL.
- Around line 76-115: Add missing data-slot attributes to the template elements
in Prompt.vue: add data-slot="root" on the root <div> (the one using ui.root),
data-slot="icon" on the <UIcon> element, data-slot="content" on the <div> using
ui.content, data-slot="description" on the <p> that shows description, and
data-slot="actions" on the <div> using ui.actions; keep existing bindings and
props (ui.root/ui.icon/ui.content/ui.actions, icon, description, actions, and
methods copyPrompt/openInCursor/openInWindsurf) unchanged, only insert the
corresponding data-slot="..." attributes.
In `@src/runtime/locale/eu.ts`:
- Around line 123-126: The string for prompt.copy in the locale object is likely
a mistranslation (it reads like "copy the invitation"); update the value of
prompt.copy in eu.ts to a more accurate Basque term for an AI/LLM prompt such as
"Kopiatu galdera" or "Kopiatu agindua" (or keep "Kopiatu prompt" if you prefer
the loanword), leaving prompt.openIn unchanged; locate the prompt object and
replace the copy property value accordingly.
In `@src/runtime/locale/hy.ts`:
- Around line 123-126: Replace the corrupted Armenian string assigned to the
prompt.copy key in hy.ts (the prompt object) with a proper Armenian translation
for the "copy" label; remove the English "delays delaysdelays" fragment, ensure
the new value is valid UTF-8 Armenian text, and confirm the exact wording with a
native speaker before committing.
---
Nitpick comments:
In `@src/runtime/components/prose/Prompt.vue`:
- Around line 10-19: The JSDoc for the actions prop in the ProsePromptProps
interface uses inconsistent quoting: change the annotation on the actions
property from `@defaultValue` '["copy"]' to `@defaultValue` ['copy'] so it matches
the project's JSDoc style (edit the comment above the actions field in the
ProsePromptProps declaration).
In `@src/runtime/locale/en.ts`:
- Around line 123-127: Move the chatReasoning block so it sits with the other
chat* entries near the top of the locale file (instead of after prose) to match
the ordering used in vi.ts, hi.ts, and bg.ts; locate the chatReasoning
identifier and relocate its object (thinking, thought, thoughtFor) into the same
group as chatPrompt, chatPlaceholder, chatEmpty, etc., preserving keys and
values for consistency.
In `@src/runtime/locale/pt.ts`:
- Around line 123-126: The Portuguese locale string prompt.openIn currently uses
"Abrir no {name}", which can produce awkward gender/article matches for
different IDE names; update the value of prompt.openIn in src runtime locale
(the prompt object) to a neutral form such as "Abrir em {name}" so the
interpolated {name} reads correctly across IDEs.
In `@src/runtime/locale/uz.ts`:
- Around line 123-126: The translation for prompt.openIn currently uses a space
before the locative suffix ("{name} da ochish"); update the string in
src/runtime/locale/uz.ts by removing the space so the dynamic token and suffix
are attached ("{name}da ochish") to match Uzbek locative usage—locate the prompt
object (prompt.openIn) and change its value accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9ca8885c-dae4-45dc-baa1-6376a99cdef7
📒 Files selected for processing (69)
docs/content/docs/4.typography/callout.mddocs/content/docs/4.typography/prompt.mdsrc/module.tssrc/runtime/components/prose/Prompt.vuesrc/runtime/locale/ar.tssrc/runtime/locale/az.tssrc/runtime/locale/be.tssrc/runtime/locale/bg.tssrc/runtime/locale/bn.tssrc/runtime/locale/ca.tssrc/runtime/locale/ckb.tssrc/runtime/locale/cs.tssrc/runtime/locale/da.tssrc/runtime/locale/de.tssrc/runtime/locale/de_ch.tssrc/runtime/locale/el.tssrc/runtime/locale/en.tssrc/runtime/locale/es.tssrc/runtime/locale/et.tssrc/runtime/locale/eu.tssrc/runtime/locale/fa_ir.tssrc/runtime/locale/fi.tssrc/runtime/locale/fr.tssrc/runtime/locale/gl.tssrc/runtime/locale/he.tssrc/runtime/locale/hi.tssrc/runtime/locale/hr.tssrc/runtime/locale/hu.tssrc/runtime/locale/hy.tssrc/runtime/locale/id.tssrc/runtime/locale/is.tssrc/runtime/locale/it.tssrc/runtime/locale/ja.tssrc/runtime/locale/ka.tssrc/runtime/locale/kk.tssrc/runtime/locale/km.tssrc/runtime/locale/ko.tssrc/runtime/locale/ky.tssrc/runtime/locale/lb.tssrc/runtime/locale/lo.tssrc/runtime/locale/lt.tssrc/runtime/locale/mn.tssrc/runtime/locale/ms.tssrc/runtime/locale/nb_no.tssrc/runtime/locale/nl.tssrc/runtime/locale/pl.tssrc/runtime/locale/pt.tssrc/runtime/locale/pt_br.tssrc/runtime/locale/ro.tssrc/runtime/locale/ru.tssrc/runtime/locale/sk.tssrc/runtime/locale/sl.tssrc/runtime/locale/sq.tssrc/runtime/locale/sv.tssrc/runtime/locale/th.tssrc/runtime/locale/tj.tssrc/runtime/locale/tr.tssrc/runtime/locale/ug_cn.tssrc/runtime/locale/uk.tssrc/runtime/locale/ur.tssrc/runtime/locale/uz.tssrc/runtime/locale/vi.tssrc/runtime/locale/zh_cn.tssrc/runtime/locale/zh_tw.tssrc/runtime/types/locale.tssrc/runtime/types/prose.tssrc/theme/prose/callout.tssrc/theme/prose/index.tssrc/theme/prose/prompt.ts
commit: |
🔗 Linked issue
❓ Type of change
📚 Description
📝 Checklist