Skip to content

Conversation

@DonJayamanne
Copy link

@DonJayamanne DonJayamanne commented Feb 4, 2020

For #9884

Can't seem to add a functional test for monaco focus.

@DonJayamanne DonJayamanne added the no-changelog No news entry required label Feb 4, 2020
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 4, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.5% 0.5% Duplication

@codecov-io
Copy link

codecov-io commented Feb 4, 2020

Codecov Report

Merging #9885 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #9885   +/-   ##
=======================================
  Coverage   61.22%   61.22%           
=======================================
  Files         563      563           
  Lines       30058    30058           
  Branches     4545     4545           
=======================================
  Hits        18403    18403           
  Misses      10626    10626           
  Partials     1029     1029
Impacted Files Coverage Δ
src/client/common/utils/platform.ts 76.47% <0%> (ø) ⬆️
src/client/linters/pylint.ts 98.27% <0%> (ø) ⬆️
src/client/linters/pydocstyle.ts 88.88% <0%> (ø) ⬆️
src/client/datascience/debugLocationTracker.ts 78.12% <0%> (ø) ⬆️
src/client/common/process/proc.ts 15.21% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0bcdb57...a013ca2. Read the comment docs.

const addIndex = prevState.cellVMs.findIndex(c => c.cell.id === arg.payload.cellId);

const anotherCellWasFocusedAndSelected = typeof prevState.focusedCellId === 'string' && prevState.focusedCellId === prevState.selectedCellId;
const shouldSetFocusToCell = typeof shouldFocusCell === 'boolean' ? shouldFocusCell : anotherCellWasFocusedAndSelected;
Copy link
Member

Choose a reason for hiding this comment

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

Hold on a second, don't we already have a focus cell action? This looks like what got us into trouble before, by having functions perform their own version of an action instead of using the base action.

Copy link
Member

Choose a reason for hiding this comment

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

To explain better, previously for defocus we had a defocus action where "stuff" had to happen. But some other actions were defocusing cells without using that action so we were not performing the correct defocusing work. This looks similar.

Copy link
Author

Choose a reason for hiding this comment

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

With the new changes in the ds/custom_editor branch, we no longer need a defocus concept.
Basically setting focus or selecting a cell, automatically unselects and unfocuses the previously selected/focused cells.

Copy link
Author

Choose a reason for hiding this comment

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

This is an existing action for selectCell, that also sets focus to the cell if required.
I don't think we have a focus action.

Copy link
Author

Choose a reason for hiding this comment

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

I take that back, we do have a focus action
Looks like it needs to be cleaned up.
Today the select action also sets focus!
If you're ok with it, i'd rather fix that as a seprate PR, I can do that in the ds/custom_editor branch.

And I agree, it needs to be fixed up, to avoid this confusion (basically fix the separation of concerns... focus will deal with focus, and select with deal with select)

Copy link
Member

Choose a reason for hiding this comment

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

A new PR is fine. Just want to make sure that we don't get into trouble like before.

Copy link
Member

@IanMatthewHuff IanMatthewHuff left a comment

Choose a reason for hiding this comment

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

One thing to discuss quick, see comment.

@DonJayamanne DonJayamanne merged commit 9afb925 into microsoft:master Feb 4, 2020
@DonJayamanne DonJayamanne deleted the fixFocus branch February 4, 2020 20:07
@lock lock bot locked as resolved and limited conversation to collaborators Feb 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

no-changelog No news entry required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants