Skip to content

Conversation

@m-hulbert
Copy link
Contributor

@m-hulbert m-hulbert commented Jan 20, 2026

Description

This PR adds a new nested table component described here: FTF-491.

It essentially allows for tables listing properties to be nested within one another when they reference a custom type, or enum.

This PR has several parts:

  • A new nested table component. It wraps existing markdown table syntax in <Table> tags with various variables controlling this. Using id ensures the table can be referenced in another table cell, with hidden ensuring it isn't rendered standalone in the output.
  • Ensures the hidden property is removed from markdown when rendering pages available as raw/copied MD to ensure LLMs do not ignore the content.
  • Updates the CONTRIBUTING guide with how to use the new component.
  • Temporarily includes a Chat JS API page displaying the component for testing purposes: the page is available here.
Screenshot 2026-01-20 at 19 43 11

Checklist

@m-hulbert m-hulbert self-assigned this Jan 20, 2026
@m-hulbert m-hulbert added the review-app Create a Heroku review app label Jan 20, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@ably-ci ably-ci temporarily deployed to ably-docs-nested-table--ljk6cz January 20, 2026 18:08 Inactive
@m-hulbert m-hulbert force-pushed the nested-table-component branch from 8ff275f to e0822dc Compare January 20, 2026 18:20
@m-hulbert m-hulbert temporarily deployed to ably-docs-nested-table--ljk6cz January 20, 2026 18:21 Inactive
Copy link
Contributor

@GregHolmes GregHolmes left a comment

Choose a reason for hiding this comment

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

I like this!

Copy link
Contributor

@aralovelace aralovelace left a comment

Choose a reason for hiding this comment

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

hi @m-hulbert this is great just a few small feedback


export const NestedTableExpandButton: React.FC<NestedTableExpandButtonProps> = ({ typeName, expanded, onClick }) => {
return (
<button
Copy link
Contributor

Choose a reason for hiding this comment

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

nitpick we might need to add ARIA attributes for screen readers

Comment on lines +28 to +36
useEffect(() => {
if (id && parsedProperties.length > 0) {
const tableData: TableData = {
id,
properties: parsedProperties,
};
register(id, tableData);
}
}, [id, parsedProperties, register]);
Copy link
Contributor

Choose a reason for hiding this comment

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

The useEffect that registers tables doesn't unregister on unmount, which can leave stale entries.

Suggested:

// In NestedTableContext.tsx - add unregister function
const unregister = useCallback((id: string) => {
  if (registryRef.current.has(id)) {
    registryRef.current.delete(id);
    setRegistryVersion((v) => v + 1);
  }
}, []);

// In NestedTable.tsx - add cleanup
useEffect(() => {
  if (id && parsedProperties.length > 0) {
    const tableData: TableData = { id, properties: parsedProperties };
    register(id, tableData);
    return () => {
      unregister(id);
    };
  }
}, [id, parsedProperties, register, unregister]);

const descriptionCell = cells[2] as ReactElement<{ children?: ReactNode }>;
const typeCell = cells[3] as ReactElement<{ children?: ReactNode }>;

const name = extractText(nameCell.props.children);
Copy link
Contributor

Choose a reason for hiding this comment

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

might need to add null check?

@@ -0,0 +1,93 @@
import React, { useEffect, useMemo } from 'react';
Copy link
Contributor

Choose a reason for hiding this comment

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

We might error boundary for parsing failures? what you think? @kennethkalmer ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-app Create a Heroku review app

Development

Successfully merging this pull request may close these issues.

5 participants