Skip to content

Conversation

@AllegroFox
Copy link
Collaborator

@AllegroFox AllegroFox commented Oct 18, 2024

Uses window.postMessage to send message JSON to Limelight, allowing us to handle more message data than we can by encoding a URL. (github.io will truncate URLs after a certain length, which almost all of our messages exceed.)

So far I've only enabled this for Spotlights and Infobars in the production table, as these are the types of messages that Limelight currently knows about. We can incrementally add support for more templates to Limelight and add those templates to the SupportedTypes array, similarly to how we did for message preview.

Unfortunately window.postMessage requires exact URLs in order to work, so we won't be able to see this working in the deploy preview. I've tested it extensively locally though, and we can always just remove the links from the table if there are issues after landing.

@netlify
Copy link

netlify bot commented Oct 18, 2024

Deploy Preview for fxms-skylight ready!

Name Link
🔨 Latest commit f902127
🔍 Latest deploy log https://app.netlify.com/sites/fxms-skylight/deploys/672264af9bdd330008e7ecdd
😎 Deploy Preview https://deploy-preview-446--fxms-skylight.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: 100 (🟢 up 6 from production)
Accessibility: 91 (🟢 up 2 from production)
Best Practices: 92 (🟢 up 9 from production)
SEO: 100 (🟢 up 10 from production)
PWA: -
View the detailed breakdown and full score reports

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

@AllegroFox AllegroFox changed the title Add support for editing messages with Limelight, where possible [WIP] Add support for editing messages with Limelight, where possible Oct 18, 2024
@AllegroFox AllegroFox changed the title [WIP] Add support for editing messages with Limelight, where possible Add support for editing messages with Limelight, where possible Oct 28, 2024
@AllegroFox AllegroFox requested review from dmose and sarahhjchung and removed request for dmose October 28, 2024 22:05
@dmose
Copy link
Member

dmose commented Oct 29, 2024

When I try to run this branch locally, I see this:

grafik

@AllegroFox
Copy link
Collaborator Author

@dmose Is it possible you've got some malformed JSON on your local? I'm only able to trigger that if I do something like remove the screens array from a message, or put a "spotlight" template on something that isn't a spotlight fr. ex.
I can wrap this function in a try/catch or something so that messages with wonky JSON don't generate edit links :)

@dmose
Copy link
Member

dmose commented Jan 28, 2025

@dmose Is it possible you've got some malformed JSON on your local? I'm only able to trigger that if I do something like remove the screens array from a message, or put a "spotlight" template on something that isn't a spotlight fr. ex. I can wrap this function in a try/catch or something so that messages with wonky JSON don't generate edit links :)

@AllegroFox I did some debugging, and it turns out that this data is coming from Looker, despite the function names: https://github.com/mozilla/skylight/blob/main/app/page.tsx#L150-L152 (though, to be fair, this link is to current main, and I've rebased my copy locally against current main). That said, I just checked a non-rebased version, and still saw the problem. When you run with Looker enabled locally, do you see the problem?

What happened, I think, is that the functions were written in a world before we got production data from Looker, and when the refactoring introduced that, the function names didn't change.

At the very least we're going to want to rename some functions here so stacks are less confusing.

CC @sarahhjchung

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