Skip to content

Conversation

@acelaya
Copy link
Collaborator

@acelaya acelaya commented Jun 11, 2025

Part of hypothesis/h#9548

Improve the AnnotationDocumentInfo component so that it can extract the information to display from the annotation, via a number of new helper functions.

Most of the logic here is extracted from client, and will be used in hypothesis/h#9618 as well.

Once merged, I will create a client PR removing the helpers that are not needed there anymore.

Comment on lines +1 to +10
export type Annotation = {
uri: string;
document: { title: string };
links: {
/** A "bouncer" URL that takes the user to see the annotation in context */
incontext?: string;
/** URL to view the annotation by itself. */
html?: string;
};
};
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I have created this type as small as possible, just with the minimum properties that are needed by the helpers defined here.

In future we plan to extract the type definitions to a shared location.

@acelaya acelaya requested a review from robertknight June 11, 2025 08:30
@acelaya acelaya force-pushed the annotation-document branch from 5897c76 to ff6fdb6 Compare June 11, 2025 08:34
Copy link
Contributor

@robertknight robertknight left a comment

Choose a reason for hiding this comment

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

I think it will make sense to combine AnnotationDocument and AnnotationDocumentInfo into one AnnotationDocumentInfo component, since AnnotationDocumentInfo is quite small and I don't think we plan to use it outside AnnotationDocument?

@acelaya acelaya changed the title Add AnnotationDocument component Add helpers for AnnotationDocumentInfo Jun 11, 2025
@acelaya acelaya force-pushed the annotation-document branch 2 times, most recently from 13e20d5 to c5122f0 Compare June 11, 2025 09:16
@acelaya acelaya requested a review from robertknight June 11, 2025 09:16
@acelaya acelaya force-pushed the annotation-document branch from c5122f0 to 3b0562f Compare June 11, 2025 10:18
@acelaya acelaya force-pushed the annotation-document branch from 3b0562f to 1825352 Compare June 11, 2025 13:54
@acelaya acelaya force-pushed the annotation-document branch from 1825352 to 4fdd8f1 Compare June 11, 2025 14:08
@acelaya acelaya merged commit 56400f1 into main Jun 11, 2025
2 checks passed
@acelaya acelaya deleted the annotation-document branch June 11, 2025 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants