-
Notifications
You must be signed in to change notification settings - Fork 5
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
Import blog post flow #29
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
psrpinto
force-pushed
the
highlight-content
branch
4 times, most recently
from
September 10, 2024 10:08
1018b2d
to
53c647e
Compare
psrpinto
force-pushed
the
highlight-content
branch
3 times, most recently
from
September 11, 2024 13:19
d0860f8
to
f9f1d27
Compare
psrpinto
force-pushed
the
highlight-content
branch
from
September 12, 2024 10:32
bd4c3a4
to
b398714
Compare
ashfame
approved these changes
Sep 17, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements the UI for importing a single blog post. It doesn't import anything yet though, communication with the WP API will be implemented later.
This is just the basic UI, I will iterate on it in future PRs. See next steps below.
Screen.Recording.2024-09-12.at.11.54.30.mov
Next steps
Summary of changes
flows
The import process for each type of content (post, page, product, etc) is called a "flow" and is implemented as a component, under
ui/flows/
. For example, the flow for importing a single blog post is atui/flows/blog-post/BlogPostFlow
. This PR only implements theblog-post
flow, in the future there will be other ones.bus
There's now a
bus
module (as in, message bus) that allows for communication between the app and the content script, and vice-versa. I looked into usingcomlink
for this, but AFAICT it doesn't work out of the box in web extensions, so I decided to keep it simple for now.The
app
has anAppBus
and the content script has aContentBus
. Under the hood, these "buses" usesendMessage()
, they're just a means to expose a specific API on top ofsendMessage()
.The
ContentBus
currently exposes the following actions:enableHighlighting
, to start the highlighting of hovered elementsdisableHighlighting
, to stop the highlighting of hovered elementsThe
AppBus
currently exposes the following actions:elementClicked
, to communicate which element has been clicked in the content windowYou would call one of the actions as follows:
You can start listening to messages with:
For the moment there can only be a single listener per bus, but we can easily change this if/when there is a need for more than one.