[Tabs] Sources without URLs should have a tab
STR:
- Open Console
- type Tdebugger`
- Hit Enter
AR: Broken UI state that doesn't show a tab for the source, scope or and pausing

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.
Bug, UX polish or feature, @jasonLaster ?
/claim
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!
Hello @atwalg2 ! How is this going?
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.
I've seen lots of stuff going in from you @atwalg2 -- awesome! Is this still on your radar or should we unclaim it?
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 .
I just saw something similar on https://angular-quickstart.glitch.me/ . does the ngfactory file fall into the same issue, @jasonLaster ?

looks more like this one #5663
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:
- Load https://angular-quickstart.glitch.me/
- Select
Angular/AppModule/module.ngfactory.js-> A new tab is opened with the source - Select
Angular/AppModule/module.ngfactory.js (mapped)-> No tab is selected and no source displayed.

@darkwing Could this be related to the recent tabs for source-mapped files #6867?
@digitarald Can you still reproduce this issue?
Honza
STR:
- in the console, evaluate
debugger

Sreenshot from the Launchpad:

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:
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.
oh gosh...
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.
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.
/claim
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!
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. 👍