eventcatalog icon indicating copy to clipboard operation
eventcatalog copied to clipboard

allow deep link to an event field

Open donaldpipowitch opened this issue 2 years ago • 4 comments

Motivation

In order to share documentation for single fields in long event definitions efficiently it would be nice, if we could use individual fields as a target.

Ideally this feature would be build into @stoplight/json-schema-viewer, but thanks to renderRowAddon it can also be implemented in user land.

Sadly because we collapse event definitions by default it is not super easy to target them. We actually have to wait for the client side rendering to become available to check, if an anchor was used. Due to some rendering bug we then have to re-render <JsonSchemaViewer/> by changing the key (this of course only happens if you make use of this feature - no negative impact for other users). After that we can manually scroll to the field.

image

(Added the small # icon at the end.)

Have you read the Contributing Guidelines on pull requests?

Yes

donaldpipowitch avatar Feb 28 '22 14:02 donaldpipowitch

🦋 Changeset detected

Latest commit: 99565688b4c79b4a7f9d56d185f81b7d0fcb9dfc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@eventcatalog/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Feb 28 '22 14:02 changeset-bot[bot]

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployments, click below or on the icon next to each commit.

eventcatalog-docs – ./

🔍 Inspect: https://vercel.com/davidboyne123/eventcatalog-docs/12Ty8saSKVtvJs9BU7pTZTxf7fR9
✅ Preview: Canceled

[Deployment for 9956568 canceled]

eventcatalog-example – ./

🔍 Inspect: https://vercel.com/davidboyne123/eventcatalog-example/2gD8unu6o9QvUB76VgMZ47FJkNX2
✅ Preview: Canceled

[Deployment for 9956568 canceled]

vercel[bot] avatar Feb 28 '22 14:02 vercel[bot]

Thanks for this improvement @donaldpipowitch

Do you think it's worth adding this feature to the docs? https://www.eventcatalog.dev/docs/components/overview#schemaviewer-

Just an overview of what it is and how you can use it?

boyney123 avatar Mar 17 '22 11:03 boyney123

As a regular feature I'd personally not need it in the docs. (I'd hope it's self explanatory, similar to the anchors we see in GitHub when hovering over a heading in a markdown file.)

But... if you want this to be a configurable feature I would definitely add it there. Should I make it configurable?

donaldpipowitch avatar Mar 18 '22 10:03 donaldpipowitch

Hey @donaldpipowitch , sorry for the late review here, think EventCatalog has evolved since these PR were raised. Going to close for now, if you need this feature, feel free to raise again and I will take a look ASAP. Sorry it's taken so long!

boyney123 avatar Jul 03 '23 09:07 boyney123