Skip to content

fix(search): restaura quickActions (corrige TS2552 do gate typecheck)#215

Merged
adm01-debug merged 1 commit into
mainfrom
fix/global-search-quickactions-tsc
May 24, 2026
Merged

fix(search): restaura quickActions (corrige TS2552 do gate typecheck)#215
adm01-debug merged 1 commit into
mainfrom
fix/global-search-quickactions-tsc

Conversation

@adm01-debug
Copy link
Copy Markdown
Owner

@adm01-debug adm01-debug commented May 24, 2026

Corrige regressão de TypeScript introduzida no #209: a limpeza de unused-vars renomeou const quickActions_quickActions, mas o identificador é referenciado em posição de tipo (typeof quickActions[0]), que o codemod não detectou como uso. Resultado: TS2552 no gate de typecheck baseline.

Fix: reverte o rename (1 linha). tsc -p tsconfig.app.json volta a 0 regressões; sem impacto em runtime ou no baseline ESLint.


Summary by cubic

Fixes a TypeScript TS2552 in global search by restoring the quickActions identifier (it had been renamed to _quickActions). The typeof quickActions[0] type reference compiles again; no runtime or ESLint baseline changes.

Written for commit cca89b2. Summary will update on new commits. Review in cubic

Copilot AI review requested due to automatic review settings May 24, 2026 01:44
@vercel
Copy link
Copy Markdown

vercel Bot commented May 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
we-dream-big Ready Ready Preview, Comment May 24, 2026 1:45am

@supabase
Copy link
Copy Markdown

supabase Bot commented May 24, 2026

This pull request has been ignored for the connected project doufsxqlfjyuvxuezpln because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 24, 2026

Warning

Review limit reached

@adm01-debug, we couldn't start this review because you've used your available PR reviews for now.

Your plan currently allows 1 review/hour. Refill in 10 minutes and 53 seconds.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more review capacity refills, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e7d828b8-86d0-475f-b424-a978595b0d2a

📥 Commits

Reviewing files that changed from the base of the PR and between c326e8a and cca89b2.

📒 Files selected for processing (1)
  • src/components/search/GlobalSearchIdleState.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/global-search-quickactions-tsc

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes a TypeScript regression in the global search idle state by restoring the quickActions identifier, which is referenced via a typeof quickActions[0] type query. This unblocks the tsc -p tsconfig.app.json typecheck baseline gate (TS2552) without intended runtime behavior changes.

Changes:

  • Reverts _quickActions back to quickActions so the typeof quickActions[0] type reference resolves again.
Comments suppressed due to low confidence (1)

src/components/search/GlobalSearchIdleState.tsx:78

  • quickActions is only used for the typeof quickActions[0] type query, so the array (including JSX/SVG) is still created at runtime even though it isn't rendered/consumed. To avoid the extra runtime constant and the fragile “first element” typing, consider introducing an explicit QuickAction type (e.g., derived from GlobalSearchIdleStateProps['quickActionsData'][number]) and using that for NavCard instead of typeof quickActions[0].
const quickActions = [
  { id: "new-quote", title: "Novo Orçamento", description: "Criar um novo orçamento", icon: <span className="h-4 w-4"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/><path d="M10 18v-6"/><path d="M14 18v-3"/></svg></span>, href: "/orcamentos/novo", shortcut: "N", highlight: true },
  { id: "products", title: "Catálogo de Produtos", description: "Ver todos os produtos", icon: <span className="h-4 w-4"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="m7.5 4.27 9 5.15"/><path d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"/><path d="m3.3 7 8.7 5 8.7-5"/><path d="M12 22V12"/></svg></span>, href: "/" },
];

/* ── NavCard ── */
function NavCard({ action, index, onSelect }: {
  action: typeof quickActions[0]; index: number; onSelect: (href: string) => void;
}) {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@adm01-debug adm01-debug merged commit 5373bde into main May 24, 2026
27 of 30 checks passed
@adm01-debug adm01-debug deleted the fix/global-search-quickactions-tsc branch May 24, 2026 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants