refactor: migrate small chat SFCs to TypeScript

What does this MR do?

Migration step 10b (targets main — its former parent, the ToolInfo-closure MR, has merged): the user feedback pair and four small chat SFCs, with their specs and stories — 20 files.

File Notes
user_feedback/types.ts new — UserFeedback, the payload emitted to the host on submit
user_feedback_modal.vue + spec explicit data(): FeedbackModalData return type (load-bearing for defineComponent inference in a component whose methods touch $refs, documented inline); typed computeds bridge the object-form inject; the vestigial actions custom option is dropped — nothing read $options.actions (the template already used a typed computed), so runtime is unchanged
user_feedback.vue + spec + story the inline template $refs call moves into a typed method with the identical guard; one stale non-prop fixture key (eventName) dropped from the spec — Vue ignored it at runtime
alternative_pager.vue (+ index barrel) + spec + story module-scope i18n exposed through a typed computed — template expressions cannot carry TS-only syntax (vue-template-compiler crashes at runtime even when vue-tsc accepts it)
duo_chat_predefined_prompts, message_action_bar + specs/story mechanical defineComponent + PropType ports
duo_chat_message_sources + spec + story sources prop is the shared MessageSource[]; template reads match that shape exactly
types/vendor.d.ts the @gitlab/ui shim now enumerates its exports (VueConstructor components, DirectiveOptions directives, the GlToast plugin) instead of a blanket any
.eslintrc.js .vue override: core no-unused-vars off in favor of the @typescript-eslint variant (same type-signature false positive as the .ts override)

The "vue-tsc $refs defect" — diagnosed and resolved

The first commit deferred the user_feedback pair citing a toolchain defect. The second commit probe-isolates it to a reproducible triad — an any-typed entry in components: plus data() plus a method touching this.$refs collapses defineComponent's methods generic — and resolves it with three composable, behavior-preserving patterns, all in this MR: enumerate the @gitlab/ui shim exports (removes the any poison at its source), declare an explicit data() return type on components that touch $refs, and never put an actions key on component options. This unblocks every remaining $refs-using component in the stack (message_base, markdown_renderer, pre_block, duo_chat_loader, details_modal, duo_chat, agentic_duo_chat) without refactor MRs.

Patterns established here and reused downstream: typed computeds bridge object-form inject (Vue 2.7's types do not surface it); the typed-vm spec pattern Wrapper<InstanceType<typeof C> & Vue> for specs that stub instance methods; template $refs expressions move into typed methods.

Rebase note

Rebased onto main after the agentic-leaves MR merged. The interim types/vue-custom-options.d.ts (a ComponentCustomOptions augmentation) was removed: it made $options.i18n optional and broke type-check for the merged agentic components, and it was never load-bearing — Vue 2.7's ComponentOptionsBase already carries an index signature for unregistered custom options, and defineComponent inference is intact without the file (probe-verified).

Verification

All eight oracle steps green locally on the rebased tip: type-check, eslint, prettier, test:unit (vue2), test:unit-vue3, build, storybook:build:test, and the translations collector output is unchanged for every migrated file.

🤖 Generated with Claude Code

Edited by Rafa Frederico

Merge request reports

Loading
Loading