Skip to content

Conversation

@psrpinto
Copy link
Member

@psrpinto psrpinto commented Nov 8, 2024

Don't pay attention to the number of commits, this PR basically just creates the /ui/import/pages directory, which implements a flow for importing pages. There was a lot of iteration so that's why the high number of commits. Best to just look at the final result.

This PR implements one flow for import pages by selecting the navigation. Later, we can adapt it how we see fit, or we can implement other flows for importing pages that do it differently. This is just a starting point, any feedback you might have can be implemented.

A note on blueprints

Blueprints is a temporary name, it should be renamed to something else in the future.

This PR implements importing pages without relying on Blueprints. Blueprints are meant for things that would be crawled, where the user defines the structure of one thing (e.g. blog post), and we than use that to automatically import all other ones.

However, things that don't need to be crawled do not need to rely on a blueprint. Instead, the user can manually import all instances.

This PR implements page import in this manual way, where there is no automatic crawling, so no blueprints are involved. In the future we may decide that we do want to crawl pages, and if so, a new flow can be implemented that relies on blueprints.

This is only part 1

This PR was getting too large, so I figured I would ship it as is, and there will be a second one that completes the flow. This PR stops after the user selected the pages (see screen recording), the next PR will have the user iteratively import all selected pages, one by one.

Summary of changes

  • Add LinkField and a navigation parser. Takes a <ul>...<ul/> and returns an array of LinkField
  • Make it so that the content script has different modes, e.g. "navigation selection" or "generic selection" modes. This was needed because the user clicks on one of the navigation links, but we want to retrieve the parent <ul>.
  • Implement the flow, under /ui/import/pages

Screen recording

Screen.Recording.2024-11-12.at.15.58.41.mov

@psrpinto
Copy link
Member Author

@akirk @ashfame I'm making progress here on what comes after what is shown in the screen recording (importing each of the pages the user selected). I should have a finished version tomorrow.

My goal is to build a first iteration of the flow here, we can then adapt it however is needed for the demo in other PRs.

@psrpinto psrpinto changed the title Import pages through navigation Import pages through navigation (part 1) Nov 12, 2024
@psrpinto psrpinto marked this pull request as ready for review November 12, 2024 16:15
@psrpinto psrpinto requested review from akirk and ashfame November 12, 2024 16:15
setUrl( selectedPages[ pageIndex ] );
}, [ session.id, pageIndex, navigate, selectedPages ] );

return <>{ url }</>;
Copy link
Member Author

Choose a reason for hiding this comment

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

The next PR will implement this component.

Copy link
Member

@ashfame ashfame left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@psrpinto psrpinto merged commit ba1242d into trunk Nov 14, 2024
@psrpinto psrpinto deleted the pages-import branch November 14, 2024 11:15
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