Skip to content

HelpPanel full markdown — GFM + code blocks + tables + syntax highlight#243

Merged
jaylfc merged 3 commits into
masterfrom
feat/chat-help-full-markdown
Apr 20, 2026
Merged

HelpPanel full markdown — GFM + code blocks + tables + syntax highlight#243
jaylfc merged 3 commits into
masterfrom
feat/chat-help-full-markdown

Conversation

@jaylfc
Copy link
Copy Markdown
Owner

@jaylfc jaylfc commented Apr 20, 2026

Summary

Upgrades the in-app chat-guide HelpPanel from a minimal hand-rolled markdown parser to a full-featured renderer. Users now see `docs/chat-guide.md` with proper tables, code blocks with syntax highlighting, blockquotes, nested lists, ordered lists, task lists, autolinks, strikethrough, and horizontal rules.

Dependencies

  • `react-markdown` — renderer
  • `remark-gfm` — GitHub-Flavored Markdown (tables, strikethrough, task lists, autolinks)
  • `rehype-highlight` + `highlight.js` — syntax-highlighted code blocks (github-dark theme)

Styling

All HTML elements get Tailwind component overrides matching the shell dark theme:

  • Headings (h1/h2/h3) scale down and bold weight
  • Code blocks in `bg-black/40` with border + horizontal scroll
  • Tables with bordered cells + header bg
  • Lists with disc/decimal markers + pl-5
  • Blockquotes with left border
  • Anchors open in new tab

Test plan

  • 3/3 HelpPanel tests pass — existing fetch+render, Esc, backdrop assertions all hold with the new renderer.
  • Bundle rebuilds clean.
  • Manual smoke: open help panel from a channel, verify tables render, code blocks highlight, links clickable.

Summary by CodeRabbit

  • New Features
    • Enhanced help docs with richer Markdown support and syntax-highlighted code blocks for improved readability.
  • Style
    • Updated global styling and utility classes, refining layout, colors, and UI primitives.
  • Chores
    • Added libraries powering Markdown and highlighting; refreshed built asset references.
  • Bug Fixes
    • Tweaked "Copy all logs" output formatting to improve pasted results.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 20, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0a981fdc-5a92-4265-b11b-0db8bf778e47

📥 Commits

Reviewing files that changed from the base of the PR and between 3e3e33a and 179ebe2.

⛔ Files ignored due to path filters (1)
  • desktop/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • desktop/package.json
  • desktop/src/apps/chat/HelpPanel.tsx

📝 Walkthrough

Walkthrough

Replaced a custom HelpPanel markdown renderer with react-markdown (GFM + syntax highlighting), added related dependencies, updated bundled asset hashes and module import paths, removed and replaced the Tailwind-generated tokens stylesheet, and updated HTML asset references.

Changes

Cohort / File(s) Summary
Markdown rendering & deps
desktop/package.json, desktop/src/apps/chat/HelpPanel.tsx
Added react-markdown, remark-gfm, rehype-highlight, rehype-slug, highlight.js; replaced custom inline markdown parser with ReactMarkdown, configured remark/rehype plugins, syntax highlighting, and Tailwind-styled component overrides.
Bundled JS hash updates
static/desktop/assets/MCPApp-*.js, static/desktop/assets/ProvidersApp-*.js, static/desktop/assets/SettingsApp-*.js, static/desktop/assets/chat-*.js
Swapped compiled dependency import paths to new hashed bundle filenames; no API surface changes. Minor change in logs "Copy all logs" serialization formatting.
Tailwind tokens stylesheet
static/desktop/assets/tokens-BCNCV_Mq.css (removed), static/desktop/assets/tokens-D0eHLZhU.css (added)
Removed old tokens CSS and added regenerated Tailwind tokens stylesheet with updated theme variables, utilities, @property registrations, and keyframes.
Static HTML asset refs
static/desktop/index.html, static/desktop/chat.html
Updated module/script and stylesheet references to point to new hashed asset filenames.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 I nibble code and stitch the lines,

React and markdown, tangled vines,
Highlights blinking, tokens new,
Bundles reborn, styles in view,
A tiny hop — the panel sings anew.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately describes the main change: enabling full markdown rendering in HelpPanel with GFM, code blocks, tables, and syntax highlighting.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/chat-help-full-markdown

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

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented Apr 20, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • desktop/package.json
  • desktop/src/apps/chat/HelpPanel.tsx
  • desktop/package-lock.json (dependencies only)

Fix these issues in Kilo Cloud


Reviewed by seed-2-0-pro-260328 · 157,489 tokens

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
static/desktop/assets/tokens-D0eHLZhU.css (1)

1-1: Exclude generated bundle from stylelint checks

This is build output, so the Line 1 stylelint failures are non-actionable noise. Please lint source CSS/Tailwind inputs instead and ignore static/desktop/assets/tokens-*.css in stylelint config.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@static/desktop/assets/tokens-D0eHLZhU.css` at line 1, The generated bundle
tokens-*.css is triggering noisy stylelint errors; update the Stylelint
configuration (e.g., stylelint.config.js / .stylelintrc.js or package.json
stylelint key) to ignore the build output by adding the pattern "tokens-*.css"
to ignoreFiles/ignorePatterns or create a .stylelintignore entry for that glob,
and ensure your CI/lint scripts point at the source Tailwind/CSS inputs instead
of the generated bundle.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@desktop/src/apps/chat/HelpPanel.tsx`:
- Around line 69-74: Update the react-markdown code renderer in HelpPanel by
removing the unused inline prop and adding proper typing: stop destructuring
`inline` in the `code` renderer and return a single branch that uses `className`
and `children`; also type the `components` object as `Components` from
'react-markdown' so the `code` renderer signature is correctly typed instead of
`any`. Locate the `code: ({ node, inline, className, children, ...props }: any)
=> ...` renderer and change it to a single `code: ({ node, className, children,
...props }) => ...` implementation and update the surrounding `components`
declaration to use `Components` from 'react-markdown'.
- Around line 61-68: The ReactMarkdown block is missing rehype-slug (so headings
lack id attributes for fragment links) and always forces target="_blank" on
every anchor which breaks in-modal fragment navigation; update the rehypePlugins
array used in ReactMarkdown to include rehypeSlug (imported from "rehype-slug")
and change the custom anchor component (the a renderer in components) to only
add target="_blank" and rel="noreferrer" when the href is an external URL (e.g.,
test if href starts with "http://" or "https://" and its origin differs from
window.location.origin), leaving internal/fragment links untouched.

---

Nitpick comments:
In `@static/desktop/assets/tokens-D0eHLZhU.css`:
- Line 1: The generated bundle tokens-*.css is triggering noisy stylelint
errors; update the Stylelint configuration (e.g., stylelint.config.js /
.stylelintrc.js or package.json stylelint key) to ignore the build output by
adding the pattern "tokens-*.css" to ignoreFiles/ignorePatterns or create a
.stylelintignore entry for that glob, and ensure your CI/lint scripts point at
the source Tailwind/CSS inputs instead of the generated bundle.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7cfc2075-55bb-4130-8b9c-51c966ea0780

📥 Commits

Reviewing files that changed from the base of the PR and between f735537 and 3e3e33a.

⛔ Files ignored due to path filters (1)
  • desktop/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (12)
  • desktop/package.json
  • desktop/src/apps/chat/HelpPanel.tsx
  • static/desktop/assets/MCPApp-5HQXUU1O.js
  • static/desktop/assets/ProvidersApp-BV6ruBwV.js
  • static/desktop/assets/SettingsApp-Dslwl1Cq.js
  • static/desktop/assets/chat-CtrpLy48.js
  • static/desktop/assets/main-D_Gu3kUS.js
  • static/desktop/assets/tokens-BCNCV_Mq.css
  • static/desktop/assets/tokens-BmimH8YG.js
  • static/desktop/assets/tokens-D0eHLZhU.css
  • static/desktop/chat.html
  • static/desktop/index.html
💤 Files with no reviewable changes (1)
  • static/desktop/assets/tokens-BCNCV_Mq.css

Comment thread desktop/src/apps/chat/HelpPanel.tsx Outdated
Comment thread desktop/src/apps/chat/HelpPanel.tsx Outdated
Comment on lines +69 to +74
code: ({ node, inline, className, children, ...props }: any) =>
inline ? (
<code className="bg-white/5 px-1 rounded text-xs" {...props}>{children}</code>
) : (
<code className={className} {...props}>{children}</code>
),
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

In react-markdown v10, what is the recommended TypeScript type for custom renderers in the componentsprop, specifically forcode?

💡 Result:

In react-markdown v10, the recommended TypeScript type for custom renderers in the components prop, specifically for code, is Components['code'], where Components is imported from 'react-markdown'. This type is defined as ElementType<ComponentProps<'code'> & ExtraProps>, with ExtraProps containing the optional node field from hast (import type {ExtraProps} from 'react-markdown'; import type {ComponentProps, ElementType} from 'react';). A practical equivalent explicitly constructing the type is React.ComponentProps<'code'> & ExtraProps or JSX.IntrinsicElements['code'] & ExtraProps. Example usage: import ReactMarkdown, { Components, ExtraProps } from 'react-markdown'; import type { ComponentProps, ElementType } from 'react'; import type { Element } from 'hast'; type CodeRendererProps = ComponentProps<'code'> & ExtraProps; const MyCodeRenderer: Components['code'] = ({ node, children, className, ...props }) => { // Implementation return <code className={className} {...props}>{children}; }; // In components prop: components={{ code: MyCodeRenderer }} Note that in v10, the inline prop is no longer passed to code components (removed in earlier major versions like v9).

Citations:


🏁 Script executed:

# Check package.json for react-markdown version
find . -name "package.json" -type f | head -5 | xargs grep -l "react-markdown" 2>/dev/null

# Get the exact version
cat ./package.json | grep -A 2 -B 2 "react-markdown" || echo "Not found in root package.json"

Repository: jaylfc/tinyagentos

Length of output: 179


🏁 Script executed:

# Look for package-lock or yarn.lock to confirm exact resolved version
if [ -f "package-lock.json" ]; then
  grep -A 5 '"react-markdown"' package-lock.json | head -20
elif [ -f "yarn.lock" ]; then
  grep -A 5 "react-markdown" yarn.lock | head -20
fi

Repository: jaylfc/tinyagentos

Length of output: 44


🏁 Script executed:

# Check the HelpPanel.tsx file to see the full context and any comments
cat -n ./desktop/src/apps/chat/HelpPanel.tsx | head -100

Repository: jaylfc/tinyagentos

Length of output: 5595


🏁 Script executed:

cat ./desktop/package.json | grep -A 5 -B 5 "react-markdown"

Repository: jaylfc/tinyagentos

Length of output: 380


Remove the inline prop usage and fix the type annotation for the code renderer.

The inline prop was removed in react-markdown v10. Your code destructures it on line 69 and uses it in a conditional on line 70, but it will always be undefined, making the inline branch dead code. Additionally, using any hides this issue from TypeScript.

Type the components object as Components from 'react-markdown' and remove the inline check:

Suggested fix
import { Components } from 'react-markdown';

// Then in your components prop:
code: ({ node, className, children, ...props }) => (
  <code className={className} {...props}>{children}</code>
),

If you need different styling for inline vs block code, use the className prop instead—rehype-highlight applies different classes to distinguish them.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@desktop/src/apps/chat/HelpPanel.tsx` around lines 69 - 74, Update the
react-markdown code renderer in HelpPanel by removing the unused inline prop and
adding proper typing: stop destructuring `inline` in the `code` renderer and
return a single branch that uses `className` and `children`; also type the
`components` object as `Components` from 'react-markdown' so the `code` renderer
signature is correctly typed instead of `any`. Locate the `code: ({ node,
inline, className, children, ...props }: any) => ...` renderer and change it to
a single `code: ({ node, className, children, ...props }) => ...` implementation
and update the surrounding `components` declaration to use `Components` from
'react-markdown'.

@jaylfc jaylfc merged commit 122491c into master Apr 20, 2026
7 of 8 checks passed
@jaylfc jaylfc deleted the feat/chat-help-full-markdown branch April 25, 2026 17:58
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