frontend/rpcn: render field descriptions as prose, link each field to its docs - #2621
Merged
Conversation
Contributor
✅ Clean — no registry drift, off-token colours, or ad-hoc classesApp:
Generated by lookout audit-changes. |
SpicyPete
requested review from
a team,
datamali,
graham-rp,
sago2k8 and
yougotashovel
and removed request for
a team
August 28, 2026 22:10
Review pass aimed at PR size rather than behaviour. - Read the field docs URL off ResourceFieldContext (which already carries component identity) instead of adding a provider. The extra JSX nesting level had re-indented the whole form body: 296 changed lines -> 18. - Delete cleanText. markdownToPlainText(asciidocToMarkdown(x)) is byte-identical on all 235 component summaries, its only render site, and strictly better on descriptions, so the palette now uses that pair and reuses the markdown it had already converted. - Consolidate tests without dropping assertions: table-driven cases for the converter and getFieldDocsUrl, and three overlapping render tests merged. - Share one InlineHelp block between the short_description and single-paragraph paths. Diff against master: 1107 changed lines -> 772. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
| if (!description) { | ||
| return docsLink; | ||
| } | ||
| return <LongDescription docsLink={docsLink} source={description} />; |
Contributor
There was a problem hiding this comment.
HUMAN REVIEW: I think for docs link we should use a docs badge similar to how ADP does it, it's also a common pattern in the case of cloudflare which what we originally adopted/got inspired from, just sprinkling docs where relevant so it's interweaved with the user journey.
Contributor
Author
There was a problem hiding this comment.
I'm not seeing docs in ADP, can you attach a screenshot as an example?
Right now at he end of the descriptions we are showing the docs link + a docs icon
malinskibeniamin
approved these changes
Sep 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Field help text in the RPCN config form now renders the schema's prose properly instead of dumping raw AsciiDoc under the control, and every field links to its own heading in the docs.
FieldSpec.short_description(a markup-free one-liner) when the dataplane serves it; fall back to the AsciiDocdescription, which is still the majority path.FieldDescriptioncomponent: converts AsciiDoc to Markdown, and collapses long or multi-paragraph prose behind "Show more" so it doesn't bury the input. A single-paragraph description renders inline, so its docs link trails the sentence instead of claiming a row.rp-connect/utils/asciidoc.ts, shared by the palette, the form and the template gallery.Per-field docs links
getFieldDocsUrl(section, connector, path)deep-links a field's own heading on its connector reference page. The docs generator anchors each field heading with its dotted path, list markers dropped —batching.byte_size→#batching-byte_size,sasl[].aws.credentials.role→#sasl-aws-credentials-role— which is exactly the path the form already carries, so no new plumbing beyond a context holding the component's identity.Checked against the live docs rather than assumed: over 90 randomly sampled cloud component pages (all HTTP 200), 1,770 leaf-field headings resolve, with 3 (0.17%) anchored
-2because a prose section on the same page claimed the plain id first. Those land on that same-named section, and an anchor that misses at all leaves the reader at the top of the right page — never worse than the connector-level link we'd otherwise ship. Field headings sit in a flatFieldssection after the common/advanced tabs, so the anchor isn't buried in a collapsed panel. Verified end-to-end in localdev: all 13 links the form generated forinput: redpanda, nestedtls.*included, exist verbatim on the published page.Object-group headers (
batching,sasl) deliberately get no link — they carry no description, and they're where the-2collisions cluster (11 of 231).AsciiDoc rendering fixes
Found by reviewing the new converter against the bundled schema (
rp-connect-schema-full.json: 4,650 non-deprecated field descriptions + 439 component prose blocks), and each fix re-verified over the whole corpus:<<anchor, label>>cross-references were never convertedA database <\<drivers, driver>> to use.A database driver to use.— 0 leftsql_raw.queryand 4 others rendered| Driver | Style | |---|---|as literal text- Driver — Placeholder Style; 0 pipe rows left in 5,089 outputsformat=dsvtables split on the wrong separator- CHAR, VARCHAR:string- CHAR, VARCHAR — string, separator read from the table's own attribute linedsnfields showed[`clickhouse://[user[:pass]@]…`](https://…)verbatim, URL includedcleanTextapplied to multi-paragraph prose in template slots==== Drivers :driver-support: mysql=certified…into slot helpshortDescriptionuntrimmedKnown gap, not fixed here: the line-based block transforms aren't fence-aware, so a
----separator or a line like["a","b"]inside a ``` fenced example would be dropped. Zero triggers across all 49 fenced descriptions in the current schema, so it's latent rather than live — worth a follow-up rather than a restructure in this PR.Notes for review
node-config-form.tsxis an 18-line change: the field docs lookup rides onResourceFieldContext, which already carries the edited component's identity, rather than adding a provider (a second wrapper re-indented the whole form body for no benefit).cleanTextis gone.markdownToPlainText(asciidocToMarkdown(x))is byte-identical on all 235 component summaries — its only render site — and strictly better on descriptions, so there is now one way to flatten schema prose.text-body-smis thetext-xsrung and computes to 10.5px here, which is why the docs-link icon issize-3and positioned withvertical-alignrather than a flex box — a flex box baselines on the icon's bottom edge and drops the word below the prose.Testing
bun run type:check,bun run lint(clean tree), and the full rp-connect suites: 139 unit + 772 integration passing. New coverage: internal cross-references in both conversion paths, pipe-table and dsv flattening, bracketed link labels in both the rendered link and the collapsed preview, the field-level anchor contract (including nested paths through the form), and the two template-slot fallbacks.