Skip to content

[MPT-163] feat: implement shareable link - #906

Draft
dabby9734 wants to merge 2 commits into
mainfrom
shareable-link
Draft

[MPT-163] feat: implement shareable link#906
dabby9734 wants to merge 2 commits into
mainfrom
shareable-link

Conversation

@dabby9734

@dabby9734 dabby9734 commented Apr 12, 2025

Copy link
Copy Markdown
Contributor
  • mentor query parameter in URL when modal is opened
  • "copy link" button
  • logic to prevent ES from removing our mentor query parameter
  • If the mentor query parameter is present in the URL, the corresponding mentor should be ordered as the first result of the result grid

@netlify

netlify Bot commented Apr 12, 2025

Copy link
Copy Markdown

Deploy Preview for tender-meitner-99286b ready!

Name Link
🔨 Latest commit 741f00c
🔍 Latest deploy log https://app.netlify.com/sites/tender-meitner-99286b/deploys/67fe07703dd94600086d4335
😎 Deploy Preview https://deploy-preview-906--tender-meitner-99286b.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 95
Accessibility: 95
Best Practices: 100
SEO: 100
PWA: 70
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@dabby9734
dabby9734 marked this pull request as draft April 12, 2025 14:26
@dabby9734 dabby9734 changed the title feat: implement shareable link [MPT-65] feat: implement shareable link Apr 12, 2025
@linear

linear Bot commented Apr 12, 2025

Copy link
Copy Markdown

@dabby9734

Copy link
Copy Markdown
Contributor Author

Currently facing some issues ordering the shard mentor to the first place in the display grid. Pinned queries does what we want, but I can't figure out how to configure it in our query that is constructed with the search-ui library.

@dabby9734 dabby9734 added the Help Wanted Extra attention is needed label Apr 15, 2025
@dabby9734
dabby9734 requested a review from Copilot April 17, 2025 05:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Files not reviewed (1)
  • package.json: Language not supported
Comments suppressed due to low confidence (1)

src/lib/preserveTypesEncoder.ts:41

  • The regular expression for decoding booleans uses the '*' quantifier, which may allow unexpected matches. Consider using '/^b_(true|false)_b$/' to ensure only a single occurrence of 'true' or 'false' is matched.
if (/^b_(true|false)*_b/.test(value)) {

Comment thread src/lib/preserveTypesEncoder.ts

@wei2912 wei2912 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  1. A toast notification should be created upon copying the link - https://mui.com/material-ui/react-snackbar/. Will create a separate issue for this upon merging.
  2. The solution involving the use of search-ui's preserveTypesEncoder and queryString seems a bit clunky, but I don't really see a better solution atm due to the complexity of parsing filters.
  3. A big issue is that the current solution depends on the displayed page containing the mentor in the URL. With changes to Airtable, there's no guarantee that this would be the case.

The current implementation of this feature could lead to user confusion/frustration if (3) is not addressed (e.g. imagine a user relying on the saved URLs to keep track of profiles, and then realising that the URLs are now broken with the only useful info being mentor=reclA0nqEMxI9vOTP which they can't use in the search).

Addressing (3) would require the use of pinned queries in Search UI to bump the result to the top, but there's no good documentation for this feature currently - https://discuss.elastic.co/t/implementing-pinned-queries-in-search-ui/377135. In light of this, I am inclined to postpone this PR till pinned queries are supported well.

@wei2912
wei2912 force-pushed the main branch 4 times, most recently from 6dd7430 to 3109e08 Compare March 9, 2026 13:24
@wei2912 wei2912 changed the title [MPT-65] feat: implement shareable link [MPT-163] feat: implement shareable link Mar 29, 2026
@linear

linear Bot commented Mar 29, 2026

Copy link
Copy Markdown

@netlify

netlify Bot commented Mar 29, 2026

Copy link
Copy Markdown

Deploy Preview for tender-meitner-99286b ready!

Name Link
🔨 Latest commit 6ee00c6
🔍 Latest deploy log https://app.netlify.com/projects/tender-meitner-99286b/deploys/69c93cccdfc72d00087eaaf2
😎 Deploy Preview https://deploy-preview-906--tender-meitner-99286b.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 90
Accessibility: 95
Best Practices: 100
SEO: 100
PWA: 70
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@wei2912

wei2912 commented Mar 29, 2026

Copy link
Copy Markdown
Member

Addressing (3) would require the use of pinned queries in Search UI to bump the result to the top, but there's no good documentation for this feature currently - https://discuss.elastic.co/t/implementing-pinned-queries-in-search-ui/377135. In light of this, I am inclined to postpone this PR till pinned queries are supported well.

This is in theory possible now by intercepting the search request (https://www.elastic.co/docs/reference/search-ui/api-connectors-elasticsearch#request-lifecycle-hooks - see interceptSearchRequest).

However, there is a bigger issue - the history rewriting seems to trigger repeated queries to ElasticSearch. This can be verified from the Network tab:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Help Wanted Extra attention is needed ✋ On Hold

Development

Successfully merging this pull request may close these issues.

3 participants