Skip to content
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

Add Message Screeens #57

Merged
merged 7 commits into from
Sep 16, 2024
Merged

Add Message Screeens #57

merged 7 commits into from
Sep 16, 2024

Conversation

strseb
Copy link
Collaborator

@strseb strseb commented Sep 6, 2024

This PR adds a view-router we can use to switch out the browser action main element based on ... things.
Also i add a generic message-screen factory, so we can simply add more with one func call :)

followMessages.mp4

Copy link
Member

@lesleyjanenorton lesleyjanenorton left a comment

Choose a reason for hiding this comment

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

Nice!

src/components/conditional-view.js Outdated Show resolved Hide resolved
let slot = this.slotName;
if (slot == "") {
return "default";
}
Copy link
Member

Choose a reason for hiding this comment

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

IIUC blank slot names should be caught at check at L40 which also returns "default" so I don't think we need this block.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You could have a subelement with slot="" and therefore match slotName="".
Also just no need to iterate over the children if it is empty, as i want it to use "default" in that case.

Comment on lines 43 to 57
hasSlot(slotName) {
return Array.from(this.children).some((e) => {
e.slot === slotName;
});
}
getTargetSlot() {
let slot = this.slotName;
if (slot == "") {
return "default";
}
if (!this.hasSlot(slot)) {
return "default";
}
return slot;
}
Copy link
Member

Choose a reason for hiding this comment

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

Do we need hasSlot() and getTargetSlot() here too?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hahaha spotted copy pasting

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 really should setup a macro in my editor to create lit components 😅

Copy link
Member

Choose a reason for hiding this comment

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

It can be our first extension devtool! 🛠️

@strseb strseb merged commit 2d80597 into main Sep 16, 2024
5 checks passed
@strseb strseb deleted the basti/subscribeNow! branch September 16, 2024 15:21
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.

2 participants