Skip to content

feat: implement custom syntax-highlighted code block component and ad…#2

Merged
Praashh merged 1 commit into
mainfrom
enhance/ui
Jun 26, 2026
Merged

feat: implement custom syntax-highlighted code block component and ad…#2
Praashh merged 1 commit into
mainfrom
enhance/ui

Conversation

@Praashh

@Praashh Praashh commented Jun 26, 2026

Copy link
Copy Markdown
Owner

…d language-specific API integration snippets

…d language-specific API integration snippets
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
next-flow Ready Ready Preview, Comment Jun 26, 2026 8:53am

@github-actions

Copy link
Copy Markdown

React Doctor found 27 new issues in 3 files · 27 warnings · score 49 / 100 (Critical) · 1 fixed · vs main

27 warnings

app/app/flow/page.tsx

  • ⚠️ L163 Pure function rebuilt every render prefer-module-scope-pure-function

app/app/workflows/[id]/page.tsx

  • ⚠️ L52 Pure function rebuilt every render prefer-module-scope-pure-function
  • ⚠️ L60 Array index used as a key no-array-index-as-key
  • ⚠️ L70 Array index used as a key no-array-index-as-key
  • ⚠️ L86 Array index used as a key no-array-index-as-key
  • ⚠️ L93 Array index used as a key no-array-index-as-key
  • ⚠️ L99 Array index used as a key no-array-index-as-key
  • ⚠️ L105 Array index used as a key no-array-index-as-key
  • ⚠️ L117 Array index used as a key no-array-index-as-key
  • ⚠️ L128 Array index used as a key no-array-index-as-key
  • ⚠️ L156 Array index used as a key no-array-index-as-key
  • ⚠️ L163 Array index used as a key no-array-index-as-key
  • ⚠️ L169 Array index used as a key no-array-index-as-key
  • ⚠️ L175 Array index used as a key no-array-index-as-key
  • ⚠️ L190 Array index used as a key no-array-index-as-key
  • ⚠️ L197 Array index used as a key no-array-index-as-key
  • ⚠️ L204 Array index used as a key no-array-index-as-key
  • ⚠️ L211 Array index used as a key no-array-index-as-key
  • ⚠️ L217 Array index used as a key no-array-index-as-key
  • ⚠️ L229 Array index used as a key no-array-index-as-key
  • ⚠️ L236 Array index used as a key no-array-index-as-key
  • ⚠️ L243 Array index used as a key no-array-index-as-key
  • ⚠️ L250 Array index used as a key no-array-index-as-key
  • ⚠️ L256 Array index used as a key no-array-index-as-key
  • ⚠️ L1624 Control missing accessible label control-has-associated-label

components/app-sidebar.tsx

  • ⚠️ L172 Button missing explicit type button-has-type
  • ⚠️ L223 Bouncy easing animation no-inline-bounce-easing

Reviewed by React Doctor for commit 45dfb34. See inline comments for fixes.

Comment thread app/app/flow/page.tsx
}
};

const exportWorkflow = async (id: string, name: string) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

React Doctor · react-doctor/prefer-module-scope-pure-function (warning)

exportWorkflow inside FlowPage uses no local state but is rebuilt on every render, so it wastes work & breaks memoized children. Move it to the top of the file, outside the component.

Fix → Move the function above the component, at the top of the file. It doesn't use local state, so rebuilding it each update is wasted work.

Docs

}

function CodeBlock({ code, language }: CodeBlockProps) {
const highlight = (text: string, lang: string) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

React Doctor · react-doctor/prefer-module-scope-pure-function (warning)

highlight inside CodeBlock uses no local state but is rebuilt on every render, so it wastes work & breaks memoized children. Move it to the top of the file, outside the component.

Fix → Move the function above the component, at the top of the file. It doesn't use local state, so rebuilding it each update is wasted work.

Docs

return parts.map((part, index) => {
if (part.startsWith("#") || part.startsWith('"""')) {
return (
<span key={index} className="text-gray-400 font-mono italic">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

React Doctor · react-doctor/no-array-index-as-key (warning)

Your users can see & submit the wrong data when this list reorders or filters, so use a stable id like key={item.id}, not the array index "index".

Fix → Use a stable id from the item, like key={item.id} or key={item.slug}. Index keys break when the list reorders or filters.

Docs

(part.startsWith("'") && part.endsWith("'"))
) {
return (
<span key={index} className="text-emerald-600 font-mono">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

React Doctor · react-doctor/no-array-index-as-key (warning)

Your users can see & submit the wrong data when this list reorders or filters, so use a stable id like key={item.id}, not the array index "index".

Fix → Use a stable id from the item, like key={item.id} or key={item.slug}. Index keys break when the list reorders or filters.

Docs

)
) {
return (
<span key={index} className="text-purple-600 font-mono font-semibold">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

React Doctor · react-doctor/no-array-index-as-key (warning)

Your users can see & submit the wrong data when this list reorders or filters, so use a stable id like key={item.id}, not the array index "index".

Fix → Use a stable id from the item, like key={item.id} or key={item.slug}. Index keys break when the list reorders or filters.

Docs

}
if (/^[0-9\.]+$/.test(part)) {
return (
<span key={index} className="text-amber-600 font-mono">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

React Doctor · react-doctor/no-array-index-as-key (warning)

Your users can see & submit the wrong data when this list reorders or filters, so use a stable id like key={item.id}, not the array index "index".

Fix → Use a stable id from the item, like key={item.id} or key={item.slug}. Index keys break when the list reorders or filters.

Docs

);
}
return (
<span key={index} className="text-gray-800 font-mono">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

React Doctor · react-doctor/no-array-index-as-key (warning)

Your users can see & submit the wrong data when this list reorders or filters, so use a stable id like key={item.id}, not the array index "index".

Fix → Use a stable id from the item, like key={item.id} or key={item.slug}. Index keys break when the list reorders or filters.

Docs

else height = 18;

return (
<button

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

React Doctor · react-doctor/control-has-associated-label (warning)

Blind users can't tell what this control does because screen readers find no label, so add visible text, aria-label, or aria-labelledby.

Fix → Give every interactive control a label screen readers can read.

Docs

<SidebarMenu>
<SidebarMenuItem>
{collapsed ? (
<button

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

React Doctor · react-doctor/button-has-type (warning)

Your users can submit the form by accident because a <button> with no type defaults to submit.

Fix → Set an explicit button type so plain buttons do not submit forms by accident: type="button", "submit", or "reset".

Docs

)}
</SidebarMenuItem>
</SidebarMenu>
<ChevronUp className="size-4 text-gray-400 animate-bounce-subtle" />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

React Doctor · react-doctor/no-inline-bounce-easing (warning)

Your users see a dated, tacky animate-bounce, so use a subtle ease-out transform for a smoother finish.

Fix → Use cubic-bezier(0.16, 1, 0.3, 1) (ease-out-expo) for a natural finish. Real objects don't bounce.

Docs

@Praashh
Praashh merged commit 989cdd8 into main Jun 26, 2026
4 checks passed
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.

1 participant