Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/runtime/components/CommandPalette.vue
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ function onSelect(e: Event, item: T) {
:loading="loading"
:loading-icon="loadingIcon"
:trailing-icon="trailingIcon"
:icon="icon || appConfig.ui.icons.search"
:icon="icon ?? appConfig.ui.icons.search"
data-slot="input"
:class="ui.input({ class: uiProp?.input })"
@keydown.backspace="onBackspace"
Expand Down
11 changes: 8 additions & 3 deletions src/runtime/components/DashboardSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import type { VNode } from 'vue'
import type { AppConfig } from '@nuxt/schema'
import theme from '#build/ui/dashboard-search'
import type { ButtonProps, ModalProps, CommandPaletteProps, CommandPaletteSlots, CommandPaletteGroup, CommandPaletteItem, LinkPropsKeys } from '../types'
import type { ButtonProps, ModalProps, CommandPaletteProps, CommandPaletteSlots, CommandPaletteGroup, CommandPaletteItem, LinkPropsKeys, InputProps } from '../types'
import type { ComponentConfig } from '../types/tv'

type DashboardSearch = ComponentConfig<typeof theme, AppConfig, 'dashboardSearch'>
Expand Down Expand Up @@ -39,6 +39,11 @@ export interface DashboardSearchProps<T extends CommandPaletteItem = CommandPale
colorMode?: boolean
class?: any
ui?: DashboardSearch['slots'] & CommandPaletteProps<CommandPaletteGroup<CommandPaletteItem>, CommandPaletteItem>['ui']
/**
* Configure the input or hide it with `false`.
* @defaultValue true
*/
input?: boolean | Omit<InputProps, 'modelValue' | 'defaultValue'>
Comment on lines +42 to +46
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟑 Minor

JSDoc @defaultValue is inconsistent with actual default.

The JSDoc states @defaultValue true, but when input is not provided, line 213 defaults to { fixed: true } rather than true. Consider updating the documentation to reflect the actual default behavior:

πŸ“ Suggested documentation fix
   /**
    * Configure the input or hide it with `false`.
-   * `@defaultValue` true
+   * `@defaultValue` { fixed: true }
    */
   input?: boolean | Omit<InputProps, 'modelValue' | 'defaultValue'>
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/**
* Configure the input or hide it with `false`.
* @defaultValue true
*/
input?: boolean | Omit<InputProps, 'modelValue' | 'defaultValue'>
/**
* Configure the input or hide it with `false`.
* `@defaultValue` { fixed: true }
*/
input?: boolean | Omit<InputProps, 'modelValue' | 'defaultValue'>
πŸ€– Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/runtime/components/DashboardSearch.vue` around lines 72 - 76, The JSDoc
for the DashboardSearch.vue prop "input" incorrectly states "@defaultValue true"
while the actual fallback when not provided is the object { fixed: true };
update the JSDoc for the "input" prop to reflect the real default (e.g.,
"@defaultValue { fixed: true }" or a brief description like "defaults to an
object { fixed: true }") so the documentation matches the behavior of the prop.

}

export type DashboardSearchSlots = CommandPaletteSlots<CommandPaletteItem> & {
Expand Down Expand Up @@ -82,7 +87,7 @@ const colorMode = useColorMode()
const appConfig = useAppConfig() as DashboardSearch['AppConfig']
const uiProp = useComponentUI('dashboardSearch', props)

const commandPaletteProps = useForwardProps(reactivePick(props, 'size', 'icon', 'placeholder', 'autofocus', 'loading', 'loadingIcon', 'close', 'closeIcon', 'searchDelay'))
const commandPaletteProps = useForwardProps(reactivePick(props, 'size', 'icon', 'placeholder', 'autofocus', 'loading', 'loadingIcon', 'close', 'closeIcon', 'searchDelay', 'input'))
const modalProps = useForwardProps(reactivePick(props, 'overlay', 'transition', 'content', 'dismissible', 'fullscreen', 'modal', 'portal'))

const getProxySlots = () => omit(slots, ['content'])
Expand Down Expand Up @@ -176,7 +181,7 @@ defineExpose({
v-bind="commandPaletteProps"
:groups="groups"
:fuse="fuse"
:input="{ fixed: true }"
:input="commandPaletteProps.input ?? { fixed: true }"
:ui="transformUI(omit(ui, ['modal']), uiProp)"
@update:model-value="onSelect"
@update:open="open = $event"
Expand Down
Loading