Skip to content

feat(docs): add page actions to all docs pages#331

Open
BittuBarnwal7479 wants to merge 7 commits into
Kaelio:mainfrom
BittuBarnwal7479:feat/docs-page-actions
Open

feat(docs): add page actions to all docs pages#331
BittuBarnwal7479 wants to merge 7 commits into
Kaelio:mainfrom
BittuBarnwal7479:feat/docs-page-actions

Conversation

@BittuBarnwal7479

@BittuBarnwal7479 BittuBarnwal7479 commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

fixes: #330

Summary

Add Suggest edits and Raise issue actions to all documentation pages for a consistent user experience.

@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

@BittuBarnwal7479 is attempting to deploy a commit to the Kaelio Team on Vercel.

A member of the Team first needs to authorize it.

@BittuBarnwal7479 BittuBarnwal7479 changed the title feat(docs): add Suggest edits and Raise issue actions to all documentation pages feat(docs): add page actions to all docs pages Jul 2, 2026
@BittuBarnwal7479

Copy link
Copy Markdown
Contributor Author
image

@luca-martial luca-martial self-requested a review July 3, 2026 05:04

@luca-martial luca-martial left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for this, it's a genuinely useful addition (fixes #330), and the footer handling is done right: re-adding <PageFooter /> keeps prev/next nav because the Footer slot derives neighbours from context.

Two blockers stop it from shipping, plus a few design-cohesion items. Details are inline.

Blocking

  1. lucide-react is imported but not a dependency of docs-site; under the workspace's shamefullyHoist: false this fails a clean next build, and it contradicts the repo's "icons are inlined" convention. (docs-page-actions.tsx)
  2. "Raise issue" points at the bug_report.yml issue form, which ignores the body query param. The page/source context is silently dropped and the reader is forced into a bug form requiring repro steps and a KTX version, with blank_issues_enabled: false blocking any escape. (page.tsx)

Design / UX
3. The three actions are split across two locations (Copy top-right, Suggest edits / Raise issue in the footer) with identical styling, and the hero page shows only 2 of them. Group them into one cluster.
4. Icon set is inconsistent (two buttons have icons, Copy has none), and CircleAlert reads as an error state rather than feedback.

Code quality
5. Hardcoded canonical URL duplicates llm-docs.ts siteOrigin/absoluteUrl.
6. The markdown file is read up to 3x per page.
7. footer.component is a deprecated fumadocs prop.
8. The new test asserts URL shape, not that the issue flow is usable.

"use client";

import { useState } from "react";
import { CircleAlert, PencilLine } from "lucide-react";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Blocking (build break). lucide-react is not a dependency of docs-site (docs-site/package.json lists only fumadocs/next/react). It exists only transitively under fumadocs-ui in the pnpm store, and the workspace runs shamefullyHoist: false, so this bare import is not resolvable from docs-site/node_modules. A clean pnpm install + next build fails with Can't resolve 'lucide-react' (the new dev-server test should already be red on this).

This also contradicts the existing convention documented in theme-toggle.tsx: "Icons are inlined (the project doesn't depend on lucide-react directly)". Please inline the two SVGs the same way theme-toggle.tsx does, or add lucide-react to docs-site deps. The inline approach matches the repo.

rel="noreferrer noopener"
className={actionClassName}
>
<CircleAlert className="size-3.5" aria-hidden="true" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

CircleAlert reads as an error/warning state ("something is broken on this page"), not "send feedback". A bug, flag, or message glyph fits "Raise issue" better.

Also: these two links carry icons but "Copy as Markdown" (same actionClassName) has none, so the family looks half-styled. Pick one rule: icons on all three, or none.

Comment thread docs-site/app/docs/[[...slug]]/page.tsx Outdated
].join("\n");

const params = new URLSearchParams({
template: "bug_report.yml",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Blocking (feature doesn't do what it looks like it does). bug_report.yml is a GitHub issue form (YAML with a body: field list). Issue forms ignore the body query parameter entirely; they prefill only via per-field params keyed by each field's id. So the context built just above (page URL, source file, "What should change?") is silently discarded.

What the reader actually gets: the bug form, whose required fields are "How can we reproduce it?" and "KTX version" (labeled bug), for what is often a one-line docs typo. And config.yml sets blank_issues_enabled: false, so they can't fall back to a blank issue.

Recommend a dedicated docs-feedback issue form and prefill its fields by id, e.g. ?template=docs_feedback.yml&page=...&source=.... Ref: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema

Comment thread docs-site/app/docs/[[...slug]]/page.tsx Outdated
const MDX = page.data.body;
const mdxSource = await readDocsPageMarkdown(page.slugs);
const sourcePath = await resolveDocsPageMarkdownPath(page.slugs);
const pageUrl = `https://docs.kaelio.com/ktx/docs/${page.slugs.join("/")}`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This hardcodes the canonical origin, but lib/llm-docs.ts already owns it (siteOrigin = "https://docs.kaelio.com/ktx" plus an absoluteUrl() helper), and page.url already carries the canonical path. Two definitions of the same origin will drift. Reuse the existing helper / page.url for a single source of truth.

Comment thread docs-site/app/docs/[[...slug]]/page.tsx Outdated
<DocsPage
toc={page.data.toc}
className="!mx-0 min-w-0 justify-self-start md:!mx-auto"
footer={{

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

footer.component is deprecated in this fumadocs version (the DocsPageProps type marks it @deprecated use slots.footer instead). It works today, but prefer slots={{ footer: ... }} to avoid breakage on the next fumadocs major.

(For the record, re-adding <PageFooter /> here is correct: the Footer slot derives prev/next from context via useFooterItems(), so navigation is preserved.)

Comment thread docs-site/app/docs/[[...slug]]/page.tsx Outdated
component: (
<>
<div className="mt-10 mb-4">
<DocsPageActions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Design. These two actions now live in the footer while "Copy as Markdown" stays top-right next to the title (line 101), all three sharing the same actionClassName. Same visual family, two locations, so it reads accidental rather than grouped.

It's also inconsistent per page: the hero page skips the header block ({!hero && ...}), so it shows only these 2 footer actions, while every other page shows 1 on top and 2 at the bottom. Suggest grouping all three into one cluster (all top-right, or all in the footer).

Comment thread docs-site/lib/docs-markdown.ts Outdated

try {
return await readFile(directPath, "utf8");
await readFile(directPath, "utf8");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Minor: this reads the file just to test existence and throws the content away; readDocsPageMarkdown then reads it again; and page.tsx calls both readDocsPageMarkdown and resolveDocsPageMarkdownPath, so the direct-path file is read up to 3x per page. Build-time only, so low priority, but consider returning { path, content } from one function, or probing with access/stat instead of readFile.

);
assert.match(
html,
/https:\/\/github\.com\/Kaelio\/ktx\/issues\/new\?[^"]*template=bug_report\.yml/,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This asserts the href contains template=bug_report.yml, which is true regardless of whether the resulting issue is usable, so it would pass on the broken flow described in the page.tsx comment (the form ignores the prefilled body). Once "Raise issue" points at a docs-feedback template with id-based prefill, assert on the field params that actually populate.

@BittuBarnwal7479

Copy link
Copy Markdown
Contributor Author

Hey @luca-martial i've addressed the latest feedback and pushed the requested changes.

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.

Add "Suggest edits" and "Raise issue" to all docs pages

2 participants