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

Implement collapsible rows in code editor #83

Merged
merged 4 commits into from
Nov 5, 2024

Conversation

shapeseas
Copy link
Collaborator

@shapeseas shapeseas commented Sep 20, 2024

Closes #82

- Replaces code editor component with Monaco
- Monaco is what VSCode is built on, so it looks quite good.
- onChange passes the new text value within the editor, which is simple
  to deal with, especially in comparison to CodeMirror
- Certain styling was not needed for Monaco Code Editor, so those were
  removed
- The div on the right column for the code editor was locking once expanded, so it could not shrink. In the dev tools, the div was saying "This item was clamped to its minimum size". Updated the styling on that div to allow for shrinking/growing.
Copy link

cypress bot commented Sep 24, 2024

deliberation-researcher-portal    Run #74

Run Properties:  status check failed Failed #74  •  git commit 8685ed4827: Updated Cypress tests for monaco code editor
Project deliberation-researcher-portal
Run status status check failed Failed #74
Run duration 01m 22s
Commit git commit 8685ed4827: Updated Cypress tests for monaco code editor
Committer Eric Shapiro
View all properties for this run ↗︎

Test results
Tests that failed  Failures 1
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 0

Tests for review

Failed  cypress/e2e/test.cy.ts • 1 failed test

View Output

Test Artifacts
test spec > passes Test Replay Screenshots

@shapeseas
Copy link
Collaborator Author

Seems like the reason it failed the test was because of:

AssertionError: Timed out retrying after 4000ms: Expected to find element: [data-cy="code-editor"], but never found it.
at Context.eval (webpack://researcher-portal/./cypress/e2e/test.cy.ts:10:0)

Note that data-cy is now part of the monaco editor, which may be causing the issue.

- This is because Monaco Editor may not be able to take in custom
  attributes.
- Need to get() monaco editor differently a sthe data-cy="code-editor"
  is on a wrapping div, not the code editor itself
- Cypress interactions with monaco code editor work slightly
  differently, especially type(), so these have been updated
@shapeseas
Copy link
Collaborator Author

Still an error (see below). Cypress tests are passing locally, though, so need to understand why there is a discrepancy.

AssertionError: Timed out retrying after 4000ms: Expected to find content: '- name: Element 4' within the element: <div.monaco-editor.no-user-select.showUnused.showDeprecated.vs> but never did.

@shapeseas
Copy link
Collaborator Author

Still failing on a re-run with the same test and code, but now with this:

AssertionError: Timed out retrying after 4000ms: Expected to find element: [data-cy="element-1-1"], but never found it.

@shapeseas shapeseas mentioned this pull request Sep 25, 2024
@shapeseas shapeseas merged commit 8685ed4 into main Nov 5, 2024
0 of 2 checks passed
@shapeseas shapeseas deleted the eric/feat-collapse-rows-monaco branch November 5, 2024 17:56
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.

[FEATURE]: Create collapsable/uncollapsable chunks of YAML
1 participant