Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

[QuickOpen] show indicator if symbols are still being parsed - #5371

Merged
jasonLaster merged 55 commits into
firefox-devtools:masterfrom
atwalg2:quickopenIndicator
Mar 2, 2018
Merged

[QuickOpen] show indicator if symbols are still being parsed#5371
jasonLaster merged 55 commits into
firefox-devtools:masterfrom
atwalg2:quickopenIndicator

Conversation

@atwalg2

@atwalg2 atwalg2 commented Feb 9, 2018

Copy link
Copy Markdown
Contributor

Associated Issue: #4488

Summary of Changes

  • Added loading text, and styled
  • Logic
  • Added snapshot

Test Plan

  • Added new snapshot

To test load a project into the debugger, then open up quick open using ctrl + o, and you should see the loading text appear, then disappear on it's own when the symbols have been parsed.

screencap

@jasonLaster

Copy link
Copy Markdown
Contributor

We don't have any spinners yet, so lets just re-use the "Loading..." message we have in some other places

@atwalg2

atwalg2 commented Feb 9, 2018

Copy link
Copy Markdown
Contributor Author

The spinner is just a temporary filler proof of concept. Where is the loading message used elsewhere?

@jasonLaster

Copy link
Copy Markdown
Contributor

@atwalg2

atwalg2 commented Feb 9, 2018

Copy link
Copy Markdown
Contributor Author

Thanks. I set it up the right way I think now (Visually). I mainly have to configure the logic to work exactly how it should, it's a bit wrong right now.

@codehag

codehag commented Feb 9, 2018

Copy link
Copy Markdown
Contributor

The travis test is failing at the moment regarding the quick-open... can you take a look? do you have experience running mochi tests? Happy to help if needed!

@atwalg2

atwalg2 commented Feb 9, 2018

Copy link
Copy Markdown
Contributor Author

@codehag no I haven't got any experience yet using mochi tests

@jasonLaster

Copy link
Copy Markdown
Contributor

looking better. How about we center the loading message and add some vertical padding

@jasonLaster

Copy link
Copy Markdown
Contributor

@atwalg2 please share a screenshot

@atwalg2

atwalg2 commented Feb 12, 2018

Copy link
Copy Markdown
Contributor Author

image

Comment thread src/components/QuickOpenModal.css Outdated
color: white;
}

.loadIndicator {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How about loading-indicator? CSS rules generally are not camel case

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll fix this right away

Comment thread src/components/QuickOpenModal.js Outdated
render() {
const { enabled, query } = this.props;
const { selectedIndex, results } = this.state;
let { selectedIndex, results, isLoading } = this.state;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

const -> let am I missing something here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

agreeing with @AnshulMalik -- since none of these variables are reassigned (and since they are part of state and should only be updated via setState), we can use const here!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll fix this right away

@codehag codehag left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

a couple of comments!

Comment thread src/components/QuickOpenModal.js Outdated
if (query == "") {
return this.showTopSources();
this.showTopSources();
return this.setState({ isLoading: false });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this.setState({ isLoading: false }); can be moved to the top of this function (since it always happens) so that we don't have it repeating in each if statement

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm glad you said this because it made me re examine my code, and realized I was causing wasteful re renders, I moved the isLoading: false to the instances when results is already being set through setState

Comment thread src/components/QuickOpenModal.js Outdated
updateResults = (query: string) => {
if (this.isGotoQuery()) {
return;
return this.setState({ isLoading: false });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hmm, re isLoading... i dont think we need it. Let me explain

the only time we're really loading is when symbols are not fetched. We can check this.props.symbols and if it doesn't have any functions it is still loading otherwise we're not

onChange and updateResults dont matter because it's instant

@atwalg2

atwalg2 commented Feb 16, 2018

Copy link
Copy Markdown
Contributor Author

Need some advice on what is going on here.

Travis Ci Error
image

from test/mochitest/browser_dbg-quickopen
image

@jasonLaster

Copy link
Copy Markdown
Contributor

hmm... i think that's happening for others

@jasonLaster

Copy link
Copy Markdown
Contributor

do you need a rebase

@jasonLaster jasonLaster left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looking good

selectedItemId={expanded ? items[selectedIndex].id : ""}
/>
{!symbols ||
(symbols.functions.length == 0 && (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

sorry, this should be symbols.identifiers i think i told you the wrong thing

@atwalg2 atwalg2 Feb 20, 2018

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

image

These are the only properties of symbols??

@darkwing

darkwing commented Mar 2, 2018

Copy link
Copy Markdown
Contributor

Hello @atwalg2 ! It looks to me like the Loading text never disappears:

foreverloading

}
/>
{!symbols ||
(symbols.functions.length == 0 && (

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This symbols.functions.length will always fail if there's no query text, so we should add that to this conditional.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also, when I do add text to the input, and there are many results, symbols.functions.length is still 0, so maybe we should be doing a different check?

@jasonLaster
jasonLaster merged commit 2fd7cb8 into firefox-devtools:master Mar 2, 2018
@jasonLaster

Copy link
Copy Markdown
Contributor

We'll be updating the loading logic in #5588 so it's not a big deal

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants