The default bug view has changed. See this FAQ.

Search field should pre-fill with selected text

RESOLVED FIXED in Firefox 25

Status

()

Firefox
Developer Tools: Debugger
P3
enhancement
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: jryans, Assigned: dorian jaminais)

Tracking

Trunk
Firefox 25
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [good first bug][mentor=vporof@mozilla.com][lang=js])

Attachments

(1 attachment, 1 obsolete attachment)

If there is text selected in the source view of the debugger and then a search keyboard shortcut is pressed, the search field should start out with the selected text already filled in the field.

This is similar to what currently happens with the browser's find in page function.
Priority: -- → P3
Whiteboard: [good first bug][mentor=vporof@mozilla.com][lang=js]
Hi Victor,

I am interested in working on this bug. Can you please help me get started with it?

Thanks.
(In reply to Abhishek Potnis [:abhishekp] from comment #1)

Hi, thanks for the interest. You can get the currently selected source editor text via getEditorSelection in debugger-view.js. With that information, you can modify the _doSearch function in the FilterView object from debugger-toolbar.js, which is called whenever a search key is pressed.

You'll also need to add some testing for this, and modifying browser_dbg_scripts-searching-01.js with a few more assertions should be enough.
Assignee: nobody → abhishekp.bugzilla
Status: NEW → ASSIGNED
(Assignee)

Comment 3

4 years ago
Created attachment 766443 [details] [diff] [review]
added simple fix and unit test
Attachment #766443 - Flags: review?(vporof)
Comment on attachment 766443 [details] [diff] [review]
added simple fix and unit test

Review of attachment 766443 [details] [diff] [review]:
-----------------------------------------------------------------

Yeah, this looks good! Thank you Dorian. r+ with a green try run. Do you have try access? If not I can push for you.

::: browser/devtools/debugger/test/browser_dbg_scripts-searching-01.js
@@ +266,5 @@
>      is(gSources.visibleItems.length, 1,
>        "Not all the scripts are shown after the search. (20)");
>      isnot(gSources.widget.getAttribute("label"), noMatchingSources,
>        "The scripts container should not display a notice that matches are found.");
> +    

Nit: some extra whitespace here.
Attachment #766443 - Flags: review?(vporof) → review+
Assignee: abhishekp.bugzilla → dorian
Try run: https://tbpl.mozilla.org/?tree=Try&rev=56b00727e7ab
(Assignee)

Comment 6

4 years ago
Thank you Victor for reviewing my patch so quickly.

I don't have try access but have seen that you pushed it.
(In reply to dorian jaminais from comment #6)
> Thank you Victor for reviewing my patch so quickly.
> 
> I don't have try access but have seen that you pushed it.

Test seems to be failing on OS X. This is because you'll need to use accelKey instead of ctrlKey when synthesizing the event in the test. OS X uses cmd+F instead of ctrl+F for searching.

Oh, and while you're at it, please use "is" instead of "ok" for testing the searchbox value.
Attachment #766443 - Flags: review+ → feedback+
(Assignee)

Comment 8

4 years ago
Created attachment 766776 [details] [diff] [review]
updated the test to use accelKey instead of ctrlKey

I applied both recommendation form victor.
Attachment #766443 - Attachment is obsolete: true
Flags: needinfo?(vporof)
Comment on attachment 766776 [details] [diff] [review]
updated the test to use accelKey instead of ctrlKey

Review of attachment 766776 [details] [diff] [review]:
-----------------------------------------------------------------

<3
Attachment #766776 - Flags: review+
Flags: needinfo?(vporof)
(Assignee)

Comment 10

4 years ago
:)

Thank you very much for your review.
Pushed again to try: https://tbpl.mozilla.org/?tree=Try&rev=99f95523c250
There's a timeout on OS X 10.6 debug, but it happens exactly at a sweet spot just before the test finishes. requestingLongerTimeout should be enough, I'll add it just before landing.
Landed on inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/35a7fc610f84
https://hg.mozilla.org/mozilla-central/rev/35a7fc610f84
Status: ASSIGNED → RESOLVED
Last Resolved: 4 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 25
You need to log in before you can comment on or make changes to this bug.