Skip to content
Closed
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/renderer/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1076,7 +1076,7 @@ const App: React.FC = () => {

const pinToggleForCommand = useCallback(
async (command: CommandInfo) => {
console.log('[PIN-TOGGLE] called for command:', command?.id, command?.name);
console.log('[PIN-TOGGLE] called for command:', command?.id, command?.title);
const currentPinned = pinnedCommandsRef.current;
const exists = currentPinned.includes(command.id);
console.log('[PIN-TOGGLE] currentPinned:', currentPinned, 'exists:', exists);
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/CameraExtension.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ const CameraExtension: React.FC<CameraExtensionProps> = ({ onClose }) => {
}, 5000);
capturePreviewClearTimerRef.current = window.setTimeout(() => {
setCapturePreviewDataUrl(null);
setCapturePreviewClearTimerRef.current = null;
capturePreviewClearTimerRef.current = null;
}, 5300);
setFlashVisible(true);
if (flashTimerRef.current != null) {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/QuickLinkManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ const QuickLinkManager: React.FC<QuickLinkManagerProps> = ({ onClose, initialVie
const inputRef = useRef<HTMLInputElement>(null);
const inlineArgumentLaneRef = useRef<HTMLDivElement>(null);
const inlineArgumentClusterRef = useRef<HTMLDivElement>(null);
const inlineDynamicInputRefs = useRef<Array<HTMLInputElement | null>>([]);
const inlineDynamicInputRefs = useRef<Array<HTMLInputElement | HTMLSelectElement | null>>([]);
const firstDynamicInputRef = useRef<HTMLInputElement>(null);
const listRef = useRef<HTMLDivElement>(null);
const itemRefs = useRef<(HTMLDivElement | null)[]>([]);
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/SnippetManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ const SnippetManager: React.FC<SnippetManagerProps> = ({ onClose, initialView })
const inputRef = useRef<HTMLInputElement>(null);
const inlineArgumentLaneRef = useRef<HTMLDivElement>(null);
const inlineArgumentClusterRef = useRef<HTMLDivElement>(null);
const inlineArgumentInputRefs = useRef<Array<HTMLInputElement | null>>([]);
const inlineArgumentInputRefs = useRef<Array<HTMLInputElement | HTMLSelectElement | null>>([]);
const firstDynamicInputRef = useRef<HTMLInputElement>(null);
const listRef = useRef<HTMLDivElement>(null);
const itemRefs = useRef<(HTMLDivElement | null)[]>([]);
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/hooks/useAiChat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export interface UseAiChatReturn {
setAiQuery: (value: string) => void;
aiInputRef: React.RefObject<HTMLInputElement>;
aiResponseRef: React.RefObject<HTMLDivElement>;
setAiAvailable: (value: boolean) => void;
setAiAvailable: React.Dispatch<React.SetStateAction<boolean>>;
conversations: AiConversation[];
activeConversationId: string | null;
startAiChat: (searchQuery: string) => void;
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/hooks/useLauncherCommandModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function getFileDepthPenalty(result: IndexedFileSearchResult): number {

type BrowserLauncherProfile = {
id?: string;
browserId?: BrowserSearchSource | string;
browserId?: BrowserSearchSource;
displayName: string;
detectedName?: string;
profileId: string;
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/hooks/useLauncherKeyboardControls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export type UseLauncherKeyboardControlsOptions = {
kind?: CommandInfo['browserResultKind'];
url?: string;
sourceProfileId?: string;
openInSourceProfile?: boolean;
windowId?: string | number;
tabId?: string | number;
}
Expand Down
4 changes: 3 additions & 1 deletion src/renderer/src/i18n/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import itMessages from './locales/it.json';
export type SupportedAppLocale = 'en' | 'zh-Hans' | 'zh-Hant' | 'ja' | 'ko' | 'fr' | 'de' | 'es' | 'ru' | 'it';
export type AppLanguageSetting = 'system' | SupportedAppLocale;
export type TranslationValues = Record<string, string | number | boolean | null | undefined>;
type MessageTree = Record<string, string | MessageTree>;
interface MessageTree {
[key: string]: string | MessageTree;
}

export const DEFAULT_APP_LANGUAGE: AppLanguageSetting = 'system';
export const FALLBACK_APP_LOCALE: SupportedAppLocale = 'en';
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/src/raycast-api/action-runtime-overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ export function createActionOverlayRuntime(deps: OverlayDeps) {
}

if (source && typeof source === 'object') {
const variants = [source.light, source.dark].filter((value): value is string => typeof value === 'string' && value.trim().length > 0);
const sourceVariants = source as Record<string, unknown>;
const variants = [sourceVariants.light, sourceVariants.dark].filter((value): value is string => typeof value === 'string' && value.trim().length > 0);
if (variants.length > 0) {
const assetLikeVariants = variants.filter((value) => hasImageExtension(value));
if (assetLikeVariants.length === 0) return true;
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/raycast-api/context-scope-runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export function withExtensionContext<T>(ctx: ExtensionContextSnapshot | undefine
try {
const value = fn();
if (value && typeof (value as any).then === 'function') {
return (value as Promise<any>).finally(restore) as T;
return (value as unknown as Promise<any>).finally(restore) as T;
}
restore();
return value;
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/raycast-api/detail-runtime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function createDetailRuntime(deps: CreateDetailRuntimeDeps) {

for (const node of allChildren) {
if (React.isValidElement(node)) {
const typeRecord = node.type as Record<string, unknown> | null;
const typeRecord = node.type as unknown as Record<string, unknown> | null;
if (typeRecord?.[DETAIL_METADATA_RUNTIME_MARKER] === true) {
metadataNodes.push(node);
continue;
Expand Down Expand Up @@ -290,7 +290,7 @@ export function createDetailRuntime(deps: CreateDetailRuntimeDeps) {
);

const MetadataComponent = ({ children }: { children?: React.ReactNode }) => <div className="space-y-4">{children}</div>;
(MetadataComponent as Record<string, unknown>)[DETAIL_METADATA_RUNTIME_MARKER] = true;
(MetadataComponent as unknown as Record<string, unknown>)[DETAIL_METADATA_RUNTIME_MARKER] = true;
MetadataComponent.displayName = 'Detail.Metadata';

const Metadata = Object.assign(
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/raycast-api/hooks/use-cached-promise.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export function useCachedPromise<T>(
if (pageNum === 0) {
setAccumulatedData(Array.isArray(pageData) ? pageData : []);
} else {
setAccumulatedData((prev) => {
setAccumulatedData((prev: unknown) => {
const prevArr = Array.isArray(prev) ? prev : [];
const newArr = Array.isArray(pageData) ? pageData : [];
return [...prevArr, ...newArr];
Expand All @@ -123,7 +123,7 @@ export function useCachedPromise<T>(
if (pageNum === 0) {
setAccumulatedData(Array.isArray(pageData) ? pageData : []);
} else {
setAccumulatedData((prev) => {
setAccumulatedData((prev: unknown) => {
const prevArr = Array.isArray(prev) ? prev : [];
const newArr = Array.isArray(pageData) ? pageData : [];
return [...prevArr, ...newArr];
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/raycast-api/icon-runtime-phosphor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import React from 'react';
import { renderToStaticMarkup } from 'react-dom/server';
import * as Phosphor from '../../../../node_modules/@phosphor-icons/react/dist/index.es.js';
import * as Phosphor from '@phosphor-icons/react';
import { RAYCAST_ICON_NAMES, RAYCAST_ICON_VALUE_TO_NAME, type RaycastIconName } from './raycast-icon-enum';

type PhosphorIconWeight = 'thin' | 'light' | 'regular' | 'bold' | 'fill' | 'duotone';
Expand Down
20 changes: 9 additions & 11 deletions src/renderer/src/raycast-api/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,10 @@ export enum ToastStyle {
Failure = 'failure',
}

type ToastStyleInput = ToastStyle | 'animated' | 'success' | 'failure';

export class Toast {
static Style = ToastStyle;
static Style: typeof ToastStyle = ToastStyle;
private static _activeToast: Toast | null = null;

private _title = '';
Expand Down Expand Up @@ -483,7 +485,7 @@ export class Toast {
return this._style;
}

public set style(value: ToastStyle | Toast.Style | string) {
public set style(value: ToastStyleInput | Toast.Style | string) {
this._style = this.normalizeStyle(value);
this.refresh();
}
Expand All @@ -506,7 +508,7 @@ export class Toast {
this.refresh();
}

private normalizeStyle(value: ToastStyle | Toast.Style | string | undefined): ToastStyle {
private normalizeStyle(value: ToastStyleInput | Toast.Style | string | undefined): ToastStyle {
if (value === ToastStyle.Animated || value === Toast.Style.Animated || value === 'animated') {
return ToastStyle.Animated;
}
Expand Down Expand Up @@ -894,16 +896,12 @@ export class Toast {

// Toast namespace for types (merged with class)
export namespace Toast {
export enum Style {
Animated = 'animated',
Success = 'success',
Failure = 'failure',
}
export type Style = ToastStyle;

export interface Options {
title: string;
message?: string;
style?: ToastStyle | Toast.Style;
style?: ToastStyleInput | Toast.Style;
primaryAction?: Alert.ActionOptions;
secondaryAction?: Alert.ActionOptions;
}
Expand All @@ -924,9 +922,9 @@ function shouldSuppressBenignGitMissingPathToast(options: Toast.Options): boolea
}

export async function showToast(options: Toast.Options): Promise<Toast>;
export async function showToast(style: ToastStyle | Toast.Style, title: string, message?: string): Promise<Toast>;
export async function showToast(style: ToastStyleInput | Toast.Style, title: string, message?: string): Promise<Toast>;
export async function showToast(
optionsOrStyle: Toast.Options | ToastStyle | Toast.Style,
optionsOrStyle: Toast.Options | ToastStyleInput | Toast.Style,
title?: string,
message?: string
): Promise<Toast> {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/raycast-api/list-runtime-renderers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface ListRendererDeps {
renderIcon: (icon: any, className?: string, assetsPath?: string) => React.ReactNode;
resolveTintColor: (tintColor?: string) => string | undefined;
resolveReadableTintColor: (tintColor?: string, options?: { minContrast?: number }) => string | undefined;
addHexAlpha: (hex: string, alphaHex?: string) => string | null;
addHexAlpha: (hex: string, alphaHex: string) => string | undefined;
}

export function createListRenderers(deps: ListRendererDeps) {
Expand Down Expand Up @@ -102,7 +102,7 @@ export function createListRenderers(deps: ListRendererDeps) {
{icon && <div className="w-5 h-5 flex items-center justify-center flex-shrink-0 text-[var(--text-muted)] text-xs">{renderIcon(icon, iconClassName, assetsPath)}</div>}
<div className="flex-1 min-w-0"><span className="text-[13px] leading-[18px] truncate block" style={{ color: 'rgba(var(--on-surface-rgb), 0.9)' }}>{primaryText}</span></div>
{secondaryText && <span className="text-[11px] leading-[16px] flex-shrink-0 truncate max-w-[220px]" style={{ color: 'var(--text-muted)' }}>{secondaryText}</span>}
{accessories?.map((accessory, index) => {
{accessories?.map((accessory: NonNullable<ListItemProps['accessories']>[number], index: number) => {
const accessoryText = typeof accessory?.text === 'string' ? accessory.text : typeof accessory?.text === 'object' ? accessory.text?.value || '' : '';
const accessoryTextColorRaw = typeof accessory?.text === 'object' ? accessory.text?.color : undefined;
const tagText = typeof accessory?.tag === 'string' ? accessory.tag : typeof accessory?.tag === 'object' ? accessory.tag?.value || '' : '';
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/raycast-api/list-runtime.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ interface ListRuntimeDeps {
renderIcon: (icon: any, className?: string, assetsPath?: string) => React.ReactNode;
resolveTintColor: (value?: string) => string | undefined;
resolveReadableTintColor: (value?: string, options?: { minContrast?: number }) => string | undefined;
addHexAlpha: (hex: string, alphaHex?: string) => string | null;
addHexAlpha: (hex: string, alphaHex: string) => string | undefined;
getExtensionContext: () => {
assetsPath: string;
extensionDisplayName?: string;
Expand Down Expand Up @@ -390,7 +390,7 @@ export function createListRuntime(deps: ListRuntimeDeps) {
const detailElement = useMemo(() => {
if (!rawDetail || !React.isValidElement(rawDetail)) return rawDetail;
if (rawDetail.type !== React.Fragment) return rawDetail;
const children = React.Children.toArray(rawDetail.props.children);
const children = React.Children.toArray((rawDetail.props as { children?: React.ReactNode }).children);
let mergedMarkdown: string | undefined;
let mergedMetadata: React.ReactElement | undefined;
let mergedIsLoading: boolean | undefined;
Expand Down
4 changes: 4 additions & 0 deletions src/renderer/src/raycast-api/oauth/oauth-service-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export class OAuthServiceCore {
return (override && override.trim()) || this.options.clientId;
}

getPersonalAccessToken(): string | undefined {
return this.options.personalAccessToken;
}

setClientIdOverride(value: string): void {
const key = oauthClientIdOverrideKey(this.getProviderKey());
const trimmed = (value || '').trim();
Expand Down
7 changes: 4 additions & 3 deletions src/renderer/src/raycast-api/oauth/with-access-token.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ export function withAccessToken(options: any) {
const shouldInvokeOnAuthorize = !(options instanceof OAuthService);
const authorizeForNoView = async (): Promise<void> => {
if (options instanceof OAuthService) {
if (options?.personalAccessToken) {
accessTokenValue = options.personalAccessToken;
const personalAccessToken = options.getPersonalAccessToken();
if (personalAccessToken) {
accessTokenValue = personalAccessToken;
accessTokenType = 'personal';
await Promise.resolve(options.onAuthorize?.({ token: accessTokenValue, type: 'personal' }));
await Promise.resolve(options.onAuthorize?.({ token: personalAccessToken, type: 'personal' }));
return;
}

Expand Down
7 changes: 5 additions & 2 deletions src/renderer/src/settings/AITab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ const AITab: React.FC = () => {
<h3 className="text-[0.8125rem] font-semibold text-[var(--text-primary)]">{t('settings.ai.llm.ollama.models')}</h3>
{ollamaRunning && (
<button
onClick={refreshOllamaStatus}
onClick={() => refreshOllamaStatus()}
className="flex items-center gap-1 px-2 py-1 text-[0.75rem] text-[var(--text-muted)] hover:text-[var(--text-secondary)] rounded-md transition-colors"
>
<RefreshCw className="w-3 h-3" />
Expand Down Expand Up @@ -2004,7 +2004,10 @@ const AITab: React.FC = () => {
try {
setPreviewingVoice(true);
const selectedVoice = ELEVENLABS_VOICES.find((v) => v.id === selectedElevenLabsVoiceId) || elevenLabsVoices.find((v) => v.id === selectedElevenLabsVoiceId);
const intro = `Hi, this is ${selectedVoice?.label || selectedVoice?.name || 'my voice'} from ElevenLabs in SuperCmd.`;
const selectedVoiceName = selectedVoice
? ('label' in selectedVoice ? selectedVoice.label : selectedVoice.name)
: 'my voice';
const intro = `Hi, this is ${selectedVoiceName} from ElevenLabs in SuperCmd.`;
await window.electron.speakPreviewVoice({
provider: 'elevenlabs',
model: speakModelValue,
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/settings/StoreTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ const StoreTab: React.FC<{ embedded?: boolean }> = ({ embedded = false }) => {
const key = event.key.toLowerCase() === 'backspace' ? 'backspace' : event.key.toLowerCase();
for (const action of storeActions) {
if (!action.shortcut) continue;
if (!action.shortcut.key) continue;
const mods = action.shortcut.modifiers || [];
const needsMeta = mods.includes('cmd') || mods.includes('ctrl');
const needsShift = mods.includes('shift');
Expand Down
23 changes: 23 additions & 0 deletions src/renderer/src/types/liquid-glass-react.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
declare module 'liquid-glass-react' {
import type React from 'react';

export type LiquidGlassMode = 'standard' | 'polar' | 'prominent' | 'shader';

export interface LiquidGlassProps {
children?: React.ReactNode;
className?: string;
style?: React.CSSProperties;
cornerRadius?: number;
mode?: LiquidGlassMode;
overLight?: boolean;
padding?: string | number;
blurAmount?: number;
displacementScale?: number;
saturation?: number;
aberrationIntensity?: number;
elasticity?: number;
}

const LiquidGlass: React.FC<LiquidGlassProps>;
export default LiquidGlass;
}
11 changes: 5 additions & 6 deletions src/renderer/src/utils/quicklink-icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Link2 } from 'lucide-react';
import { renderPhosphorIcon } from '../raycast-api/icon-runtime-phosphor';
import { RAYCAST_ICON_NAMES, type RaycastIconName } from '../raycast-api/raycast-icon-enum';

type LucideIconComponent = React.ComponentType<{ className?: string; strokeWidth?: number }>;
type LucideIconComponent = React.ComponentType<{ className?: string; strokeWidth?: string | number }>;

export type QuickLinkIconOption = {
value: string;
Expand Down Expand Up @@ -54,19 +54,18 @@ function buildSearchAliases(iconName: string): string[] {
}

const rawIconOptions: QuickLinkIconOption[] = (Array.isArray(RAYCAST_ICON_NAMES) ? RAYCAST_ICON_NAMES : [])
.map((name) => {
.flatMap((name): QuickLinkIconOption[] => {
const raycastName = String(name || '').trim() as RaycastIconName;
if (!raycastName) return null;
if (!raycastName) return [];
const label = buildIconLabel(raycastName);
const compact = normalizeIconKey(label);
const aliases = buildSearchAliases(raycastName).join(' ');
return {
return [{
value: raycastName,
label,
searchText: `${label} ${raycastName} ${compact} ${aliases}`.toLowerCase(),
} satisfies QuickLinkIconOption;
}];
})
.filter((option): option is QuickLinkIconOption => Boolean(option))
.sort((a, b) => a.label.localeCompare(b.label));

const canonicalIconValueByNormalized = new Map<string, string>();
Expand Down
Loading