Skip to content

Conversation

nibilin33
Copy link
Contributor

Move the toolbar horizontally
add delete pod

Copy link
Collaborator

@lihebi lihebi left a comment

Choose a reason for hiding this comment

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

Thanks, Bilin! A few comments:

  1. there appear to be some problems with merging
  2. styles should be inline as I mentioned here
  3. Please use prettier to format your code.

@li-xin-yi
Copy link
Collaborator

li-xin-yi commented Nov 20, 2022

Thanks for your awesome work. Many bugs in my code are fixed in your PR, thanks a lot. I really appreciate your implementation.

However, I fetched this branch and tested, some tiny issues show up on my side but I'm not sure what cause them. Can you help me investigate them?

  1. The size of codeNode fluctuates when editing on its editor.
  2. Even when the cursor is in the editor, the codeNode is selected and draggable by cursor movement. But we are supposed to disable the drag feature when editing in case of shaking by selecting text, we intend to only drag the pod by the drag handler we set on the top.
  3. the input index is not correct, it doesn't update after run. Refresh the page, they appear but are even out of order.

@nibilin33

@nibilin33
Copy link
Contributor Author

@li-xin-yi ok, i will check this

@forrestbao
Copy link
Collaborator

@lihebi @li-xin-yi
I asked @nibilin33 to remove the shadow. It is buggy and is now redundant given now editor borders can be highlighted when focused or in editing. But if you have a reason to use shadow, please let me know.

@li-xin-yi
Copy link
Collaborator

li-xin-yi commented Nov 20, 2022

@lihebi @li-xin-yi I asked @nibilin33 to remove the shadow. It is buggy and is now redundant given now editor borders can be highlighted when focused or in editing. But if you have a reason to use shadow, please let me know.

@forrestbao Thanks for the advices. I meant to use the box shadow and its color to show which user is dragging or selecting the pod, which are of the same color with the remote cursor. This is also the awareness feature in collaborative editing. I know it may look awkward, but I have no idea how to show the awareness info for dragging/selecting operation upon a pod in a proper form. Can you give me any suggestion?

BTW, in my experimental demo (https://github.com/li-xin-yi/sharing-edited-monaco-flow), I convey the awareness and movement information by setting the pod half-transparent and changing its background color. But it seems not so suitable in our project.

@forrestbao
Copy link
Collaborator

forrestbao commented Nov 20, 2022

@forrestbao Thanks for the advices. I meant to use the box shadow and its color to show which user is dragging or selecting the pod, which are of the same color with the remote cursor. This is also the awareness feature in collaborative editing. I know it may look awkward, but I have no idea how to show the awareness info for dragging/selecting operation upon a pod in a proper form. Can you give me any suggestion?

@li-xin-yi Ah, i didn't notice the shadowing is for dragging indication. Maybe we can use border highlighting, and potentially bolding, for both code editing and dragging?

BTW, in my experimental demo (https://github.com/li-xin-yi/sharing-edited-monaco-flow), I convey the awareness and movement information by setting the pod half-transparent and changing its background color. But it seems not so suitable in our project.

This actually might be a good idea. Maybe we shall have a meeting to brainstorm different ideas to get users attention?

@nibilin33
Copy link
Contributor Author

@li-xin-yi the issues you mentioned fixed

Comment on lines -203 to -211
pod.result.text && (
<Box>
<Box sx={{ display: "flex" }} bgcolor="lightgray">
Result: [{pod.result.count}]:
</Box>
<Box>
<Box component="pre" whiteSpace="pre-wrap">
{pod.result.text}
</Box>
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to show pod.result.text. In general, when a code block executes in Jupyter, the value of the last expression should be printed. like this:

Screenshot 2022-11-20 at 4 25 36 AM

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was wondering on this too. At first I thought this was due to that CodePod does not return the evaluation of the last expression.

Comment on lines 309 to 330
const onResize = useCallback((e, data) => {
const { size } = data;
const node = nodesMap.get(id);
if (node) {
node.style = { ...node.style, width: size.width };
nodesMap.set(id, node);
updatePod({
id,
data: {
width: size.width,
height: pod.height,
},
});
}
}, []);
const onLayout = useCallback(({ height }) => {
const node = nodesMap.get(id);
if (node) {
node.style = { ...node.style, height };
nodesMap.set(id, node);
}
}, []);
Copy link
Collaborator

Choose a reason for hiding this comment

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

These were removed in #61. So there are still merging problems. There might be other places, it's tedious to check. If it is not easy to merge, maybe let's create a clean PR from the current main branch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is for width adjustment, it's different from removed one

@@ -32,6 +32,7 @@
"react-icons": "^4.6.0",
"react-monaco-editor": "^0.50.1",
"react-moveable": "^0.40.0",
"react-resizable": "^3.0.4",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Need this:

yarn add -D @types/react-resizable

Otherwise the compiler complains:

ERROR in src/components/Canvas.tsx:37:30
TS2307: Cannot find module 'react-resizable' or its corresponding type declarations.
    35 |
    36 | import Moveable from "react-moveable";
  > 37 | import { ResizableBox } from "react-resizable";
       |                              ^^^^^^^^^^^^^^^^^
    38 | import Ansi from "ansi-to-react";
    39 |
    40 | import { customAlphabet } from "nanoid";

Copy link
Collaborator

Choose a reason for hiding this comment

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

I was wondering why...I shelled into the UI instance to manually install react-resizable to fix.

@lihebi
Copy link
Collaborator

lihebi commented Nov 20, 2022

The merging problems seem complex. There is a lot of code that was removed in #61 that got added back in this PR. It's pretty hard to catch what they are. Also, this PR is getting too large to review. This might create additional conflicts with other changes that Xinyi and I are working on.

Maybe let's split this PR into smaller pieces?

@nibilin33 nibilin33 closed this Nov 21, 2022
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.

4 participants