stakwork / sphinx-js

Web extension and PWA for Sphinx.chat and 2nd Brain
2 stars 2 forks source link

Create "Add secondbrain flow" #6

Open ecurrencyhodler opened 10 months ago

ecurrencyhodler commented 10 months ago

User Story

Add Second Brain As a user, I paste a URL to the chrome extension and hit enter to add it to my Chrome Extension and see it in my home screen. As a user, I paste a URL to the chrome extension and see an error screen if none can be found. As a user, I paste another URL to the chrome extension to add another Second Brain.

Technical considerations In the front end we have to save the url specifically for that secondbrain. The reason for that is due to the API calls we will make to fund the account and submit content.

When a user adds a Second Brain to the chrome extension, we must make a call to see if the Second Brain exists. Make an /about call to the Second Brain. The call should return a bunch of information such as app_version, mission statement, and title. Grab the title and add that as the title for the Second Brain inside the Chrome Extension.

When an API is called, this is the logic we use to derive the API call from the url. Note that the Bitcoin secondbrain is different.

Here is an example /about call to the bitcoin secondbrain. You can use this one to test: https://knowledge-graph.sphinx.chat/about

Lastly, multiple secondbrains can be added.

Designs

23 Paste url 24 Success Screen This screen will persist for 3 seconds. They can also click out of it earlier if they click anywhere inside the success screen. 25 Fund secondbrain After they add the Second Brain, they should be prompted to fund. See #4. But in the intermediary state, you can take them to this home screen. Please note the 0 balance and fund button. 35 Failed to add Second Brain Screen This happens when nothing gets returned when you make the API call. Add Second Brain - Error

Multiple secondbrains 38

You can find the figma file here. Use dev mode for precise specs.

dylanbathurst commented 10 months ago

I can take this one.