mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-10-20 05:15:31 +00:00
fmt(js): npm run fix on merge (#72992)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
67e592b015
commit
c89d21189a
5 changed files with 57 additions and 10 deletions
|
|
@ -3,7 +3,13 @@ import { memo, useEffect, useRef, useState } from 'react'
|
|||
|
||||
import { WorktreeDialog } from '@/app/chat/sidebar/projects/worktree-dialog'
|
||||
import { StatusRow } from '@/components/chat/status-row'
|
||||
import { type ActionItemSpec, ActionsContextMenu, ActionsMenu, type MenuKit, renderActionItem } from '@/components/ui/actions-menu'
|
||||
import {
|
||||
type ActionItemSpec,
|
||||
ActionsContextMenu,
|
||||
ActionsMenu,
|
||||
type MenuKit,
|
||||
renderActionItem
|
||||
} from '@/components/ui/actions-menu'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Codicon } from '@/components/ui/codicon'
|
||||
import { DiffCount } from '@/components/ui/diff-count'
|
||||
|
|
|
|||
|
|
@ -2,7 +2,13 @@ import { useStore } from '@nanostores/react'
|
|||
import type * as React from 'react'
|
||||
import { useState } from 'react'
|
||||
|
||||
import { type ActionItemSpec, ActionsContextMenu, DROPDOWN_KIT, type MenuKit, renderActionItem } from '@/components/ui/actions-menu'
|
||||
import {
|
||||
type ActionItemSpec,
|
||||
ActionsContextMenu,
|
||||
DROPDOWN_KIT,
|
||||
type MenuKit,
|
||||
renderActionItem
|
||||
} from '@/components/ui/actions-menu'
|
||||
import { Codicon } from '@/components/ui/codicon'
|
||||
import { ConfirmDialog } from '@/components/ui/confirm-dialog'
|
||||
import {
|
||||
|
|
@ -98,7 +104,13 @@ function useProjectActions({
|
|||
label: p.reveal,
|
||||
onSelect: () => void revealPath(project.path)
|
||||
},
|
||||
{ disabled: !project.path, icon: 'copy', key: 'copy', label: p.copyPath, onSelect: () => void copyPath(project.path) }
|
||||
{
|
||||
disabled: !project.path,
|
||||
icon: 'copy',
|
||||
key: 'copy',
|
||||
label: p.copyPath,
|
||||
onSelect: () => void copyPath(project.path)
|
||||
}
|
||||
]
|
||||
|
||||
const dangerItem: ActionItemSpec = project.isAuto
|
||||
|
|
@ -286,7 +298,13 @@ interface ProjectContextMenuProps {
|
|||
// Wrap a project row so right-clicking it opens the same actions as its kebab.
|
||||
// The kebab's row-anchored Appearance popover can't nest in a context menu, so
|
||||
// here Appearance is a submenu with the same swatch + icon picker.
|
||||
export function ProjectContextMenu({ project, isActive, scoped = false, onExitScope, children }: ProjectContextMenuProps) {
|
||||
export function ProjectContextMenu({
|
||||
project,
|
||||
isActive,
|
||||
scoped = false,
|
||||
onExitScope,
|
||||
children
|
||||
}: ProjectContextMenuProps) {
|
||||
const { t } = useI18n()
|
||||
const p = t.sidebar.projects
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,13 @@ import {
|
|||
closeTreeTabsToRight,
|
||||
treeTabCloseTargets
|
||||
} from '@/components/pane-shell/tree/store'
|
||||
import { type ActionItemSpec, ActionsContextMenu, ActionsMenu, type MenuKit, renderActionItem } from '@/components/ui/actions-menu'
|
||||
import {
|
||||
type ActionItemSpec,
|
||||
ActionsContextMenu,
|
||||
ActionsMenu,
|
||||
type MenuKit,
|
||||
renderActionItem
|
||||
} from '@/components/ui/actions-menu'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Codicon } from '@/components/ui/codicon'
|
||||
import { ColorSwatches } from '@/components/ui/color-swatches'
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
import type * as React from 'react'
|
||||
|
||||
import { type ActionItemSpec, ActionsContextMenu, ActionsMenu, type MenuKit, renderActionItem } from '@/components/ui/actions-menu'
|
||||
import {
|
||||
type ActionItemSpec,
|
||||
ActionsContextMenu,
|
||||
ActionsMenu,
|
||||
type MenuKit,
|
||||
renderActionItem
|
||||
} from '@/components/ui/actions-menu'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Codicon } from '@/components/ui/codicon'
|
||||
import { Tip } from '@/components/ui/tooltip'
|
||||
|
|
|
|||
|
|
@ -80,7 +80,10 @@ export interface ActionItemSpec {
|
|||
}
|
||||
|
||||
/** Render one `ActionItemSpec` with the given kit's Item component. */
|
||||
export function renderActionItem(kit: MenuKit, { className, disabled, icon, iconNode, key, label, onSelect, variant }: ActionItemSpec) {
|
||||
export function renderActionItem(
|
||||
kit: MenuKit,
|
||||
{ className, disabled, icon, iconNode, key, label, onSelect, variant }: ActionItemSpec
|
||||
) {
|
||||
return (
|
||||
<kit.Item
|
||||
className={className}
|
||||
|
|
@ -95,8 +98,10 @@ export function renderActionItem(kit: MenuKit, { className, disabled, icon, icon
|
|||
)
|
||||
}
|
||||
|
||||
interface ActionsMenuProps
|
||||
extends Pick<React.ComponentProps<typeof DropdownMenuContent>, 'align' | 'side' | 'sideOffset'> {
|
||||
interface ActionsMenuProps extends Pick<
|
||||
React.ComponentProps<typeof DropdownMenuContent>,
|
||||
'align' | 'side' | 'sideOffset'
|
||||
> {
|
||||
/** The trigger (a kebab button). Wrapped in `DropdownMenuTrigger asChild`. */
|
||||
children: React.ReactNode
|
||||
/** The action rows, rendered with `DROPDOWN_KIT`. Share this with `ActionsContextMenu`. */
|
||||
|
|
@ -161,7 +166,13 @@ interface ActionsContextMenuProps {
|
|||
* Wrap a row so right-clicking it opens the same menu as its kebab. Pass the
|
||||
* kebab's `items` render function so both surfaces mirror each other.
|
||||
*/
|
||||
export function ActionsContextMenu({ ariaLabel, children, contentClassName, disabled, items }: ActionsContextMenuProps) {
|
||||
export function ActionsContextMenu({
|
||||
ariaLabel,
|
||||
children,
|
||||
contentClassName,
|
||||
disabled,
|
||||
items
|
||||
}: ActionsContextMenuProps) {
|
||||
if (disabled) {
|
||||
return <>{children}</>
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue