docs(frontend): document skills marketplace + packs data-flow

This commit is contained in:
Abhimanyu Saharan
2026-02-14 14:26:04 +00:00
parent 44e4499a26
commit 691fd11d10
5 changed files with 84 additions and 0 deletions

View File

@@ -48,6 +48,12 @@ const extractErrorMessage = (error: unknown, fallback: string) => {
return fallback;
};
/**
* Form used for creating/editing a marketplace skill source.
*
* Intentionally keeps validation lightweight + client-side only:
* the backend remains the source of truth and returns actionable errors.
*/
export function MarketplaceSkillForm({
initialValues,
sourceUrlReadOnly = false,
@@ -80,6 +86,13 @@ export function MarketplaceSkillForm({
);
const [errorMessage, setErrorMessage] = useState<string | null>(null);
/**
* Basic repo URL validation.
*
* This is strict by design (https + github.com + at least owner/repo)
* to catch obvious mistakes early. More complex URLs (subpaths, branches)
* are handled server-side.
*/
const isValidSourceUrl = (value: string) => {
try {
const parsed = new URL(value);

View File

@@ -26,6 +26,13 @@ export const SKILLS_TABLE_EMPTY_ICON = (
</svg>
);
/**
* Small helper for supporting both controlled and uncontrolled table sorting.
*
* TanStack Table expects a `sorting` state + `onSortingChange` callback.
* Some pages want to control this from the URL (shareable links), while others
* are fine letting the table manage it internally.
*/
export const useTableSortingState = (
sorting: SortingState | undefined,
onSortingChange: OnChangeFn<SortingState> | undefined,