IDE redesign, initial implementation #362

Merged
Irev-Dev merged 17 commits from kurt/update-ide-panel-toolbar-360 into main 2021-06-15 10:05:03 +02:00
Irev-Dev commented 2021-06-14 02:20:20 +02:00 (Migrated from github.com)

Preview link

IDE currently looks like:
image

The gear buttons on each of the panels as well as in the bottom left hand corner currently don't do anything.

File has two options at the moment
image

View has one:
image

and Edit has none.

The share button has some temporary options that will change once we allow parts/projects to be saved on the website. Atm it dedicated to encoded-urls.
There is the fully encoded url tab:
image

as well as eternal resource URLs
image

Pasting a link changes the UI to this.
image

"Copy URL" is self explanatory, and "Create another URL" just takes you back to previous UI, but "Copy and Render" is intended to allow the user to check the code from the URL actually works, but maybe these shouldn't be coupled and it should just be "render" or "test render"?

I'm also not sure about the copy on both of these share flows, open to input.

The learn more link goes here

One other small thing is I've made the construction message collapsable, as I think it needs to be there still but nice to be able to close it.
image

I also did a fair amount of clean up.

Random grey box just as a place holder, will add users at a later point.
image

I think I'll work on the LHS panel next, but thought this work was complete enough to deploy.

Resolves #360

## [Preview link](https://60c6a5aecae47b0007bd85f3--cadhubxyz.netlify.app/) IDE currently looks like: ![image](https://user-images.githubusercontent.com/29681384/121825876-2b93e300-ccf8-11eb-83a3-18d9700f3280.png) The gear buttons on each of the panels as well as in the bottom left hand corner currently don't do anything. File has two options at the moment ![image](https://user-images.githubusercontent.com/29681384/121825929-6dbd2480-ccf8-11eb-9607-9e7f1427fd42.png) View has one: ![image](https://user-images.githubusercontent.com/29681384/121825935-77468c80-ccf8-11eb-98b4-1a8b0d594a24.png) and Edit has none. The share button has some temporary options that will change once we allow parts/projects to be saved on the website. Atm it dedicated to encoded-urls. There is the fully encoded url tab: ![image](https://user-images.githubusercontent.com/29681384/121825975-abba4880-ccf8-11eb-8cf7-7147c04b3162.png) as well as eternal resource URLs ![image](https://user-images.githubusercontent.com/29681384/121826219-ed97be80-ccf9-11eb-9010-3807ab60488f.png) Pasting a link changes the UI to this. ![image](https://user-images.githubusercontent.com/29681384/121826233-fdaf9e00-ccf9-11eb-8ada-1ee11995d924.png) "Copy URL" is self explanatory, and "Create another URL" just takes you back to previous UI, but "Copy and Render" is intended to allow the user to check the code from the URL actually works, but maybe these shouldn't be coupled and it should just be "render" or "test render"? I'm also not sure about the copy on both of these share flows, open to input. The learn more link [goes here](https://60c6a5ae140bdb000806669e--cadhub-docs.netlify.app/docs/general-cadhub/external-resource-url) One other small thing is I've made the construction message collapsable, as I think it needs to be there still but nice to be able to close it. ![image](https://user-images.githubusercontent.com/29681384/121826100-5fbbd380-ccf9-11eb-9706-e77ba7f8e64b.png) I also did a fair amount of clean up. Random grey box just as a place holder, will add users at a later point. ![image](https://user-images.githubusercontent.com/29681384/121826374-baa1fa80-ccfa-11eb-87a3-4b0d9eee6aaf.png) I think I'll work on the LHS panel next, but thought this work was complete enough to deploy. Resolves #360
Irev-Dev (Migrated from github.com) reviewed 2021-06-14 02:21:24 +02:00
@@ -0,0 +5,4 @@
import { useRender } from 'src/components/IdeWrapper/useRender'
import { makeStlDownloadHandler, PullTitleFromFirstLine } from './helpers'
const EditorMenu = () => {
Irev-Dev (Migrated from github.com) commented 2021-06-14 02:21:24 +02:00

image

![image](https://user-images.githubusercontent.com/29681384/121826268-436c6680-ccfa-11eb-9b06-ba4d61270ab5.png)
Irev-Dev (Migrated from github.com) reviewed 2021-06-14 02:21:45 +02:00
@@ -0,0 +55,4 @@
export default EditorMenu
function FileDropdown({ handleRender, handleStlDownload }) {
Irev-Dev (Migrated from github.com) commented 2021-06-14 02:21:45 +02:00

image

![image](https://user-images.githubusercontent.com/29681384/121826279-4ff0bf00-ccfa-11eb-8315-bd8a4cfc0ef7.png)
Irev-Dev (Migrated from github.com) reviewed 2021-06-14 02:21:59 +02:00
@@ -0,0 +95,4 @@
)
}
function ViewDropdown({ handleLayoutReset }) {
Irev-Dev (Migrated from github.com) commented 2021-06-14 02:21:59 +02:00

image

![image](https://user-images.githubusercontent.com/29681384/121826302-66971600-ccfa-11eb-8aa7-f48b627bc6a9.png)
Irev-Dev (Migrated from github.com) reviewed 2021-06-14 02:26:20 +02:00
@@ -0,0 +6,4 @@
import { useRender } from 'src/components/IdeWrapper/useRender'
import { toast } from '@redwoodjs/web/toast'
const ExternalScript = () => {
Irev-Dev (Migrated from github.com) commented 2021-06-14 02:26:20 +02:00

image
and

image

![image](https://user-images.githubusercontent.com/29681384/121826427-e7eea880-ccfa-11eb-9e5b-c82fd9605d87.png) and ![image](https://user-images.githubusercontent.com/29681384/121826437-f2a93d80-ccfa-11eb-9b3d-b5fa0e0968d3.png)
Irev-Dev (Migrated from github.com) reviewed 2021-06-14 02:28:06 +02:00
@@ -0,0 +26,4 @@
target,
}) => setRawUrl(target.value)
const onKeyDown = async ({ key, target }) =>
key === 'Enter' && processUserUrl(target.value)
Irev-Dev (Migrated from github.com) commented 2021-06-14 02:28:06 +02:00

When a user pastes a url it will immediately start processing it without having a "submit" button. I think this is appropriate since the whole point is to link to an external URL and no one will be typing those, you can type and hit enter though.

When a user pastes a url it will immediately start processing it without having a "submit" button. I think this is appropriate since the whole point is to link to an external URL and no one will be typing those, you can type and hit enter though.
Irev-Dev (Migrated from github.com) reviewed 2021-06-14 02:29:31 +02:00
@@ -0,0 +2,4 @@
import { copyTextToClipboard } from 'src/helpers/clipboard'
import { useIdeContext } from 'src/helpers/hooks/useIdeContext'
const FullScriptEncoding = () => {
Irev-Dev (Migrated from github.com) commented 2021-06-14 02:29:31 +02:00

image

![image](https://user-images.githubusercontent.com/29681384/121826523-65b2b400-ccfb-11eb-8c97-3d9b03505ea8.png)
Irev-Dev (Migrated from github.com) reviewed 2021-06-14 02:32:54 +02:00
@@ -0,0 +32,4 @@
}#${fetchText}=${prepareDecodedUrl(resourceUrl)}`
}
export function useIdeInit(cadPackage: string) {
Irev-Dev (Migrated from github.com) commented 2021-06-14 02:32:54 +02:00

All of the logic in this hook I had in the IdeToolbarNew because that was the main wrapping component that had the context provider, so it made sense to have init useEffects there. However since most of the logic relates to checking if there is something encoded in the URL, I thought it made sense to bundle the logic here with the rest of the encoded url code, and bring it into IdeToolbarNew as a custom hook.

I've also now rename IdeToolbarNew to IdeWrapper

All of the logic in this hook I had in the `IdeToolbarNew` because that was the main wrapping component that had the context provider, so it made sense to have init useEffects there. However since most of the logic relates to checking if there is something encoded in the URL, I thought it made sense to bundle the logic here with the rest of the encoded url code, and bring it into `IdeToolbarNew` as a custom hook. I've also now rename `IdeToolbarNew` to `IdeWrapper`
Irev-Dev (Migrated from github.com) reviewed 2021-06-14 02:34:39 +02:00
@@ -0,0 +23,4 @@
</button>
)
const IdeHeader = ({ handleRender }: { handleRender: () => void }) => {
Irev-Dev (Migrated from github.com) commented 2021-06-14 02:34:39 +02:00

image

![image](https://user-images.githubusercontent.com/29681384/121826642-1d47c600-ccfc-11eb-89d1-a0ac63141405.png)
Irev-Dev (Migrated from github.com) reviewed 2021-06-14 02:35:11 +02:00
@@ -0,0 +1,23 @@
import { Link, routes } from '@redwoodjs/router'
import Svg from 'src/components/Svg/Svg'
const IdeSideBar = () => {
Irev-Dev (Migrated from github.com) commented 2021-06-14 02:35:11 +02:00

image

![image](https://user-images.githubusercontent.com/29681384/121826656-2fc1ff80-ccfc-11eb-998b-55c254eeaae6.png)
Irev-Dev (Migrated from github.com) reviewed 2021-06-14 02:37:53 +02:00
Irev-Dev (Migrated from github.com) commented 2021-06-14 02:37:53 +02:00

Moved the context provider up to the page component.

Moved the context provider up to the page component.
franknoirot (Migrated from github.com) approved these changes 2021-06-15 00:35:01 +02:00
@@ -0,0 +5,4 @@
import { useRender } from 'src/components/IdeWrapper/useRender'
import { makeStlDownloadHandler, PullTitleFromFirstLine } from './helpers'
const EditorMenu = () => {
franknoirot (Migrated from github.com) commented 2021-06-14 15:18:09 +02:00

Did you do all these snippet images manually? They're very helpful!

Did you do all these snippet images manually? They're very helpful!
@@ -0,0 +43,4 @@
</div>
<div className="flex items-center cursor-default">
<div
className={`${isOpenScad && 'bg-yellow-200'} ${
franknoirot (Migrated from github.com) commented 2021-06-14 15:23:05 +02:00

With the additional background I added in the latest Figma designs we may want to start aliasing the CAD packages to class names in the next round so several elements can inherit styles.

With the additional background I added in the latest Figma designs we may want to start aliasing the CAD packages to class names in the next round so several elements can inherit styles.
franknoirot (Migrated from github.com) commented 2021-06-15 00:26:44 +02:00

Dig this.

Dig this.
@@ -0,0 +13,4 @@
>
<Svg name="gear" className="w-7 p-px" />
</button>
{mosaicWindowActions.connectDragSource(
franknoirot (Migrated from github.com) commented 2021-06-15 00:30:51 +02:00

Also rad!

Also rad!
Irev-Dev (Migrated from github.com) reviewed 2021-06-15 10:02:26 +02:00
@@ -0,0 +5,4 @@
import { useRender } from 'src/components/IdeWrapper/useRender'
import { makeStlDownloadHandler, PullTitleFromFirstLine } from './helpers'
const EditorMenu = () => {
Irev-Dev (Migrated from github.com) commented 2021-06-15 10:02:26 +02:00

:)
Yeah I did.
CContext is super important when trying to look at other's code. You could have figured this out yourself but 20x quicker for me to add a few screen shots.

:) Yeah I did. CContext is super important when trying to look at other's code. You could have figured this out yourself but 20x quicker for me to add a few screen shots.
Irev-Dev (Migrated from github.com) reviewed 2021-06-15 10:02:44 +02:00
@@ -0,0 +43,4 @@
</div>
<div className="flex items-center cursor-default">
<div
className={`${isOpenScad && 'bg-yellow-200'} ${
Irev-Dev (Migrated from github.com) commented 2021-06-15 10:02:44 +02:00

Oh right, yeah that's a good idea.

Oh right, yeah that's a good idea.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: h3n3/cadhub#362