Skip to content
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

Add tabtest viewer to IDE #1585

Merged
merged 2 commits into from
Dec 25, 2018
Merged

Add tabtest viewer to IDE #1585

merged 2 commits into from
Dec 25, 2018

Conversation

evgenykochetkov
Copy link
Contributor

Closes #1540

@evgenykochetkov evgenykochetkov self-assigned this Dec 7, 2018
@evgenykochetkov evgenykochetkov force-pushed the feat-tabtest-markers branch 4 times, most recently from f3f669b to dc9150e Compare December 10, 2018 17:47
@nkrkv
Copy link
Member

nkrkv commented Dec 12, 2018

Looks nice, but I'm experiencing some strange behavior.

Steps to reproduce

  1. Drill down to xod/math/abs tabtests
  2. Double click the empty cell to the right of 0 on the second line to invoke the input

Expected behavior

  • No jumps/resizes are done, the content starts editing inline literally

Actual behavior

  • The cell becomes ~50px wider
  • The cell becomes ~4px taller

Steps to reproduce

  1. Drill down to xod/math/abs tabtests
  2. Span the selection to the two cells with 0's on the second row
  3. Press Ctrl+X

Expected behavior

  • The contents are moved to the clipboard
  • The cells are erased (or will erase on paste)

Actual behavior

  • The whole table is replaced with
IN	OUT
"some input"	"expected output"
  • Ctrl+Z does not work to undo the mess

Copy link
Member

@nkrkv nkrkv left a comment

Choose a reason for hiding this comment

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

Scrollbars are missing if the grid overflows the work area 😢

nkrkv
nkrkv previously requested changes Dec 12, 2018
@@ -85,7 +85,7 @@ const terminalOriginalDirectionLens = R.lensProp('originalDirection');
const isLeafPatchWithImplsOrTerminal = def(
'isLeafPatchWithImplsOrTerminal :: Patch -> Boolean',
R.anyPass([
Patch.hasImpl,
R.both(Patch.isPatchNotImplementedInXod, Patch.hasImpl),
Copy link
Member

Choose a reason for hiding this comment

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

This check looks strange: if an apple is green and greenish.

Why can’t we have a single function to check for the implementation presence? That is, we should kill either Patch.isPatchNotImplementedInXod or Patch.hasImpl

packages/xod-client/src/editor/containers/Editor.jsx Outdated Show resolved Hide resolved
packages/xod-client/src/project/reducer.js Outdated Show resolved Hide resolved
packages/xod-project/built-in-patches.xodball Outdated Show resolved Hide resolved
'createAttachmentManagedByMarker :: PatchPath -> String -> Attachment',
(markerName, content) =>
createAttachment(
// TODO: what about unknown filenames?
Copy link
Member

Choose a reason for hiding this comment

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

I think it’s a bug. Pick from MANAGED_ATTACHMENT_FILENAMES with Maybe, explode with assertion

@@ -795,6 +795,7 @@ export const extractPatches = R.curry(
const convertPatch = def(
'convertPatch :: Project -> [Pair PatchPath Patch] -> Patch -> Patch',
(project, leafPatches, patch) =>
// TODO: check for marker instead of hasImpl?
Copy link
Member

Choose a reason for hiding this comment

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

See above. There should be just one proper way to check impl.

@brusherru
Copy link
Contributor

brusherru commented Dec 13, 2018

About UX:

  1. It would be awesome if I can add a column or row without manually moving cells.
  2. The first row could have special styles
  3. Selecting cells with Shift key will be handy ;)

And about overflow and scrollbars, note that grid can overflow in both ways: vertical / horizontal ;)

@evgenykochetkov evgenykochetkov force-pushed the feat-tabtest-markers branch 4 times, most recently from af783e2 to 3b54e62 Compare December 14, 2018 17:03
@evgenykochetkov evgenykochetkov force-pushed the feat-tabtest-markers branch 2 times, most recently from 2548323 to 2102a10 Compare December 17, 2018 10:11
@nkrkv
Copy link
Member

nkrkv commented Dec 18, 2018

Looks nice, but I'm experiencing some strange behavior.

Steps to reproduce

1. Drill down to `xod/math/abs` tabtests

2. Double click the empty cell to the right of 0 on the second line to invoke the input

Expected behavior

* No jumps/resizes are done, the content starts editing inline literally

Actual behavior

* The cell becomes ~50px wider

* The cell becomes ~4px taller

The behavior is still here on Linux. Interesting thing: I can shut it up if add:

.data-grid-container .data-grid .cell > input {
  width: 140px;
}

140px is a measured width of a .cell in the normal state.

@nkrkv
Copy link
Member

nkrkv commented Dec 18, 2018

The table looks more organized if the very first row is rendered center-aligned and in bold:

.tabtest-editor tr:first-child .cell {
    font-weight: bold;
    text-align: center;
}

@knopki
Copy link
Member

knopki commented Dec 18, 2018

IMHO, "tabt..." looks not very nice. There is no easy way to make node two-cells-wide or just name it "tests"?

@nkrkv
Copy link
Member

nkrkv commented Dec 18, 2018

May I suggest alternate coloring?

screenshot from 2018-12-18 11-50-07

It’s 2px borders of the color matching background $chrome-bg and foreground of $dark-light. Selection borders should be adjusted as well.

@nkrkv
Copy link
Member

nkrkv commented Dec 18, 2018

IMHO, "tabt..." looks not very nice. There is no easy way to make node two-cells-wide or just name it "tests"?

It’s a common pain for marker nodes in XOD. Eventually, we’ll implement auto-growth (#937) and the problem goes away. As a temporary solution we might make all markers two-three cells in width and/or manually resizable. That’s a question for a separate PR though.

@@ -37,3 +37,23 @@
background-color: #444444;
}
}

@mixin styled-scrollbar {
Copy link
Member

Choose a reason for hiding this comment

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

👍 for utilizing mixins

cursor: cell;
background-color: $input-bg;
color: $input-color-text;
transition : background-color 500ms ease;
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
transition : background-color 500ms ease;
transition : background-color 100ms ease;

500ms is more than human reaction time, so looks boring. Animations look snappier when done in 50-200ms

valueRenderer={R.prop('value')}
overflow={'nowrap'}
onCellsChanged={(changes, additions = []) => {
R.compose(
Copy link
Member

Choose a reason for hiding this comment

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

Can you please extract it to a function? Now we have a complex nested function right inside deeply nested React component.

@nkrkv
Copy link
Member

nkrkv commented Dec 18, 2018

Also, what’s for the past comments about a single way to check whether a C++ implementation is present?

@nkrkv
Copy link
Member

nkrkv commented Dec 18, 2018

…and I suggest making cell editor inputs left-aligned. Otherwise experience is strange when I’m entering a long comment which overflows single cell boundaries

@evgenykochetkov evgenykochetkov force-pushed the feat-tabtest-markers branch 3 times, most recently from e671456 to 3668c4c Compare December 19, 2018 16:34
@brusherru
Copy link
Contributor

brusherru commented Dec 21, 2018

🐛 Can't copy-paste markers tabtest and not-implemented-in-xod 🔥

@brusherru
Copy link
Contributor

brusherru commented Dec 21, 2018

Bad UX
When I write a wide tabtest and horizontal scrollbar has appeared, after any change in the right column and press enter key horizontal scrollbar position is dropped and I have to scroll again...

Also, navigating with arrow keys are not scrolls the window, so I can select something outside the view area. When I start editing it — it scrolls.

Also if I might change column width, it can fit the window :)

@evgenykochetkov
Copy link
Contributor Author

Fixed copy-pasting bug, thanks!

Navigating with arrow keys should be available in the very near future: nadbm/react-datasheet#92

Not sure what you mean by

Also if I might change column width, it can fit the window :)

Do you want resizable columns?

@brusherru
Copy link
Contributor

@evgenykochetkov yep, I'm about resizable columns :) But, actually, it's out of scope 🙈
And it's not so trivial... where to store column width? The easiest and very questionable solution that I know is to store it right in local storage like a Map PatchPath [WidthInPx].

Copy link
Contributor

@brusherru brusherru left a comment

Choose a reason for hiding this comment

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

LGTM, but left some suggestions about styling.
Also, it will be good to add selecting all with Cmd+A and select cells with the pressed Shift key, but it could be a tweak in another PR in nearest future.

Copy link
Member

@nkrkv nkrkv left a comment

Choose a reason for hiding this comment

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

LGTM 🔥 for the release of tabtest

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.

None yet

4 participants