Skip to content

Specify uri from data in pos-rich-link #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

jg10-mastodon-social
Copy link
Collaborator

@jg10-mastodon-social jg10-mastodon-social commented Jul 6, 2025

Closes #130
Also closes #132 with new storybook docs

  • Acceptance criteria
    • If uri is missing, the component emits an event to receive the active resource.
    • If uri is missing and no resource is received (yet), nothing is displayed
    • If rel is present, then the corresponding link is followed and the resulting resource is displayed
    • If rev is present, then the corresponding link is followed and the resulting resource is displayed
    • (New) If there is not just one link, an error is shown
    • (New) Errors are emitted as pod-os:error events
  • Otherwise a link to the active resource is displayed (e.g. within a pos-list)
  • Tests have been written
    • all new code is covered by unit tests
    • the happy path of a new feature is covered by an end-to-end test
      • integration test with pos-resource
    • manual explorative tests have been performed
  • all dependencies are updated to the latest patch version at minimum
  • the CI pipeline passes
  • documentation is up-to-date
    • TSDoc style comments on important functions, properties and events
    • stories for new PodOS elements have been added to storybook
    • Readme.md files of PodOS elements have been re-generated
    • architectural decisions are documented as an ADR
      • N/A
    • Changelogs are updated according to
      Keep a Changelog

relations: () => [],
});
await page.waitForChanges();
expect(page.root?.shadowRoot?.textContent).toEqual('No matching link found');
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

  • Similar to pos-list, my reasoning is that the dashboard creator will want in-situ feedback on what is broken.
  • I did think about throwing an error, but the user would have no way of knowing where the error is.
  • The situation is a little different to pos-list because the error is caused by data and therefore might be experienced by the dashboard user as well. Ideas are welcome on other ways of elegantly handling the case where no or two many links are found.

Copy link
Contributor

Choose a reason for hiding this comment

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

Fine for now. We need a general concept for error handling. What comes to my mind is to have a) some error icon in the effected component that shows a summary as tooltip and b) have a global error log with more detais. Ideally one could click on the icon to jump to the error in the detailed log. All this would be a whole new task of course. What you could do is throw a pod-os:error event addtional, so that global handler can catch it. As you said it may as well be a data (runtime) error and not a build time error.

relations: () => [],
});
await page.waitForChanges();
expect(page.root?.shadowRoot?.textContent).toEqual('No matching link found');
Copy link
Contributor

Choose a reason for hiding this comment

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

Fine for now. We need a general concept for error handling. What comes to my mind is to have a) some error icon in the effected component that shows a summary as tooltip and b) have a global error log with more detais. Ideally one could click on the icon to jump to the error in the detailed log. All this would be a whole new task of course. What you could do is throw a pod-os:error event addtional, so that global handler can catch it. As you said it may as well be a data (runtime) error and not a build time error.

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.

Add pos-rich-link storybook example with description Specify uri from data in pos-rich-link
2 participants