Closed Bug 1515306 Opened 5 years ago Closed 5 years ago

Rename UrlbarMatch to UrlbarResult

Categories

(Firefox :: Address Bar, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
Firefox 66
Tracking Status
firefox66 --- fixed

People

(Reporter: mak, Assigned: dao)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxsearch])

Attachments

(1 file)

There are a few entities names in the code that are not particularly good atm, mostly because the yare not consistent.

1. match VS result: the model uses match/matches, the view/controller use result/results. We should pick one. No particular preference here, I picked matches in the model mostly because one may think to "result" as the collection of all the matches, but in the end it doesn't really matter, consistency wins.

2. openpage VS tab: tab is imo clearer, but there's a couple exceptions where we can't change openpage, like the suggest.openpage pref.

3. addToUrlbarHistory is a poor choice, because the function just marks the next visit as typed.

4. UrlbarUtils may probably be renamed to UrlbarCommon considered it's not just a collection of utils, it also has common classes and constants. This is not particularly important anyway.

I'm going to post a patch to rename UrlbarMatch to UrlbarResult. I think we should probably rename MATCH_SOURCE to RESULT_SOURCE too, although I'd do that in a followup. Not sure about MATCH_TYPE, I think we could keep that.

(In reply to Marco Bonardo [::mak] from comment #0)

  1. openpage VS tab: tab is imo clearer, but there's a couple exceptions
    where we can't change openpage, like the suggest.openpage pref.

  2. addToUrlbarHistory is a poor choice, because the function just marks the
    next visit as typed.

  3. UrlbarUtils may probably be renamed to UrlbarCommon considered it's not
    just a collection of utils, it also has common classes and constants. This
    is not particularly important anyway.

We should get separate bugs filed on these.

Assignee: nobody → dao+bmo
Summary: Name entities more consistently → Rename UrlbarMatch to UrlbarResult

(In reply to Dão Gottwald [::dao] from comment #1)

I'm going to post a patch to rename UrlbarMatch to UrlbarResult. I think we should probably rename MATCH_SOURCE to RESULT_SOURCE too, although I'd do that in a followup. Not sure about MATCH_TYPE, I think we could keep that.

I think doing a whole s/match/result would be better, in general. Retaining some pieces referring to match may be confusing. But can also be done in steps. Also, remember to update the AddressBar.rst documentation.

Blocks: 1522425
Blocks: 1522426
Pushed by dgottwald@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0aa259de1b77
Rename UrlbarMatch to UrlbarResult. r=mak
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 66
Blocks: 1522807
No longer blocks: 1522425, 1522807, 1522426
See Also: → 1522425, 1522807, 1522426
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: