debugger icon indicating copy to clipboard operation
debugger copied to clipboard

[Tabs] Sources without URLs should have a tab

Open digitarald opened this issue 8 years ago • 20 comments

STR:

  • Open Console
  • type Tdebugger`
  • Hit Enter

AR: Broken UI state that doesn't show a tab for the source, scope or and pausing

image

digitarald avatar Jan 15 '18 00:01 digitarald

There isn't a tab here because there isn't a URL associated with the script. We likely want to indicate that with a tab title: eval (5) or something like that.

jasonLaster avatar Jan 18 '18 16:01 jasonLaster

Bug, UX polish or feature, @jasonLaster ?

digitarald avatar Jan 18 '18 23:01 digitarald

/claim

atwalg2 avatar Feb 27 '18 03:02 atwalg2

Thanks for claiming the issue! :wave:

Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.

:fox_face: Debugger team!

claim avatar Feb 27 '18 03:02 claim

Hello @atwalg2 ! How is this going?

darkwing avatar Mar 12 '18 21:03 darkwing

Hey @darkwing, I got pulled away from this to fix some mistakes I made on previous PR's. I hope to get back to it asap.

atwalg2 avatar Mar 13 '18 01:03 atwalg2

I've seen lots of stuff going in from you @atwalg2 -- awesome! Is this still on your radar or should we unclaim it?

darkwing avatar Mar 21 '18 21:03 darkwing

Yea we should probably just unclaim it now

On Mar 21, 2018 3:58 PM, "David Walsh" [email protected] wrote:

I've seen lots of stuff going in from you @atwalg2 https://github.com/atwalg2 -- awesome! Is this still on your radar or should we unclaim it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/devtools-html/debugger.html/issues/5102#issuecomment-375109582, or mute the thread https://github.com/notifications/unsubscribe-auth/AWEltvr7NWWrPNAPFTdkkM4HDXUqah6Fks5tgszugaJpZM4RdzMa .

atwalg2 avatar Mar 22 '18 13:03 atwalg2

I just saw something similar on https://angular-quickstart.glitch.me/ . does the ngfactory file fall into the same issue, @jasonLaster ?

screenflow

digitarald avatar May 23 '18 21:05 digitarald

looks more like this one #5663

jasonLaster avatar May 23 '18 21:05 jasonLaster

I can't reproduce this issue on stackoverflow.com

Alaso, when trying https://angular-quickstart.glitch.me/ (from this comment) I can see a bit different behavior:

  1. Load https://angular-quickstart.glitch.me/
  2. Select Angular/AppModule/module.ngfactory.js -> A new tab is opened with the source
  3. Select Angular/AppModule/module.ngfactory.js (mapped) -> No tab is selected and no source displayed.

image

@darkwing Could this be related to the recent tabs for source-mapped files #6867?

@digitarald Can you still reproduce this issue?

Honza

janodvarko avatar Aug 30 '18 14:08 janodvarko

STR:

  1. in the console, evaluate debugger

image

jasonLaster avatar Aug 30 '18 15:08 jasonLaster

Sreenshot from the Launchpad:

image

janodvarko avatar Aug 30 '18 15:08 janodvarko

I've been looking into why eval`d cases weren't given a tab and I think I've found the root cause. We're using the following selector for tabs:

export const getSourceTabs = createSelector(
  getTabs,
  getSources,
  getUrls,
  (tabs, sources, urls) =>
    tabs.filter(tab =>
      getSourceByUrlInSources(sources, urls, tab.url, tab.isOriginal)
    )
);

export const getSourcesForTabs = createSelector(
  getSourceTabs,
  getSources,
  getUrls,
  (tabs, sources, urls) => {
    return tabs
      .map(tab =>
        getSourceByUrlInSources(sources, urls, tab.url, tab.isOriginal)
      )
      .filter(Boolean);
  }
);

The issue here is tab.url is null for eval'd sources in the store:

missingtab

And so despite having stored the tab, we never find it because we search by URL and filter out when none is found.

We might be able to experiment with setting the tab.url to getFormattedSourceId(source.id)for URL-less sources; we'd have to see what can of worms that opens.

darkwing avatar Aug 30 '18 15:08 darkwing

oh gosh...

jasonLaster avatar Aug 30 '18 15:08 jasonLaster

An additional consideration: Since URL-less tabs can be added to prefs, there isn't a case where they get removed, so prefs.tabs could probably grow to large with a bunch of dead objects.

darkwing avatar Aug 30 '18 16:08 darkwing

We may want to consider the idea of a "TemporaryTab" for eval'd sources; these temporary tabs would be "cleaned up" (removed) from the prefs.tabs upon a "NAVIGATE" event.

darkwing avatar Aug 30 '18 16:08 darkwing

/claim

Doomwyte avatar Sep 22 '18 16:09 Doomwyte

Thanks for claiming the issue! :wave:

Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.

:fox_face: Debugger team!

claim avatar Sep 22 '18 16:09 claim

Hello @Doomwyte! At present we store tabs in both the redux store and prefs (localStorage). @jasonLaster had the awesome idea to store the two a bit differently so that tabs without URLs can still be stored in redux but not in localStorage. Check out this diff:

https://gist.github.com/jasonLaster/e64acadbb15d11dd1901179aba85af80

The advantage to making this change is that (1) we don't want URL-less tabs stored in preferences because we can't do anything with them in the future and (2) we can still give them a tab in the UI because, despite not having a URL, they are still a Source.

We can talk more about this in our next video chat, but it would be good to think about in the mean time. 👍

darkwing avatar Sep 24 '18 18:09 darkwing