react-resource-view
Changelog
What each release of react-resource-view added, fixed and changed.
Read from the CHANGELOG.md that Changesets maintains in the repository, so a release appears here as soon as its version is merged. Dates and download links are on the GitHub releases, and the package itself is on npm.
2.4.0#
Minor Changes
- Added:
{ field }inviews.list.bulkActions, which sets one field of every selected record to a value picked from the options of its select input, instead of a hand-writtenBulkActionInterface- One update per record, one after the other, through the repository's update (a PATCH on the usual dialects); recordspermissions.updaterefuses are left alone. - The bar says how many records were updated and how many failed. A field with no select options draws no button. - The grouped delete now says how many records were deleted and how many could not be, instead of only the failures. - Exports theSetFieldBulkActiontype. - Added:
views.delete.deleteMode: "undo", which deletes a record without a confirmation: the row disappears at once and a toast offers "Undo" for a few seconds- "Undo" puts the row back without any request. Onceviews.delete.undoDelay(5000 ms by default) is over, or when the page is left, the DELETE is sent; if the API refuses, the row comes back with an error message. - Applies to the delete button of a row and of a record's page, which goes back to the list."confirm", the confirmation dialog, stays the default. - The grouped delete ofbulkActionsand the/deleteroute keep their confirmation.
2.3.0#
Minor Changes
- Changed: the command palette (Cmd+K / Ctrl+K) of
AdminLayoutandcreateAdminLayoutis on by default, instead of staying off untilcommandPaletteis set- Without the option, the palette opens and lists the menu's resources and the creations they permit, without searching records.commandPalette: { searchable: true }also searches records. -commandPalette: falseturns it off, for an application that uses Cmd+K / Ctrl+K for something else. - Added:
layout.feed(), a journal or activity feed — the records as dated events, gathered by day under "Today", "Yesterday" and the date, along a vertical thread- Options:dateField(defaults to"createdAt"),titleField,descriptionField,actorFieldwith itsavatarField,typeFieldwith atypestable of icons and colours, andorder(the most recent first by default). - Each event shows its relative time with the full date as a tooltip and for screen readers, and its title is the link opening the record'sreadview (updatewhenreadis not permitted). Filters, search, saved views and pagination work as on the other layouts. - ExportsListFeed,FeedLayoutOptionsandFeedTypeStyle. - Added:
npx react-resource-view generate --hydra <url>declares the resources of an API Platform API from its Hydra documentation (/docs.jsonld), instead of writing each one by hand- One file per class the API's entrypoint lists, with itspath, an input per property and a table. The URL may also be the root of the API, or a local file. - Property types pick the control: strings, numbers (xsd:integer,xsd:decimal), booleans as a switch, dates and date-times as a date picker, and relations as a search select (a multiple one for a to-many relation) searching the related resource. - Read-only properties are left out of the form, and the operations a class exposes become the resource'spermissions. - Files are registered in the scope and never overwritten without--force, likegenerate resources. - Added: ready-made navigation adapters for React Router v7 (
react-resource-view/react-router) and the Next.js App Router (react-resource-view/next), next to the TanStack one, instead of writing the four navigation primitives by hand-configurePorts({ navigation: reactRouterAdapter })orconfigurePorts({ navigation: nextAdapter })is all it takes. - Both routers are optional peer dependencies, loaded only by the application importing the adapter; the core still imports no router, andpnpm run sizenow checks it. - The React Router adapter reports a navigation in progress with a data router; the Next.js adapter does not, as Next.js exposes no such signal. The Pages Router is not supported.
Patch Changes
- Fixed: the development checks of
createViewResourceandlayout.*no longer run in a production build, instead of throwing there too and leaving the application on its error screen- Since 1.0.0, the package build replacedprocess.env.NODE_ENVwith"development"indist/, so the checks ran whatever the application's mode.dist/now leaves the expression to the application's bundler, which sets it to"production"for a production build. - A tab declared with a resource id (tabs.items[].resource: "users") is still checked in development, and that resource must be declared before the one holding the tab. Passing the resource itself (resource: usersResource) does not depend on the order.
2.2.0#
Minor Changes
- Added: a "Shown fields" menu next to a list's filters hides and shows fields in every layout — table, cards, board, calendar, gallery, items, split — instead of only a table's columns, one table at a time-
views.list.fields: { toggle, persist, hidden }: the menu (on by default), where the choice is kept ("local"orfalse), and the fields hidden until the reader shows them. - Fields are data keys, nested ones included: hidinguserhidesuser.name;user.emailcan be hidden alone. -<Field name="price">…</Field>anduseFieldVisible("price")let a list component of your own follow the menu;useFieldVisibility()reads and changes the whole choice. - The choice is kept per resource, shared by its layouts, through the newfieldVisibilityport ofconfigurePorts(read,write, optionalsubscribe):localStorageby default, SSR-safe, or an API. - The table's "Properties" menu keeps the column order; the columns hidden there before are carried over to the new store the first time the list opens. - Saved views and presets remember the fields hidden ashiddenFields; a view saved withcolumns.hiddenstill applies it.
2.1.0#
Minor Changes
- Added:
layout.table({ virtualize })draws only the rows on screen past 200 rows, instead of mounting every row of the page — a table of thousands of records opens, scrolls and restyles like one of fifty- On by default above 200 rows;virtualize: truealways,virtualize: falsenever,{ threshold, overscan }sets the number of rows and how many are drawn beyond each edge of the screen (8 by default). - The table stays a<table>: the rows off screen are spacer rows of their measured height, the header and the pinned cells are untouched, and column widths are held while scrolling. - Groups (folded or not) and views opened inline under a row are virtualized as one flat list. - _Select all_ and bulk actions work on every record of the page, drawn or not; ↑ / ↓ and Ctrl+Home / Ctrl+End move to another row and scroll to it; the table carriesaria-rowcountand each row itsaria-rowindex. - New dependency:@tanstack/react-virtual.
Patch Changes
- Changed: the built-in components no longer compile to selectors that make Chrome restyle the whole page when a window opens or closes, instead of
:has()placed before the element it styles and~between any two slots- Applications scanningreact-resource-view/distwith@sourceno longer getgroup-has-*,has-[…]:*:orhas-[…]:[&>…]:rules (field, checkbox, item, alert dialog, button group), nor[data-slot] ~ [data-slot](button group). On a page of tens of thousands of nodes, each of them cost hundreds of milliseconds per opening or closing of a dialog. - The same rules are written with a class as the subject, the:has()on the styled element itself, or:nth-child(n + 2 of [data-slot]): the components look the same, at the same specificity or higher. - An application that worked around these classes with@source not inline(…)can drop that workaround.
2.0.0#
Major Changes
- Breaking: the index no longer re-exports the internal helpers nor the testing tools: these names can no longer be imported from
react-resource-view, their code stays in its moduleRemoved from the index, to be released with version 2.0.0:-onResourceViewDefaultsChange(marked@internal) andgetRegisteredOpenFrames-BUILT_IN_OPENandresolveOpen-adoptResourcesanduseInlineClaim-writeOptimistically,isOptimisticandnotifyWriteError-joinPath,appendBracketParamandflattenStrapiRecord-PermissionCacheContext-resetApiConfig, for tests -HeaderandContentList, internal components of the list view (names that collided with the router's)None of these names is used by the documentation or the website.@internaldeclarations no longer appear in the published.d.tsfiles (stripInternal). A test now freezes the list of public exports: any addition or removal changes it.
Minor Changes
- Added:
commandPaletteonAdminLayout/createAdminLayoutopens a Cmd+K / Ctrl+K palette built from the scope — go to a menu entry, start a creation — and lists only what the resources permit, instead of leaving the back office without keyboard navigation.-commandPalette: { searchable: true }also looks records up by thetitleFieldof each resource, sent as a filter like the list's own. - The palette is arole="dialog"holding acomboboxand alistbox; Escape closes it. - Changed:
afterSave: "read"onviews.createandviews.updateleads to the page of the saved record, anduseFormByResourcefills the form itself when the record arrives, instead of a view copying the synchronisation ofEditView-"read"is accepted by the development validation next to"close","stay"and"reload". - A form handed adataof its own (a row of a list) keeps that record and is not refilled. - Changed:
layout.board({ groupBy: "status" })draws one column per option of the form'sstatusinput, instead of asking forcolumnsnext to theoptionsit already declares-columnsstays available to reorder the columns or show only some of them. - In development, a board withoutcolumnsis refused only when the input it groups by has nooptionsto read them from. - Added:
layout.board({ columns })accepts a function({ viewResourceContext, rows, defaults }) => columns, read again at each render, andhideEmpty(on the board or on a column) hides the columns holding no card except while a card is dragged, instead of replacing the whole board list component to do either-defaultsare the options of the form's input the board groups by. - "Move to…" still lists every column, hidden or not. - Changed: below
sm, the calendar's month view shows the initials of the days, one dot per event and the list of the tapped day underneath, instead of titles cut to "02:" in 44 px cells. - Changed:
layout.cards({ frame: false })drawscomponents.rowon its own, without border, padding or actions footer, andactions: falseremoves the actions footer of a framed card, instead of always wrapping the row in a card of its own- A row component that already draws its own card no longer gets a double frame; selection and opening keep working. - The codemod writesframe: falseon cards whosecardViewOptionFactoryhad arowComponent. - Added:
createPage("help", { name, icon, component })declares a page without data (a home, a help, a dashboard): a menu entry and a route to a component, with nocreate,read,updateordeleteroute and no request to the API, instead of acreateViewResourcewith every permission turned off and a fakegetCollection.-migratewrites a 0.x resource made only of a name, an icon and aviewComponentascreatePage, and no longer reports RV1-PERM-002 on it. - Changed: in development, a tab with neither
resourcenorcomponentor whose resource is an unknown id, alayout.chart()with neithergroupBynordateFieldand alayout.cards({ columns })outside 1 to 6 throw an explicit error, instead of passing silently. - Added:
ChartAggregate,ChartInterval,BaseJsonLdItemInterfaceandDefinitionProblemtypes are exported, as isinspectDefinition, which lists the problems of a declaration without throwing, so it can be tested in CI. The README shows a vitest example. - Added:
npx react-resource-view generate resourceswrites one resource declaration per collection of the OpenAPI schema, instead of leaving everycreateViewResourceto be written by hand afterinit- Reads OpenAPI 3.0/3.1 and Swagger 2.0 (API Platform, FastAPI, Supabase…) from a file or a URL — by defaultsrc/api-schema/openapi.json. - Writes thepath, theform.inputs(enums as selects, IRIs and foreign keys as searchable relations, dates, numbers, booleans), thepermissionsthe exposed operations allow, a table, and a board when an enum namedstatusis among the inputs. - Registers the resources in the scope'sresources;--only books,authorsrestricts them,--dry-runlists the files, and no existing file is overwritten without--force. - Added:
react-resource-view/i18nexportsmessages, the English reference of every message the library shows, andmissingKeys(dictionary), which lists the keys a dictionary leaves untranslated, instead of copying the keys by hand into each project-messagesis keyed on the English text:messages["Saved"] === "Saved". A dictionary for another language has one entry per key. -missingKeysreturns the keys without an entry, and those with an empty one. Call it from a test to fail when a new version of the library adds a message your dictionary does not translate. - The documentation has an "i18n" page that shows how to merge the catalogue with your own keys. - Added:
layout.gallery({ imageField })draws a grid of cards headed by a picture, for products, articles or profiles-imageFieldis typed on the item and accepts an URL, a data URL, a media object ({ url, name }) or a list of them; a record without an image gets a placeholder, and the pictures load lazily. -aspect("4/3","1/1","16/9"),fit("cover","contain"),titleField,columnsandfieldsshape the cards. - Changed: below
sm, the layout switcher shows the icon of each layout alone (its name stays the tab's accessible name), instead of cutting the last tabs off at 390 px. - Changed: an empty list tells "nothing yet" from "nothing matched", draws the resource's own icon and name, and offers to clear the filters when one is active, instead of always saying "Nothing matched your search"- New
views.list.empty: { icon, title, body, filteredTitle }declares them without a component;icondefaults to the resource'sicon,titleto "No <name> yet". - The create button only shows wherepermissions.createallows it. -components.emptystill replaces the whole state. - Added: two media controls,
createMediaImageInput(one image: preview, replace, crop, remove) andcreateMediaFilesInput(a list of documents: name, type, size, preview or icon, download, removal), which keep the file as base64 in the record instead of requiring an upload API- Options:accept(MIME types,image/*families or extensions),maxSize,maxFiles,dragAndDrop,crop: { aspect }; a refused file is named under the field with the reason, throughreact-mini-i18n. -storechanges what becomes of a file: a data URL by default (storeAsDataUrl), or the URL returned by a function that sends it to the API. -components: { dropzone, imagePreview, fileItem }replaces part of the rendering;mediaImageInputControllerFactoryandmediaFilesInputControllerFactoryset these options once for the whole application. - Outside a form,MediaValueshows a thumbnail for an image and an icon with the name for a document: on a detail page, in a table cell (two files then "+N") and on the cards, instead of the raw base64. - Added:
mobileNavMaxItemsonAdminLayout/createAdminLayout(4 by default) caps the entries of the mobile bottom bar; the following ones move into the "More" drawer, ahead offooterMenu, and "More" is marked current when the page on screen is one of them. - Changed: a burst of realtime pushes is read once, 250 ms after the last one (
realtime: { debounce }to change it), and a read that a newer one replaces, or that the unmount outlives, is aborted:ResourceContextcarries asignalthat the REST repository passes tofetch, instead of five full reads of the list whose stale answers were only dropped on arrival. - Added:
realtimeaccepts{ subscribe, withCredentials }: the channel is pluggable (Supabase Realtime, SSE, WebSockets), and Mercure reconnects with a growing delay and reads the views again when the hub comes back, instead of closing for good after an HTTP error. - Changed: a hand-written
repositoryanswers{ items, totalItems }and always receives{ id: string }, instead of a JSON-LD collection and an id that was sometimes the item, the IRI or the bare segment-getCollectionaccepts{ data: { items, totalItems, nextCursor? } }without a cast;createResourceCollectionand JSON-LD collections still work. -getItemandremoveItemreceive{ id }andupdateItemthe record with itsid, always the short identifier as a string. A repository that read the@idof the item it was given must readidinstead. - NewidFieldon the resource: links, keys and selection are built from that field, so the records need no@id. - Added:
restDialectdescribes a common REST API through configuration (X-Total-Count,Linkheader, cursor pagination), with thejsonServerDialectanddrfCursorDialectpresets andinit -b json-server, instead of requiring a hand-written dialect - Changed: below
sm, the table's row actions fit in a 56 px "…" menu instead of two text buttons that took half the screen - Added:
views.list.savedViews: trueadds tabs of saved views above a list — a name over its filters, sort, layout and columns, created, renamed, duplicated and deleted by the reader — andviews.list.presetsdeclares typed ones in code, instead of a combination that cannot be named nor linked to- A view has a URL:?savedView=<id>applies it, next to thefilterandvariantit sets. - The views a reader saves are kept by the newsavedViewsport ofconfigurePorts:localStorageby default, or four functions (list,create,update,remove) to share them through an API.SavedViewsStoreInterface,SavedView,ListPresetandlocalSavedViewsStoreare exported. - In development, a preset without a name, with an undeclared layout or with the id of another is refused. - Added:
singleton: { get }orsingleton: { id }declares a resource with a single record (settings, a profile): its menu entry opensupdate(orread) directly, and draws the creation form, pre-filled withdefaultData, when the record does not exist, instead of a hand-made list filtered down to at most one item.-get(context)resolves to the record, or toundefined/nullwhen there is none; withid, a 404 from the API means the same. - Saving a new record stays on the page and turns it into the editing form;afterSavestill applies. - Added:
storage: { type: "local", seed: Item[] | () => Item[] }fills a resource kept in the browser with its first records, written once and only while the storage is empty, instead of writing the Hydra collection into the storage key by hand - Changed: the submit button of a form reads "Save" on an edit screen and "Create" on a creation one, instead of the name of the action ("update"), so
label.submitis no longer needed to get those words- Alabel.submitdeclared in the form still wins. - Added:
layout.table({ groupBy })andlayout.cards({ groupBy })section the rows by a field, one foldable section per value with its count- The sections are headed by the labels of theoptionsof the form's select input, in its order; the records with no value are gathered under "No value", last. - Each header is a button witharia-expanded; every section starts open. - The Properties menu of the table gains a "Group by" choice among its select fields, remembered per resource and layout like the columns. - Only the page on screen is grouped, and a note says so when the API holds more records. - Added: three new list layouts —
layout.tree()(each record under its parent, collapsible branches),layout.map()(one marker per record on tiles from any server, with no new dependency) andlayout.chart()(count, total, average and bars per value or columns per period), all API-agnostic
Patch Changes
- Fixed: the JSON-LD dialect reads
hydra:title,hydra:descriptionandhydra:violations(API Platform 3's default error format), instead of showing a 400 error with no explanation. - Fixed:
ApiUrishows a fallback instead of an endless loader when the relation responds with an error,noCacherereads an iri that is already cached, a changediriis picked up, and the cache is invalidated when the linked resource publishesonChange. - Fixed:
hooks.beforeListreceives the view's filter already merged and has the last word, instead of seeing the filter added after it returned (asearchrenamed toqwent out with both keys, a removed key came back) - Added: a resource can let a board's cards be moved without offering the update form (
permissions: { update: false, move: true }), instead of locking the cards as soon asupdateis refusedThe newmovepermission answers asupdatedoes as long as it is not declared: nothing changes for a resource that does not mention it. Themigratecodemod puts aTODO(RV1-PERM-008)onupdatewhencanUpdateis refused on a declaration that draws a board — in 0.x, its cards moved anyway. Documented inMIGRATION-1.0.mdandmigrations/1.0.json. - Fixed: on a board, records whose
groupBymatches no column (null, unknown value) fall into a "No value" column (showUnassigned,unassignedLabel), and1finds the"1"column, instead of disappearing without a sign. - Fixed: clicking a day of the calendar opens the create view, with the date filled in and no id, where
views.create.opensays, instead of adding a second "create" link under the calendar - Fixed: the month's cells and the calendar's week and day slots create a record from the keyboard (Tab, then Enter or Space), and the Day/Week/Month tabs keep their label for screen readers on a phone, instead of being click-only
divs and tabs reduced to an icon - Fixed: the calendar's month view names its days from the locale's first day of the week (Sunday in en-US), instead of staying fixed from Monday to Sunday above columns that start elsewhere.
- Fixed: a word that is not a command (
migrat,wombat) exits with code 1 and suggests the closest command ("Unknown command "migrat" — did you mean migrate?"), instead of creatingsrc/views/migratLayout.tsx;helpprints the help instead of creatinghelpLayout.tsxhelp [command]and--version/-vwork, and the help lists the options under the command they belong to. The shortcut without a command (npx react-resource-view Heatmap) still works, but only for a name that starts with a capital letter. - Fixed:
configureApi'sbaseUrl,fetchandgetHeadersalso apply to the default JSON-LD dialect, andbaseUrlandgetAuthTokenreach Mercure, instead of being ignored - Fixed: the CSV export prefixes with an apostrophe the cells that start with
=,+,-,@, a tab or a carriage return, instead of letting Excel or LibreOffice run them as formulas when the file is opened (CSV injection, OWASP); the JSON export is unchanged - Fixed: a custom dialect that reads
payload.rowsfills the list, instead of showing it empty because it read the already normalized envelope again - Fixed: with FastAPI, Django or Spring and a primary key other than
id, opening a record callsGET /articles/hello, instead of the collection's URL - Fixed: in the calendar and the timeline, a date without a time (
2026-10-23) falls on the right day in every time zone and is shown without a time, instead of being read as UTC ("02:00", or the day before in the Americas) - Changed: a development error points to
MIGRATION-1.0.mdandnpx react-resource-view migrateonly when it reports a 0.x key, instead of ending every error — a typo in a 1.x declaration included — with it- An option a layout names differently is suggested under its name there:layout.timeline({ dateField })suggestsstartField(andlayout.calendar({ startField })suggestsdateField), instead of the closest spelling,titleField. - A misplacedgroupBylistslayout.chart({ groupBy })among the layouts that take one. - The hint fortitleKey(RV1-VIEW-008) names the layouts that take atitleField— board, gallery, calendar, timeline, tree and map — instead of "on a layout", whichlayout.table({ titleField })refuses. - Fixed: a resource declared before
configureApi({ dialect })speaks the configured dialect, instead of staying on JSON-LD forevercreateRepositorychose between the JSON-LD repository and the REST repository when the resource was declared. Resources being declared by imported modules, hence before the body of the entry point that callsconfigureApi, a Strapi or Supabase application split across several files spoke JSON-LD without a word. The choice is now made on every request; a resource that declares its owndialectkeeps its backend. - Fixed: field names (
titleField,groupBy,form.inputs…) are also checked on an item that extendsBaseJsonLdItemInterface, instead of accepting any string because of its index signature. - Fixed: changing a filter brings the list back to page 1, instead of keeping the current page and showing "No results yet" without pagination
- Changed: the keys of
form.inputsare checked against the item:inputs: { titel }is a TypeScript error, instead of compiling silently. A field that does not exist on the item (a password confirmation…) is declared in the second generic,createViewResource<User, User & { confirm: string }>;filters.inputsstays free, and the README says so. - Fixed:
init -b supabase -u https://<ref>.supabase.cofillsSUPABASE_PROJECT_REFin.envfrom the URL, and ends onmake api-schema(which reads.env) instead ofpnpm run api-schema, which failed on the empty project id - Fixed: on an items or tree layout, a record still being created shows no action buttons, as a table row does, instead of offering update and delete on a row that has no identifier yet.
- Fixed:
createViewResource<Row>accepts the real type of a Supabase, Strapi, FastAPI, Django or Spring row, without"@id", instead of refusing the type or pushing to lie about it - Fixed: on the default JSON-LD backend, an array filter goes out as
status[]=a&status[]=b, instead ofstatus=a&status=b, of which API Platform kept only the last value - Changed: in development, a JSON-LD
pathwithout a leading/throws an error instead of targeting the wrong host, andrealtime: trueon apathoutside/api/warns that it subscribes to nothing, instead of staying silent. - Fixed: the JSON-LD dialect returns ids as strings, so a custom repository answering
{ id: 5 }no longer crasheslayout.split()withid.split is not a function. - Changed: switching layouts writes
variant=<id>into the URL, asfilterdoes, instead of keeping it in memory only: a reload or a shared link finds the chosen layout again. A list nested in a tab leaves the URL alone. - Fixed: the board, calendar, timeline and split layouts show the pagination, instead of stopping at the first page with no way to reach the other records.
- Changed:
createViewResourcealone weighs under 50 kB minified instead of 191 kB: the layouts, the views and the dialog/drawer frames are loaded the first time they are drawn, not bundled by every resource declaration. - Fixed: the list always sends its page size (30 without
views.list.pageSize), instead of letting Spring answer 20 rows and Strapi 25 while the pagination counts 30 - Fixed:
storage: "local"paginates and sorts on the client instead of emptying the list and the export as soon aspageSize, a sort orpageenters the filter - Fixed: a malformed
?filter=or?defaultData=in the URL is ignored (with a warning in development) and the view is shown, instead of throwing aSyntaxErrorthat brought down the wholeResourceViewProvider - Fixed: the
migratecodemod rewritestableViewOptionFactory()without an argument tolayout.table(), and a factory called with a variable tolayout.cards(opts)flagged for a manual review, instead of crashing on a TypeError that does not name the fileA file the migration cannot read or rewrite is now named with its error and left as it is; the other files are processed anyway, and the command ends with code 1 — the project is no longer left half migrated without knowing where. - Fixed: the
migratecodemod exits with code 1 on a path that does not exist and processes.mts,.ctsand.cjsfiles, instead of announcing "0 files rewritten." and letting--checkpass in CIErrors (unknown option, missing path, file that cannot be migrated) are written to stderr, no longer to stdout. - Changed:
Button,BadgeandTabsTriggertransition only their colors, border, shadow and transform, instead of every property-transition-allbecomestransition-[color,background-color,border-color,box-shadow,transform], as in the Brand Assets design system. Size and layout changes (a width set by the application, for instance) are no longer animated. - The default theme sets--heading-weightto 600 and--heading-trackingto −0.02em, instead of 800 and −0.025em: headings are lighter. - Fixed: a page beyond the last one (after a deletion or through a
?filter={"page":50}link) brings the list back to its last page, instead of an empty screen without pagination. - Fixed: the pagination's ellipses are no longer buttons, instead of sending page "...." to the API
- Fixed: under
prefers-reduced-motion: reduce, dialogs, alert-dialogs, popovers and selects no longer grow when they open: they only fade - Fixed:
setSelected,isSelectedandonSelectedselect a record by the identity the dialect reads, instead of accepting only those that have an@id(Strapi, Supabase, FastAPI, Django, Spring) - Fixed: the delete view is shown on a full page (direct route
…/delete/1,views.delete.open: "page") instead of throwingDialogRootContext is missing, and "Cancel" goes back to the list there. - Fixed: the delete view shows the loading error with "Try again" when the record does not load, and "Continue" is disabled during the call, instead of leaving the dialog empty and sending two DELETE requestsA failing
getItem(404, 403) left the body of the dialog empty, with no message and no way back. Withviews.delete.optimistic: false, a double click on "Continue" sent two DELETE requests: the button is now disabled during the deletion, in its destructive variant, and becomes active again if the API refuses. - Fixed:
views.list.rowActionsrejectsActionList.createandActionList.listat compile time, as it already rejected"create"and"list", instead of accepting them. Onlyread,updateanddeleteare accepted, written as strings or as the enum. - Fixed: the links of the row actions, the split, the timeline, the calendar and the chart carry the identifier read by the resource's dialect (Strapi's
documentId, Supabase's primary key), instead of the global dialect's - Changed: the selection checkboxes of the table, cards, items, tree and gallery are named "Select <title>" (from
titleField, thentitle,name,label, then the id) and the table's actions column header carries a screen-reader "Actions" label, instead of every checkbox being called "Select" and the header being empty - Fixed: in a list, the bulk action bar only appears in the layouts that have a selection (table, cards, items, tree, board, or a
layout.customthat declaressupports: ["selection"]); when switching to the calendar, the map… the selection is set aside instead of staying active on invisible rows. - Fixed: a selection is cleared when the page, the filter or the sort changes, instead of reappearing on the way back to the page with a bulk action ready to act on it
- Fixed: in the split layout, "Back to the list" closes the detail and the id follows the URL (the Back button included), instead of leaving the detail shown on a phone.
- Changed: list rows (table, cards, items, split) are keyed by the identity of their record instead of
JSON.stringifyor the index, so an edited or optimistically created row keeps its DOM node, focus and local state. - Changed: the starter generated by
initsplits React, the router and the UI dependencies into their own chunks, so its firstvite buildends without the "chunks are larger than 500 kB" warning, instead of one 687 kB entry chunk. - Fixed: the sticky row-actions column of the table took the page's colour instead of the card's, drawing a darker band from the header down, ignoring hover and selection and overflowing the card's rounded corner; it now follows the card and the row, its shadow only shows while the table scrolls, and Delete is muted until hovered, with a gap between the buttons
- Fixed: on a timeline, a
groupByfield holding a number or a boolean (0andfalseincluded) forms one group per value, instead of putting every row in "Unassigned". - Fixed: an unknown resource throws
Resource "x" is not registered. Registered: …and an action without a viewResource "x" has no "update" view. Available: …, instead of "View not found" in both cases - Fixed: without a total returned by the API, the list offers "Previous / Next" and the export reads every page, instead of believing it has only one page
- Fixed: a view refuses an identifier from its URL that is the IRI of another resource or an absolute URL, and shows a load error, instead of reading — and saving — whatever the IRI designates (
/books/update/%2Fapi%2Fusers%2F1calledGET /api/users/1)- An identifier holding a slash is accepted only as an IRI one segment under the resource'spath. - The JSON-LD dialect no longer calls an absolute URL given as an id, which would have sent the bearer token to that host. - Changed: the development validation checks the values of
rowActions,open,afterSave,pageSize,permissionsandlayouts, and reports a table declared withoutform, instead of letting them fall back silently on a default. - Changed: the development validation cross-checks
groupBy,fields,sort.fieldsandtitleFieldagainstform.inputs:statussortitelgive a "did you mean … ?" warning instead of passing silently (a warning, to let computed fields through). - Changed: the development validation also checks the keys of
form,filtersandsort:inptus,intialorfeildsthrow "did you mean … ?" instead of being ignored without a word. - Fixed: the pagination and the views' labels go through the dictionary, with English keys, instead of staying in French or hard-coded — the half-translated "Showing 1 to 30 of 31 results" becomes a key with variables
- Changed: a write that fails without an answer says "The server could not be reached.", and one the API refuses without a detail (an HTML 500) shows its status, instead of a bare "An error occurred"The toast of
useResourceMutationand the one of the forms now follow the same rules as the load error: the API's detail when it gave one, else "<status> — The server answered with an error.", else, for afetchthat never got an answer, "The server could not be reached.".
1.2.2#
Patch Changes
- Fixed: the README and the starter written by
initlink api-dumper atgithub.com/hermez-agency/api-dumper, where the repository moved
1.2.1#
Patch Changes
- Fixed: dialogs, drawers, popovers and selects fade in and out, instead of appearing and disappearing at once-
dialog,alert-dialog,popoverandselectwere animated withanimate-in,fade-in-0,zoom-in-95andslide-in-from-*. These classes do not come from Tailwind: they belong totailwindcss-animate/tw-animate-css, which is neither installed nor imported — so they generated no CSS. They are replaced by transitions onopacityandscale, driven by Base UI'sdata-starting-style/data-ending-styleattributes, asdraweralready does. Nothing to install on the application's side: these are core Tailwind utilities. - A view opened in a dialog or a drawer animated neither its entrance nor its exit, whatever the CSS: the frame was mounted already open, and closing it changed the URL, hence unmounted it, before the transition could start. It now opens just before the page is painted without it, and the URL changes only once the exit transition has ended. - The popup of aselectaligned on its trigger (alignItemWithTrigger, the default) stays without animation: the selected item is laid over the button there, and growing it would make it slide off.
1.2.0#
Minor Changes
- Changed: a host configures the admin layout through its options, instead of patching it from the outside- A scope's menu keeps the getters of its entries: a name that follows the language, a link that follows the reader's last choice, are read again on every render instead of being frozen when the scope loads. -
MenuItemInterface.badge: a component drawn at the end of the entry (a counter), without replacing the entry with acomponentthat redoes its link and its active state.useIsActiveMenuEntryis exported for the entries that still have one. - The bottom bar on a phone carriesdata-slot="admin-mobile-nav"andaria-current, and its entries share its width instead of scrolling sideways. -SidebarInsetismin-w-0: afullWidthview wider than the screen no longer pushes the top bar off the screen. - The breadcrumb is cut to the room the bar leaves it, instead of running under its end. - A list's icon lines up with its title (data-slot="list-header-title"), and the cards of a board column carrydata-slot="board-column-cards". - A list's "create" button takes the rest of its line on a phone, next to the layout picker, instead of a line of its own. - The filter bar no longer widens its content tofit-content: the application's filters that wrap do so at the width of the list. - A view opened in a dialog no longer exceeds the height of the screen: the title keeps its line, the content scrolls in the rest. - Changed: the list's export button offers CSV and JSON and reads every page itself, instead of downloading a server CSV- The rows are read page by page through the resource's repository, with the list's current filters and sort, so the export works on any dialect — Strapi and local storage included — and the button shows how many rows have been read so far. - Only the columns the table shows are exported. CSV cells holding commas, quotes or line breaks are quoted, and the file opens in Excel with its accents intact; JSON keeps the raw values. -
dialect.exportRequestis no longer used by the button. - Added: the table's columns are shown, hidden and reordered from a "Properties" menu, as in Notion, without touching the declaration- A box per column shows or hides it, a handle drags it elsewhere (Alt + ↑ / ↓ from the keyboard); the table keeps one column at least. - The choice is kept in
localStorage, per resource and per layout (react-resource-view:columns:<resource>:<layout>). The declaration stays the default: "Reset to default" forgets the choice, and a field added to the form later appears where it is declared. - Added: Shift+click on column headers sorts a table on several columns, with their rank shown, instead of replacing the sort- A plain click still goes ascending, descending, then no sort, on that column alone; Shift+click keeps the other sorted columns and queues the clicked one behind them (a column already sorted keeps its rank while its direction moves on). - Once two columns or more are sorted, each header shows its rank next to the arrow. The sort stays in the URL and goes to the API as
order[field]=asc|desc, in that order.
Patch Changes
- Fixed: the
react-data-formandreact-mini-i18npeers accept their current releases (^0.3.0,^0.1.0 || ^0.2.0), sopnpm add react-resource-view react-data-form react-mini-i18n resource-registryinstalls them instead of react-data-form 0.1.0- In 0.x a caret pins the minor:^0.1.0ruled out react-data-form 0.2 and 0.3 and react-mini-i18n 0.2, which only add features.initwrites the same ranges into a new starter. -react-mini-i18nkeeps^0.1.0alongside^0.2.0: react-data-form 0.3.0 still asks for^0.1.0, and npm would otherwise refuse the install withERESOLVE.
1.1.0#
Minor Changes
- refactor: the optional
react-resource-view/styles.csstheme now follows the Hermez design system, not shadcn's neutral greysVisible only to applications that import the library's stylesheet; an application with its own shadcn variables sees nothing change.- Colours: warm "stone" greys (background#fafaf9, cards#ffffff, text#1c1917, secondary text#57534e, borders#e7e5e4, fields#d6d3d1), an orange primary#bf4a02under white text, the brand orange#e46212as focus ring, and#fff6eeas highlight. The.darkblock keeps the same hue (background#0c0a09, primary#ff8b44). The destructive red is#b91c1c, so the destructive button reaches 4.5:1. - New tokens:--success,--info,--gloryand--warning(thesuccess,info,gloryandwarningbuttons and badges had no colour until now),--chart-1to--chart-5, and the typography variables--typeface-heading,--typeface-body,--typeface-mono,--heading-weight,--heading-tracking(withfont-heading,font-sansandfont-monomapped to them). - Radius:--radiusgoes from0.875remto0.75rem, and--radius-2xlto--radius-4xlnow derive from it — buttons, selects and badges stay pills, slightly tighter, and follow a custom--radius. - Shadows:shadow-sm,shadow-mdandshadow-lgare tinted with the theme's text colour, lighter than Tailwind's. - No font is shipped and no rule restyles the application's headings:--typeface-headingnames Bricolage Grotesque, used only if the application loads it. The variables stay in@layer base, so the application's own still win.
Patch Changes
- fix(views): the table keeps its row actions in sight when it is wider than the screen, instead of pushing them out of view- The actions column and its header are
position: stickyon the right edge, opaque, with a shadow on their left; the buttons are at least 40 px wide and tall. A fade on the table's edges tells that columns are hidden on that side. -layout.table({ stickyActions: false })leaves the actions in the flow;layout.table({ stickyFirstColumn: true })also pins the first column to the left.
1.0.0#
Major Changes
- 1.0: a declaration that reads once and makes sense without the documentation. Breaking changes, each one rewritten by
npx react-resource-view migrateor explained step by step inMIGRATION-1.0.md;migrations/1.0.jsonis the same list as data, for a script or an AI to apply.- **One place per notion.**viewis gone: what every action shares —form,fullWidth,titleField,components,description— sits at the root of the resource; what belongs to one action sits inviews.list | read | create | update | delete, each typed with only the options that have an effect there. Root, action and layout are merged deeply, soviews.updatesays only what differs, andinputs: { notes: false }removes an inherited field. Actions are plain strings (views.update,rowActions: ["read"]);ActionListis still accepted. - **Permissions.**canRead,canList,canCreate,canUpdate,canDeleteandbehavior.canExportbecome onepermissionsobject —"all","readonly", a list of actions, or a boolean or a function per action. Everything is allowed by default, so the shortest declaration has all its buttons. A function is told the record (({ item }) => item.status !== "done") and may answer asynchronously; answers are cached per record while a list is on screen. A refused action also protects its route:/books/update/1draws the scope'sforbiddenFallbackinstead of the form.canListis now read for the list (it was ignored).usePermission(action, item)anduseAllowedActions(actions, item)are added;permissionResourcetakes{ item, context }and may return a promise. - **behavioris gone**, each option moved to where it has an effect:openIn→views.<action>.open("page","dialog","drawer");closeAfterUpdate,refreshDataAfterUpdate,redirectToAfterUpdate→ oneafterSave: "close" | "stay" | "reload" | { redirect: (item) => string };rowActions→views.list.rowActions;eventSourced→realtimeat the root;openRecordIn→views.read.open;selectable,bulkActions→views.list.selectable,views.list.bulkActions, for every layout of the list (bulkActionsalso takes"delete"). - **Layouts.**viewVariantsbecomesviews.list.layouts, and the seven factories onelayoutnamespace:layout.table(),layout.cards({ columns }),layout.board({ groupBy, columns }),layout.calendar({ dateField }),layout.timeline({ startField, endField, groupBy }),layout.split({ readInList }),layout.items()andlayout.custom()for one's own (read its options withuseLayout()). Field options are checked against the resource's item type — a typo is a TypeScript error — and share one suffix:titleField,dateField,colorField,statusField. A layout's URL id is its type, so a new label breaks no shared link;fieldspicks a layout's columns. - **Data.** Withoutpath,storage: "local"must be declared: a forgotten path no longer turns into localStorage silently.preGetCollection,preGetItem,preCreate,preUpdatebecomehooks.beforeList,beforeRead,beforeCreate,beforeUpdate, joined bybeforeDelete,afterSaveandafterDelete; hooks may be asynchronous and always receive the view context — creations and updates used to lose it on the way to the repository. Hand-written repository methods move torepository: { … }.limitbecomesquota: { get, fallback }(useLimit→useQuota). - **Titles and components.**nameis declared once; titles are derived and overridden withviews.<action>.title, a button's text withbuttonLabel.viewComponentand the otherxxxComponentkeys, anddecoratorComponent, become onecomponentsobject (view,wrapper,top,bottom,empty— exnoResult—,pagination,navigation,title,actions). - **Tabs.**subViewResourcebecomesviews.read | update.tabs: { orientation, aside, items }, a tab being{ id, label, resource, filter: ({ item }) => … }instead of anonInitViewResourcereturning the whole context. - **Scopes and defaults.** A resource no longer names itsscope: the scope'sresourcesties them, andmenu: "auto"(or a list mixing resources, links and groups) builds the navigation.setResourceConfig({ defaultResource })becomesconfigureResourceView({ defaults }), merged deeply into every resource, including those declared before it is called. - **Types.**ResourceDefinitionis what one writes,ViewResourcewhat the library builds;ViewResourceInterface,ResourceOptionInterface,ViewInterfaceand the factory option interfaces are replaced. - **Optimistic writes.** Every write going through a resource's repository — a form saved, a row deleted, a cell edited in place, a card moved, the writes of a bulk action made through its newmutationargument — is drawn before the API answers: the row changes at once (a created one appears, marked as being saved), the API's answer replaces it as soon as it comes, and a refusal puts it back with a toast — a form keeps the API's violations on its fields. Several writes to one record show the last one; a list read again while a write is in flight (a realtime push) keeps the row as written. On by default — a change of perceived behaviour —, turned off withoptimistic: falseat the root or per action (views.delete: { optimistic: false }).useResourceMutation(resource)gives an application's own actions the same optimism and rollback (create,update,remove,mutate,isPending), andRowInterfacegainspending. Built on the library's own state rather than React 19'suseOptimistic: no new requirement on the React version. - **One routed opening.**views.<action>.openis resolved once, and anything but"page"is written into the URL under the view it was opened from (…/tasks/list/tasks/update/12, filter and layout kept): a row's button — now a real link —, a board's card and a link typed by hand open the same frame, Back closes it, a reload opens it again over the same list, and a save closes it by going back to that URL. A list reads itself again once per save, instead of once per button of its rows.layout.board({ openRecord, expandable })is gone: a card opens the record'sreadview whereviews.read.opensays — on its page by default, where it used to open nothing. - **Frames of one's own.**open.custom({ type, placement, component }), on the model oflayout.custom(): the component receives the title, the view,closeand the link to the full page.placement: "inline"draws the view under the row that opened it in a table, a plain list or a card grid — alayout.custom()says it can withsupports: ["inline"]and draws<InlineChildView row={row} />— and falls back to a dialog elsewhere, with a warning in development.configureResourceView({ open: { accordion } })registers a frame under a name, typed through theOpenFramesinterface. - **"Open in full page".** Areadorupdateview opened in a frame has a link to the same view on its page beside the close button, a real<a href>that Ctrl/Cmd+click opens in a new tab.expandable: falseon the view takes it away;createanddeletedo not have it unless they sayexpandable: true. - **Checked in development.**createViewResourceandlayout.*throw on a key they do not read — with the closest key, or the exact 1.0 rewrite of a 0.x one — on a resource with no data source, a board withoutgroupBy, two layouts sharing a URL id, and warn about a title identical to the derived one. Nothing is checked in production. - **Command line.**npx react-resource-view migrate [paths]rewrites 0.x declarations (--dry-run,--check);create-view-variantwrites alayout.custom()file;initstarts on the 1.0 syntax.
Minor Changes
- feat(views): a list sorts by its column headers, selects its records in every layout and says when it could not load, not only on the board and not with an empty list-
views.list.sort: { fields, initial }: the table's headers of the fields named sort ascending, then descending, then not at all (aria-sort); the sort goes to the API through the dialect, into the URL, and survives "Clear the search".useSort()gives the same to a layout of one's own. - **Breaking (1.0):**selectableandbulkActionsleavelayout.board()forviews.list, and reach every layout: checkboxes on the table's rows (and "Select all" in its header), the cards and the items.bulkActionsaccepts"delete", which deletes the selection after a confirmation, as far aspermissions.deleteallows.selectabledefaults totrueon a board and wherever bulk actions are declared.npx react-resource-view migraterewrites both (RV1-BEHAV-006, RV1-LAYOUT-014). - A view whose records could not be loaded draws what the API answered and "Try again" (components.errorreplaces it), rather than "An error occurred" in a list, or an empty form that could be saved over the record.loadErroron the view context holds what the request threw. - Moving to another view shows that the click was heard, instead of nothing until the next view appears at once: a thin bar runs along the top of the screen, in the theme's primary colour, until the new view has its data, and the view fades in, sliding up a few pixels. No new dependency.- The bar waits 150 ms, so an instant navigation flashes nothing, then stays 300 ms at least; it runs quickly, then slower, and fills up when the view is there. The loading view is marked
aria-busy, the bar hasrole="progressbar", and neither takes the focus. - Underprefers-reduced-motion: reduce, the view fades without moving. -ResourceViewProvidertakesnavigationLoader— a node, a component receiving{ isNavigating }, orfalsefor nothing — andviewTransition(trueby default). - Any router works: a navigation counts from a click on a link of the library, or a call to itsnavigate, until the new view has loaded. The navigation port takes an optionaluseIsNavigating, which the TanStack adapter reads fromuseRouterState. -useIsNavigating(),useDelayedVisibility()andNavigationProgressBarare exported, for an indicator drawn elsewhere.
0.15.0#
Minor Changes
- Open a card of a board, select several and move them together, instead of only dragging one card at a time onto a column.-
behavior.openRecordIn("drawer","popup"or"window") makes the whole card clickable — hover and focus states, Enter from the keyboard — and opens the record'sreadview: in a panel on the right or a dialog, both written into the URL as a child view of the list (…/tasks/list/tasks/read/12, whichparseLinknow reads), so the link is shareable and Back closes it; or on the record's own page, throughgenerateLink. The panel has a way to edit the record, traps the focus and gives it back to the card. - A button, a link, a menu, a checkbox or a drag handle drawn in a card keeps its click, without anystopPropagation: the card only opens on a click that lands on none of them (data-card-controlmarks anything else), and not when text is being selected. - Cards can be selected — checkbox, Ctrl/Cmd+click, Shift+click for a range, a long press on a phone, Escape to clear — and a bar offers "Move to…",behavior.bulkActionsand "Deselect all". Dragging a selected card moves the whole selection under an "N cards" preview. Each record is updated through the repository and drawn in its new column at once; one that fails goes back, and a message says how many could not be moved.behavior.selectable: falseturns selection off. - Each column scrolls on its own, and an empty column shows where to drop. - Add a Django REST Framework dialect:
djangoDialect()reads DRF's{ count, next, previous, results }page (or a bare array when the view has no paginator), pages withpage/page_size— orlimit/offsetwithpagination: "limit-offset"— sorts withordering=-field, sends filters as query parameters for django-filter, addresses a record at/articles/{id}/with DRF's trailing slash, and pins a 400's{ field: ["message"] }on its input. Options:primaryKey,pagination,pageSizeParam,defaultItemsPerPage,orderParamandtrailingSlash.npx react-resource-view init -b djangostarts a back office on it, dumping the schema drf-spectacular serves at/api/schema/?format=json.
Patch Changes
initwrites thereact-data-form,react-mini-i18n,resource-registryand@tanstack/react-routerranges from the package's ownpeerDependencies, so a generated starter installs without--legacy-peer-depsinstead of failing withERESOLVEon a hard-codedreact-data-form@^0.2.1against a^0.1.0peer.- A record saved from a button opening over a list (
openIn: "popup"or"drawer") reads the list again with the filter it has now, instead of the one the button mounted with — a list filtered on « A », then on « B », no longer shows the rows of « A » under « B » after a save. The buttons of every row also share a single request instead of each reading the list again.
0.14.0#
Minor Changes
- Add a FastAPI dialect:
fastapiDialect()lists, reads, creates, updates and deletes against a standard FastAPI CRUD router, instead of showing empty lists under the JSON-LD default.A page isskip/limit, as in the FastAPI tutorial, orpage/sizewithpagination: "page-size"for fastapi-pagination, whose{ items, total }drives the page count; a bare array hides the pagination. A sort isorder_by=-created_at,title, an array filter repeats its parameter, and a 422 lands under the field itslocnames —["body", "address", "city"]onaddress.city. Options:primaryKey,pagination,defaultItemsPerPage,orderParamandtrailingSlash. - Add
npx react-resource-view init: it starts a back office on your API — API Platform, Spring Boot, another REST API, Supabase, Strapi or FastAPI — with the dialect wired, the URL in.env, andapi-schema/api-schema:checkscripts that dump the OpenAPI schema into TypeScript with api-dumper.Add a Spring Boot dialect:springDialect()pages withpage(from 0) andsize, sorts withsort=field,desc, reads aPage, aPagedModelor Spring Data REST's HAL, and pins Bean Validation errors on their field.
Patch Changes
- Capitalise the first letter of each view name in the view switcher, so a
boardorvue d'ensembletab readsBoardandVue d'ensemble, custom and translated names included — the rest of the label is left as written.
0.13.0#
Minor Changes
- Recognize a 401 or a 403 thrown by a scope's
authorizationfrom itsstatus, not only fromUnauthorizedErrorandForbiddenError. Any error carryingstatus: 401callsonUnauthorized, any error carryingstatus: 403renders theforbiddenFallback: an auth library no longer has to import the classes, and two copies ofreact-resource-viewin one bundle still agree. No other status is recognized, and errors recognized today behave as before.
Patch Changes
- Save a card moved to another column of a board kept in the local repository, instead of answering "Une erreur est survenue" and putting the card back.The drop sent only the short identifier of the record (
12), which the local repository compared to the@idit keys records on (/tasks/12) and never found. It now finds the dropped row again and sends the whole identity the dialect reads it by —@idandidfor JSON-LD,documentIdfor Strapi, the primary key for Supabase — so every repository addresses the record as before. A card dropped back into its own column sends nothing.The error a failed update shows is now the translatable keyAn error occurred, also used when a list or a calendar fails to load, rather than a French sentence. Applications translatingUne erreur est survenueshould add the new key. - Keep a column of the columns view at its width when one of its cards holds a long unbreakable word (a path, a URL, an identifier). As a flex item, the column was never narrower than its widest content: once a parent sized the columns, it grew around the word and slid under its neighbours. The column is now
min-w-0and the content of a record cardbreak-words, so the word wraps inside the card instead. - Keep the horizontal sub-view bar inside the page and level with the side column when
subViewResourcehas one, instead of pushing the page sideways and starting 4rem below the column.The sub-view track was a bare1fr, which is never narrower than what it holds — and the bar is as wide as all its tabs, a table in a tab as wide as its columns. The track is nowminmax(0, 1fr)and the tabs containermin-w-0, so the bar scrolls inside the width left beside the column, as it already did without one.The bar was also meant to stay pinned under the top bar while a long sub-view scrolls, but the scroll area's root setsposition: relativeinline, which beat itsstickyclass: the bar never stuck, and itstopoffset moved it down instead. The bar is now pinned from a wrapper of its own. - Keep the horizontal sub-view tab bar within its column when
subViewResource.viewComponentdraws a left column beside it. The tabs' grid track grew to the width of the whole row of tabs, so the bar never scrolled: the last tabs were cut off and the page itself overflowed to the right. The bar now scrolls sideways as it does without a left column; the vertical menu and records without a left column render as before.
0.12.0#
Minor Changes
- Let a scope's
authorizationwait for a real session —authClient.getSession(), a/mecall — instead of having to answer synchronously, and keep the scope hidden until it has.authorizationmay now returnboolean | Promise<boolean>; a synchronous function works as before. Nothing of the scope renders while it is pending:authorizationFallbackshows instead, the page loader by default. AnUnauthorizedError, thrown or rejected, still callsonUnauthorized. AForbiddenError, thrown or rejected, or afalseresult, now rendersforbiddenFallback— an "Access denied" message by default — where aForbiddenErrorused to reach the error boundary and afalsewas ignored. Both fallbacks are accepted on the scope and on the provider configuration, the scope's winning.The check runs again when the scope changes, and on demand throughrecheckAuthorization()fromuseScopeContext(), so a sign-out is taken into account without a reload. An answer that arrives after the scope changed is ignored. - Pin a block at the bottom of
AdminLayout's sidebar — "Need help?", support, documentation — instead of leaving its footer empty with no way to fill it.AdminLayoutandcreateAdminLayoutnow takefooterMenu, menu entries drawn like the scope'smenuunder an optionalfooterMenuTitle, andsidebarFooter, any node rendered below them. An entry whosehrefis absolute leaves the application: a web page opens in a new tab, amailto:hands over to the mail client. On narrow screens both go behind a last entry of the bottom bar, named afterfooterMenuTitle("More" without one), which opens them in a drawer. Without either option the sidebar renders no footer, as before.
Patch Changes
- Leave out the foot of a record card — its separator and the padding under it — when the resource permits none of the row's actions, instead of ending the card on a stray line above an empty strip.The card layout now reads which actions a row offers (
behavior.rowActions, thencanUpdate,canDelete…) before drawing their bar, as the calendar and timeline preview already did. A card with at least one permitted action is unchanged.
0.11.0#
Minor Changes
- Name the record on screen in
AdminLayout, instead of an empty top bar above a bare "Edit a user".The top bar now carries a breadcrumb — the scope'slabel, the resource, the record — where it used to hold nothing but the sidebar toggle. On a record, the page header links back to the list, takes the record's name as its title (read fromtitle,nameorlabel, or from the view's newtitleKey), says the action and the id underneath, and offers the actions still worth having there: edit from the read page, delete from either — deleting goes back to the list.A view overrides the title withcomponents.titleand the actions withcomponents.actions;components.navigationstill replaces the whole header. - Give a board, a calendar or a wide table the whole page in
AdminLayout, instead of the column every view was squeezed into.A view now takesfullWidth. Set on a resource'sview, it covers every action of the resource; on one ofviews, that action; on a list variant built by a*ViewOptionFactory, that variant only. The most specific declaration wins, so a resource drawn full width keeps its forms narrow withviews: { update: { fullWidth: false } }, and a board can be the one wide layout of a list whose table stays in the column.AdminLayoutdrops its width constraint for such a view and keeps its side margins; nothing changes for a view that does not ask.isFullWidthViewresolves the option for the view on screen, for adecoratorComponentof one's own that wants to honour it too.
Patch Changes
- Light the sidebar entry of the page
AdminLayoutopens on, and unfold the group of the page on screen, instead of leaving the reader to find either.A scope opened bare —/playground,?view=admin— shows the page itsdefaultViewResourceContextParamsname, but its URL names none, so no entry was lit until the reader clicked on one.useIsActiveItemMenunow takes that default view, andAdminLayouthands it the scope's.A sub-entry on screen now unfolds its group, even one the reader had folded on an earlier visit, and marks it with the accent colour, without the background the page itself carries. The entry on screen also carriesaria-current="page". - Fold the admin sidebar away, and keep a menu entry lit on the page it points at.Two things
AdminLayoutgot wrong on the screen it is mostly read on. The top bar's button only ever opened the mobile drawer, so on a wide screen — the one place it is shown — pressing it did nothing; it now folds the sidebar column away and back.And a menu entry was matched against the address bar as a string, which held only while the URL was exactly the one the entry was built from: opening a record of a resource turned its entry off, and in query mode an application whose views are mounted somewhere other than the configuredbasePathnever lit any entry at all. The comparison is now made context by context — scope, resource, record — so an entry pointing at a list stays lit for everything inside that list, while two entries on the same resource (its list, its creation form) stay distinguishable.
0.10.0#
Minor Changes
- Give a scope a ready-made admin shell instead of writing one from scratch.Every project reached for the same
decoratorComponent: a collapsible sidebar built from the scope'smenu, a top bar, a page header with sub-navigation tabs, and a bottom bar on narrow screens instead of the sidebar.AdminLayoutis that shell, exported so a scope only needs to point at it:ts const adminScope: ScopeInterface = { name: "admin", decoratorComponent: AdminLayout, menu: [createItemMenuWithResource({ resource: articlesResource })], }createAdminLayout({ logo, topBarEnd })builds a configured variant when the host wants a logo or actions in the top bar —decoratorComponentonly ever receiveschildren, soAdminLayoutitself takes no props there.
0.9.0#
Minor Changes
- Read the sub-views of a record without three rows of buttons in the way.The tab bar wrapped onto as many lines as the tabs needed, and cut every label to twelve characters below
mdto limit the damage — a record with eight sub-views pushed its content off a phone screen before a word of it was read. The bar now stays on one line and scrolls sideways, labels whole.subViewResource.orientation: "vertical"is the other shape: the tabs go down a column beside the sub-view, which is what a record with a dozen of them wants — the whole menu is read at once, and it follows the reader down the page. Belowmdthe column would leave the sub-view a third of the screen, so it falls back to the scrolling bar there; the same declaration reads both ways.
0.8.0#
Minor Changes
- Open a small window on a calendar event or a timeline bar.Clicking one used to print every key of the record —
@context,@idand the dates already written on the event included — which is a data dump rather than a preview. What opens now names the event, dates it in one line, summarises it in at most five fields labelled the way the resource'sform.inputslabels them, and hands over to the row's actions for the rest.The summary is the variant'srowComponent, which both layouts now default toPreviewRowComponentinstead ofDumpRowComponent: a resource with something better to show still declares its own, exactly as in the card and list layouts.
Patch Changes
- Keep a list header on one line when its description is long.The header laid the name, the layout switcher and the create button side by side, each free to wrap on its own. A resource introduced by a full sentence took the whole width for it, and the create button was pushed alone onto the line below, floating under the tabs.The text now yields instead of pushing — it is the flexible part of the line — and the switcher, the export and the create button form a single bar, so the width that does run out takes the whole bar down, never one button of it.
0.7.0#
Minor Changes
- Open an action in a drawer.
behavior: { openIn: "drawer" }joins"popup"and"window": the view slides in as a panel rather than replacing the page or sitting in the middle of it. From the right on a desktop, up from the bottom below themdbreakpoint — where a thumb reaches — and swiped away towards the side it came from.The panel is as tall as the screen, which is what a long form wants: a record with a dozen fields is filled in without the list behind it going anywhere. Like a dialog, it closes itself on the resource'sonChangerather than navigating after a creation. - Give a list a header of its own.The create button, the export button and the layout switcher used to be stacked above the rows as three loose controls, and the resource's
icon— already used by the menu and by the sub-view tabs — appeared nowhere on the screen it belongs to. They are now one line: the icon, the view'snameand itsdescriptionon the left, the layout switcher beside them, the actions on the right.Nothing is declared for it: a resource that names no icon simply shows none, and a list nested inside another view — a sub-view tab — leaves the naming to whatever contains it. The filter bar is untouched. - Add a command that scaffolds a view variant.
npx react-resource-view create-view-variant Heatmap --dir src/viewswrites one file — the list, row and item components, the factory that declares them and the options interface to extend — where the project keeps its views. Run bare, it asks for the name and the directory;--icon,--jsx,--force,--dry-runand--yescover the rest.Nothing about declaring a variant changes: the generated factory goes intoviewVariantsbeside the built-in ones.
0.6.0#
Minor Changes
- Speak Strapi and Supabase, not only JSON-LD.The views assumed one API family everywhere: a collection was
memberandtotalItems, an item carried its own IRI in@id, a page waspageanditemsPerPage, a validation failure was a list ofviolations. Every one of those is now a decision an **API dialect** makes, and three ship with the package:ts import { configureApi, strapiDialect } from "react-resource-view"configureApi({ baseUrl: "https://cms.example.com", getAuthToken: () => getUserToken(), dialect: strapiDialect(), })-jsonLdDialect()— API Platform and Hydra. The default, and it still goes through the client ofjsonld-api-client, so an application already talking to API Platform needs no change at all. -strapiDialect()— Strapi v4 and v5.pagination[page],filters[field][$eq],sort[0],populate, writes wrapped indata, and the v4{ id, attributes }envelope flattened so both versions read alike. -supabaseDialect({ apiKey })— Supabase, over PostgREST.limit/offset,field=eq.value,order, the count read fromContent-Range, rows addressed by their primary key, and writes that ask for the stored row back.A resource may also declare adialectof its own, for an application reading two backends at once. Filters, pagination and sorting are written once, in the package's own vocabulary, and the dialect translates them.JSON-LD is now an option rather than an assumption: a relation is only dereferenced as an IRI where the dialect says relations are IRIs, no Mercure subscription is opened against a backend that runs no hub, and the CSV export button hides itself where the API serves no CSV. - A row now offers update and delete. Read is gone from the default, and which actions a row draws is a view's decision —
view.behavior.rowActions.**This changes what an existing list renders.** A row is already the record — the table edits it in place, the other layouts draw it in full — so a button whose only job is to show the same fields again was not earning the width it took. Put it back where the detail view carries more than the list does:ts tableViewOptionFactory({ behavior: { rowActions: [ActionList.read, ActionList.update, ActionList.delete], }, })Permissions still apply on top: an action listed there without the matchingcan*renders nothing.ListResourceViewButtonhad two implementations — one exported from the entry point, one declared insideResourceViewButton.tsxand used by the table. The duplicate is gone; both now resolve to the same component.The dialog's close button carried a hard-coded French label, which no dictionary could reach. It goes throughTranslike every other string.
Patch Changes
- Stop overwriting
document.titlewhenownsDocumentHeadisfalse.The port says the host application declares its own head, but the title was still written imperatively from an effect. Any page embedding a view — a documentation page, a dashboard panel — ended up carrying the name of the embedded view instead of its own. - Keep the chosen layout when a list navigates to itself.Selecting a row in the split view switched the reader to the table. Two things lost the variant on the way:-
generateLinknever serialised it, so the URL the split view navigated to said nothing about which layout it came from. It now carries?variant=<id>, andparseLinkreads it back. -useResolvedViewParamsrebuilds the context field by field, andviewVariantIdwas not among them — so a variant handed toResourceViewProvider, or read off the URL, was dropped before it reached the view. Both now come through.Every layout that renders a record in full — card, item list, columns, split — draws it in a frame of its own and offers the row's actions, instead of handing the barerowComponentto the page.The columns layout wrapped each row a second time before passing it on, so the row component received an object whose every field wasundefinedand the board drew blank cards. Columns also gained a count, an empty state, and a drop target that highlights only the column under the pointer.The timeline'scolorByStatuswas declared by the factory and read by nobody; bars now take their colour from it. Its two footer counts were adjacent bare text nodes — a single anonymous flex item — so they read as one glued sentence rather than sitting at either end. - Make a form opening in a dialog behave like one.
behavior: { openIn: "popup" }drew a dialog with no name, introduced by whatever sentence the _list_ had been given — every action inherits the resource'sview, description included — and a creation made from it navigated straight out of the page the dialog sat on, taking the list, its filters and its page with it.- A popup is now titled by the view it opens, which assistive technology announces and a reader can read; the list's description stays on the list. - After a creation in a popup nothing navigates: the dialog closes on the resource'sonChangeand the list refreshes underneath. On a screen of its own the move to the new record's edit view is unchanged — and now builds its link in the resource's own scope, instead of walking out of the area it was made in. - A view an action does not name is called after that action: a resource whose list is "Coffee beans" edits "Edit — Coffee beans" rather than a second "Coffee beans". A name the action declares is left alone. - The delete confirmation speaks English — "Supprimer ?", "Annuler" and the error toast were shipped in French and never went throughreact-mini-i18n— and no longer repeats the name of the view that frames it. - Cards of one row line their actions up on the bottom edge, instead of leaving each set of buttons wherever its record happened to end.
0.5.0#
Minor Changes
- Stop shipping French. The calendar and the timeline formatted their dates with a hardcoded
frdate-fns locale, started their weeks on Monday and sorted their rows with a French collation, and three labels were written in French. Dates now follow thedateLocaleport — English (US) by default — which also decides the first day of the week and the collation:ts import { fr } from "date-fns/locale" configurePorts({ dateLocale: fr })getDateLocale()andgetWeekStartsOn()read it back.**Breaking for applications relying on the former defaults:** "Aujourd'hui" became "Today", "Nettoyer la recherche" became "Clear the search", and dates are formatted in English untildateLocaleis set. Translate the new labels throughreact-mini-i18n, as with every other label of the package.
0.4.1#
Patch Changes
- Keep what the user picks while the list is fetching. A request landing used to write the whole view context back — the one captured when it left — so a layout chosen from the variant tabs, or a filter applied, was reverted a few milliseconds later. Requests now bring back rows only,
setViewResourceaccepts an updater like React's own setters, and the variant tabs are controlled, so the highlighted tab is always the layout on screen.The timeline's footer counts are translatable, and the header of its row column can be named withgroupsLabel.
0.4.0#
Minor Changes
0.3.1#
Patch Changes
0.3.0#
Minor Changes
- Initial release: CRUD views for JSON-LD / Hydra APIs — list, read, create, update and delete — in table, card, column, split, calendar or timeline layouts, wired to the API and to the URL.The package knows no router: it asks for four navigation primitives through
configurePorts, and ships an adapter for TanStack Router on the/tanstacksubpath. Applications on another router install nothing extra. - The view context can now live entirely in the query string.
configurePorts({ routing: { mode: "query", basePath: "/docs.html" } })writes links as/docs.html?view=admin/articles/update/42instead of/admin/articles/update/42. It exists for static hosting, where a deep path has no server to answer it and returns 404, and for embedding the views in a page whose path is not yours to control.parseLinkreads a URL carrying the routing parameter as query mode whatever the configuration says, so a link shared from a statically hosted page keeps working wherever it is opened.- AdduseIsActiveItemMenu, which works while rendering on a server.isActiveItemMenureadswindow.location. There is nowindowon a server, so it threw mid-render; React caught it, silently fell back to rendering in the browser, and left an empty document behind — a page that looks fine to a visitor and empty to anything that only reads the markup.The new hook asks the navigation port instead, which a router can answer on either side, and returns a predicate so a menu can test every entry.isActiveItemMenuno longer throws off the browser, but reports every entry as inactive there; prefer the hook wherever the markup is rendered on a server.
Patch Changes
isActiveItemMenunow works in query mode.It comparedwindow.location.pathnameagainst the entry's href. In query mode the context lives in the query string, so the pathname is the same for every page and no entry was ever marked active.- Fix
filteranddefaultDatalosing everything after a reserved character.They were serialised withencodeURI, which leaves&,=and#untouched. A value such as{ title: "Tom & Jerry" }produced?defaultData={"title":"Tom & Jerry"}, where the ampersand ended the parameter and the rest was read as a stray one.encodeURIComponentescapes them.Links written with the previous encoding still parse, so bookmarks and shared URLs keep working.