Skip to content

MENDELU/Convert full item metadata to hyperlinks#1246

Open
jr-rk wants to merge 5 commits intocustomer/mendelufrom
mendelu/convert-full-item-metadata-to-hyperlinks
Open

MENDELU/Convert full item metadata to hyperlinks#1246
jr-rk wants to merge 5 commits intocustomer/mendelufrom
mendelu/convert-full-item-metadata-to-hyperlinks

Conversation

@jr-rk
Copy link

@jr-rk jr-rk commented Mar 10, 2026

Problem description

  • "Urobit hyperlinky v full item view pre specificke metadata 2h"

Copilot review

  • Requested review from Copilot

@jr-rk jr-rk requested a review from Copilot March 10, 2026 15:36
@jr-rk jr-rk self-assigned this Mar 10, 2026
@jr-rk jr-rk linked an issue Mar 10, 2026 that may be closed by this pull request
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the full item view to render URL-like metadata values as clickable hyperlinks, improving usability when metadata contains resolvable links (e.g., handle URLs).

Changes:

  • Added an isUrl helper on FullItemPageComponent to detect http(s) URLs.
  • Updated the full item metadata table to render detected URLs as <a> links (new tab + noopener noreferrer).
  • Added unit tests covering URL detection and link rendering behavior in the metadata table.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/app/item-page/full/full-item-page.component.ts Introduces isUrl helper used by the template to decide link vs. plain text rendering.
src/app/item-page/full/full-item-page.component.html Renders metadata values as <a> when isUrl(...) returns true.
src/app/item-page/full/full-item-page.component.spec.ts Adds tests for isUrl and verifies URL values render as clickable links in the metadata table.

@jr-rk jr-rk requested a review from milanmajchrak March 10, 2026 15:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

Comment on lines +122 to +128
/**
* Check if a metadata value is an HTTP(S) URL.
*/
isHttpUrl(value: string | null | undefined): boolean {
const v = value?.trim().toLowerCase();
return !!v && (v.startsWith('http://') || v.startsWith('https://'));
}
Copy link

Copilot AI Mar 10, 2026

Choose a reason for hiding this comment

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

This introduces a second, slightly different HTTP(S) URL detection implementation compared to MetadataRepresentationListElementComponent.isLink() (regex-based). Consider centralizing URL detection in a shared util/pipe so future tweaks (e.g., trimming, stricter validation) stay consistent across the UI.

Copilot uses AI. Check for mistakes.
Copy link
Author

Choose a reason for hiding this comment

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

@milanmajchrak too complex for now?

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.

MENDELU/Convert full item metadata values to hyperlinks

2 participants