Last Comment Bug 97023 - Search/Find in page UI: toolbar instead of dialog
: Search/Find in page UI: toolbar instead of dialog
Status: RESOLVED FIXED
:
Product: SeaMonkey
Classification: Client Software
Component: UI Design (show other bugs)
: Trunk
: All All
: -- normal with 5 votes (vote)
: seamonkey2.1a3
Assigned To: Ben Frisch
:
:
Mentors:
: 62467 183522 231916 400504 460906 (view as bug list)
Depends on: 7930 524886 566736 567306 567309 584630
Blocks: 70771 257489 316646 581691 583589
  Show dependency treegraph
 
Reported: 2001-08-26 03:33 PDT by Pierre Chanial
Modified: 2010-08-30 12:34 PDT (History)
25 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
wanted


Attachments
Findbar Patch v.1 (17.03 KB, patch)
2009-10-25 20:33 PDT, Ben Frisch
no flags Details | Diff | Splinter Review
Findbar Patch v.2 (25.48 KB, patch)
2009-10-26 21:12 PDT, Ben Frisch
no flags Details | Diff | Splinter Review
Findbar Patch v.2 + White Space Cleanup (30.06 KB, patch)
2009-10-26 21:31 PDT, Ben Frisch
no flags Details | Diff | Splinter Review
Findbar Patch v.3 (29.57 KB, patch)
2009-10-30 15:39 PDT, Ben Frisch
kairo: ui‑review+
Details | Diff | Splinter Review
Findbar Patch v.4 (24.12 KB, patch)
2010-04-12 14:52 PDT, Ben Frisch
neil: review-
Details | Diff | Splinter Review
Findbar Patch v.5 (24.67 KB, patch)
2010-06-15 22:05 PDT, Ben Frisch
neil: review+
Details | Diff | Splinter Review
Findbar Patch v.6 (17.99 KB, patch)
2010-07-11 13:47 PDT, Ben Frisch
neil: review+
Details | Diff | Splinter Review
Findbar Patch v.7 (19.53 KB, patch)
2010-07-20 22:04 PDT, Ben Frisch
no flags Details | Diff | Splinter Review
Findbar Patch v.8 (19.74 KB, patch)
2010-07-23 04:56 PDT, Ben Frisch
neil: review+
neil: superreview+
Details | Diff | Splinter Review
Tidy up findUtils.js (967 bytes, patch)
2010-08-30 03:31 PDT, Ian Neal
no flags Details | Diff | Splinter Review
Fix for find again (1.36 KB, patch)
2010-08-30 07:03 PDT, neil@parkwaycc.co.uk
iann_bugzilla: review+
Details | Diff | Splinter Review

Description Pierre Chanial 2001-08-26 03:33:04 PDT
I think having an integrated Find in page panel could be a nice feature.

Why?
- it would get rid of a pop-up (see bug 7930) that masks randomly the text
(especially the matched part, as implied by the Murphy's Law) and that can
appear randomly in the desktop (at least on linux 2.2)
- consistency with the simple search panel in mail (bug 63573) and addressbook
(bug 83023).
- not having Find pop-up we don't know the parent's window.
- ergonomy:
  o few buttons
  o preferences rarely changed are hidden
  o easy implementation of many enhancement features with an advanced button.
- easier implementation of a search history droplist
- enhanced usability

This is an example of what could appear/disappear toggling with CTRL-F:
-+-----------------------------------------------------------------+
 | Find in page for: |____|v| (<) (>)           (Clear) (Advanced) |
 +-------------------------^-^-------------------------------------+
 |                                                                 |
 :                                                                 :


Clicking on advanced search would show (when all features implemented):
-+-------------------------------------------------+
 | Find in page for: |____|v| (<)(>) (Clear)(Hide) |
 +-------------------------^-^---------------------+
S|  . Search as typing                             | (bug 30088)
I|  x Search always from the beginning of the page | (bug 87037)
D|  x Search cycling throught the window           | (see bug 91520)
E|  . Match exact case                             | (see bug 49331)
B|  . Match exact diacritic characters             | (from bug 7930)
A|  . Match exact exact alef hamza                 | (from bug 7930)
R|  . Match * and ? wildchars                      | (bug 32641)
 |  . Match regular expressions                    | (bug 37941)
 |  . Match whole words only                       | (bug 14871)
 +-------------------------^-^---------------------+
 |                                                 |
 :                    Browser Lay-out              :

**WARNING**: I presented the settings in one column. They should be in two
columns to save space.

Notes:
- (<) search again backwards Ctrl-Shift-G (see bug 77704)
- (>) search again forwards, Ctrl-G
- |v| button to show the search history (bug 70771) as in the location bar.
- ^-^ in lines when clicked on close the advanced panel or the search panel.
- I proposed an UI for features that don't exist yet. I know it's bad. I did it
so that the advanced panel would not appear useless with only warp and exact case.
- I prefer 'Cycle throught the window' instead of 'wrap' this word is not much
understood by non-native anglisch spikkers even with the Merriam Webster's
dictionnary.
- and sth like 'Search as typing' (don't know if it is grammatically correct)
instead of 'Incremental...'
- If no match: (I hate pop-ups) a red label 'Not Found!' appears:
+------------------------------------------------------------------+
| Find in page for: |Bla__|v| (<)(>) Not found! (Clear) (Advanced) |
+------------------------------------------------------------------+
- Mozilla window is dynamical. We shouldn't think as ns4.x-developpers but as
xul-developpers.
- For accessibility keys/focus, I have some ideas that could be discussed in time.
Comment 1 Henri Sivonen (:hsivonen) (Not reading bugmail or doing reviews until 2016-10-03) 2001-08-26 03:38:22 PDT
Confirmed plus "me too".
Comment 2 Pierre Chanial 2001-08-26 04:18:47 PDT
There should be also alerts indicating
- Beginning of the page!
- End of the page!
if the wrap around option is unselected and if there is at least one match.

From bug 7930, timeless suggested a Find All facility that would highlight all
the matches and that could be useful. (is it a filed bug?)
Could be put in the advanced panel as
| x Search for all occurences at once. |
Comment 3 Jesse Ruderman 2001-10-24 09:52:21 PDT
What will happen when I hit tab during a search?  Will it go to the content 
area because focus is in a toolbar, or will it go to the next link/form element 
after the selection (found text) like in IE?  (See also bug 66597, "tab should 
start from insertion point or beginning of selection".)
Comment 4 timeless 2002-11-02 22:32:36 PST
uid is being phased out.
Comment 5 Cyrus Dolph 2002-11-13 12:04:40 PST
I'd like to comment that a big problem with dialog box searches is that when
browsing with multiple windows, it's easy to get in a situation in which you
have 4 browser windows and 3 search boxes open, and no way to tell which search
box is associated with which browser window.  A toolbar search would be soooo
helpful!
Comment 6 R.K.Aa. 2002-12-04 12:05:43 PST
*** Bug 183522 has been marked as a duplicate of this bug. ***
Comment 7 reb 2003-01-31 20:58:22 PST
See bug 162204, IMO the way find should be done and I hope this toolbar
will incorporate it.

Today ctrl-G to repeat, respects last established search direction, and
I like it. Do you propose ctrl-G will change to alias your button (>):
always forward (not last established direction)?
Comment 8 Jo Hermans 2004-01-23 02:41:24 PST
*** Bug 231916 has been marked as a duplicate of this bug. ***
Comment 9 Blake Ross 2004-04-03 15:19:01 PST
Reassigning obsolete bugs to their respective Seamonkey owners (i.e. nobody). 
If you want this fixed for Firefox, change the Product and Component accordingly
and reassign back to me.
Comment 10 Masayuki Nakano [:masayuki] (Mozilla Japan) (Offline: 9/19, 9/22-9/25, 9/28)) 2005-11-14 14:03:04 PST
I fixed bug 55751 and bug 113187.
Therefore, we cannot use IME for FAYT on SeaMonkey(Win32 Only).
We MUST need to fix this before the release of SeaMonkey with Gecko1.9.
However, currently FAYT of Firefox is very buggy.
I'm working for the bugs now.
If I will finish these working, I will try to fix this.

But if you want to work for this, please take this :-)
Comment 11 Robert Kaiser 2005-11-16 05:30:44 PST
Some UI for FAYT would be nice definately, and integrating this with non-popup "find in page" UI would be a good idea as well, I'm very opposed to do the same as Firefox though, because the bar at the bottom of the page is very unintuitive and contrary to all other UI concepts we use that have the important UI at the top (toolbars etc., also search in mailnews) or left (sidebar), where the user looks first.
Also people should be able to easily pref off the UI for the FAYT case.
Comment 12 Masayuki Nakano [:masayuki] (Mozilla Japan) (Offline: 9/19, 9/22-9/25, 9/28)) 2005-11-16 05:48:01 PST
> contrary to all other UI concepts we use that have the
> important UI at the top (toolbars etc., also search in mailnews)

If we will position to top of the content, the content is shaked by the toolbar visible changed.

See Asa's comment
http://weblogs.mozillazine.org/asa/archives/2005/09/berkun_switches_to_firefox.html
> His first criticism is of the Find toolbar's location, at the bottom of the app rather than the top. We tried both configurations and the bottom was the solution that didn't cause the content area to shift down a couple of lines. This seemed much less jarring. We haven't done any serious usability testing on this but we've been following the feedback quite closely and Scott's not alone in this concern.
Comment 13 Masayuki Nakano [:masayuki] (Mozilla Japan) (Offline: 9/19, 9/22-9/25, 9/28)) 2005-11-16 05:50:34 PST
> Also people should be able to easily pref off the UI for the FAYT case.

We cannot do this. See my comment in bug 250309 comment 30 and below.
Comment 14 Robert Kaiser 2005-11-16 06:06:29 PST
(In reply to comment #12)
> > contrary to all other UI concepts we use that have the
> > important UI at the top (toolbars etc., also search in mailnews)
> 
> If we will position to top of the content, the content is shaked by the toolbar
> visible changed.

I know, and I don't care. We are NOT Firefox, BTW. And:

See Asa's comment "We haven't done any serious usability testing on this"

So basically he says "we just wanted it that way". It's wrong in UI style though. Additionally - see below.

(In reply to comment #13)
> > Also people should be able to easily pref off the UI for the FAYT case.
> 
> We cannot do this. See my comment in bug 250309 comment 30 and below.

We can do this. The code is not that hard to do (defaulting to "FAYT toolbar on"), and people who don't need IME input might just not want to care about that toolbar popping up. (And remember again, we are NOT Firefox.)
Comment 15 Masayuki Nakano [:masayuki] (Mozilla Japan) (Offline: 9/19, 9/22-9/25, 9/28)) 2005-11-16 06:17:49 PST
> and people who don't need IME input might just not want to care about
> that toolbar popping up. (And remember again, we are NOT Firefox.)

I cannot accept it. I think that all feature MUST be internationalized.
IME users will say, "Why cannot use IME at Find Toolbar hidden mode? It's a bug, the developers should fix it!".
Comment 16 Robert Kaiser 2005-11-16 07:14:43 PST
(In reply to comment #15)
> > and people who don't need IME input might just not want to care about
> > that toolbar popping up. (And remember again, we are NOT Firefox.)
> 
> I cannot accept it. I think that all feature MUST be internationalized.
> IME users will say, "Why cannot use IME at Find Toolbar hidden mode? It's a
> bug, the developers should fix it!".

Just because there's a bug for IME users in this mode doesn't mean we can't implement it for everyone else. If we would work like this, we'd need to remove FAYT completely for the moment. Would you like us to do that?
Comment 17 Masayuki Nakano [:masayuki] (Mozilla Japan) (Offline: 9/19, 9/22-9/25, 9/28)) 2005-11-16 07:48:11 PST
> Would you like us to do that?

I don't so, therefore, I refacted the FAYT of Firefox after 1.0.
(On Firefox 1.0, we couldn't use IME on FAYT)
But we should not implement if internationalizable is not in prospect.
Comment 18 Robert Kaiser 2005-11-16 08:07:17 PST
Well it's as easy as defaulting it to showing the toolbar (on top) and adding a pref into the FAYT panel of advanced > keyboard naviagtion that states "hide find toolbar (does not work with IME input)".
If people are warned about that, this should be enough, IMHO.
As I said, the possibilty that it might not work with some input methods is no reason for adding a non-default feature that many of us would like to use. We should explain that possibilty to users who turn it off though.
Comment 19 Masayuki Nakano [:masayuki] (Mozilla Japan) (Offline: 9/19, 9/22-9/25, 9/28)) 2005-11-16 08:14:28 PST
Additional info.
If we implement with Javascript and without editor, central European cannot input accents. See bug 270936.
Comment 20 zug_treno 2008-02-01 09:33:43 PST
*** Bug 400504 has been marked as a duplicate of this bug. ***
Comment 21 Masayuki Nakano [:masayuki] (Mozilla Japan) (Offline: 9/19, 9/22-9/25, 9/28)) 2009-06-18 03:33:53 PDT
I'm resetting bugs which are assigned to me but I'm not working on them and I don't have plan for fixing them in near future.
Comment 22 zug_treno 2009-06-25 08:43:38 PDT
*** Bug 460906 has been marked as a duplicate of this bug. ***
Comment 23 Ben Frisch 2009-10-25 20:33:04 PDT
Created attachment 408318 [details] [diff] [review]
Findbar Patch v.1

This patch makes the findbar come up as a toolbar above the tabbrowser when invoking find in page instead of the dialog.  It also adds a preference so that the findbar can be hidden (and use the current FAYT code) for auto-started find as you type; however, there is no support in the findbar binding right now to allow it to be hidden when manually invoking find as you type. Also, the current code allows a browser.findbar.enabled pref to be set to false to switch back to using the dialog; however, there is no preference UI for that as I am not sure where to put it. Also, while the findbar looks good in modern, it could use some theme work in Mac OS classic, which I assume should be a separate bug. (I'm not setup to build Seamonkey on Windows and Linux right now.)  Does this seem like a good approach?  Is it still a desired feature?
Comment 24 neil@parkwaycc.co.uk 2009-10-26 03:49:24 PDT
Comment on attachment 408318 [details] [diff] [review]
Findbar Patch v.1

To fix the issue of not being able to disable the findbar completely, we could write an extension to the findbar binding, like we did for the notification, preferences and toolbar bindings.

>+pref("browser.findbar.enabled", true);
...
>+pref("accessibility.typeaheadfind.seamonkeyautostart", true);
>+pref("accessibility.typeaheadfind.usefindbar", true);
What's the difference between these preferences?

>+	  <field name="_fastFind">null</field>
There were 7 new whitespace errors in your patch. This is just one of them.
[There were also 4 old errors; it would be nice if you could fix them too.]

>+    document.getElementById("FindToolbar").onFindCommand();
Not all windows have a FindToolbar element...

>+  else 
>   {
>+    // is the dialog up already?
>+    if ("findDialog" in window && window.findDialog)
Nit: could write "else if"
Comment 25 Robert Kaiser 2009-10-26 04:22:21 PDT
(In reply to comment #23)
> Does this seem like a good approach?  Is it still a desired feature?

It's surely still desired, I'll look at how it looks once 2.0 is safely out the door ;-)
Comment 26 Stefan [:stefanh] 2009-10-26 13:00:10 PDT
(In reply to comment #23)
> Created an attachment (id=408318) [details]
> Findbar Patch v.1
> 
> This patch makes the findbar come up as a toolbar above the tabbrowser when
> invoking find in page instead of the dialog.

Even though I don't know if it will work I'm curious to know if you have considered doing it like Safari (below the tabs and search field at the right)?

> Also, while the findbar looks good in modern, it
> could use some theme work in Mac OS classic, which I assume should be a
> separate bug.

Yeah, definitely a separate bug. But it doesn't look too bad, I think. Might need to re-work the tabstrip, though (but you shouldn't worry about that).
Comment 27 Ben Frisch 2009-10-26 21:12:33 PDT
Created attachment 408551 [details] [diff] [review]
Findbar Patch v.2

(In reply to comment #24)
> (From update of attachment 408318 [details] [diff] [review])
> To fix the issue of not being able to disable the findbar completely, we could
> write an extension to the findbar binding, like we did for the notification,
> preferences and toolbar bindings.

Done.

> >+pref("browser.findbar.enabled", true);
> ...
> >+pref("accessibility.typeaheadfind.seamonkeyautostart", true);
> >+pref("accessibility.typeaheadfind.usefindbar", true);
> What's the difference between these preferences?

Browser.findbar.enabled enables the findbar instead of the dialog for searches started from the edit menu, while accessibility.typeaheadfind.usefindbar enables the findbar for type ahead find searches instead of the status bar type ahead find.  The accessibility.typeaheadfind.seamonkeyautostart preference was used to keep the preference to automatically start find as you type separate from accessibility.typeaheadfind which the find bar checked, but since the I have now overridden the findbar binding, we can just use accessibility.typeaheadfind.seamonkeyautostart and have both the findbar and the status bar type ahead find check the value of accessibility.typeaheadfind.usefindbar.

> >+	  <field name="_fastFind">null</field>
> There were 7 new whitespace errors in your patch. This is just one of them.
> [There were also 4 old errors; it would be nice if you could fix them too.]
I should have fixed the white space errors in my patch, and anything else I could find. 

> >+    document.getElementById("FindToolbar").onFindCommand();
> Not all windows have a FindToolbar element...
Now, if there is not a FindToolbar element, we will revert back to the dialog.

> >+  else 
> >   {
> >+    // is the dialog up already?
> >+    if ("findDialog" in window && window.findDialog)
> Nit: could write "else if"
Done.

> Even though I don't know if it will work I'm curious to know if you have
> considered doing it like Safari (below the tabs and search field at the right)?

I'd be willing to implement that if it's preferred.


Also, I added the findbar to the top of the view source window as well.  Finally, while adding the new preference, I noticed that the disabling of the "Links only" and "Any text in the page" radio buttons didn't work when use find as you type was unchecked (even in 2.0).  It is fixed in this patch, but I could move the small fix to a separate patch if desired.
Comment 28 Ben Frisch 2009-10-26 21:31:30 PDT
Created attachment 408553 [details] [diff] [review]
Findbar Patch v.2 + White Space Cleanup

This patch is the same as the previous patch, except that it actually contains the white space cleanup.
Comment 29 neil@parkwaycc.co.uk 2009-10-27 06:50:54 PDT
(In reply to comment #27)
> Finally, while adding the new preference, I noticed that the disabling of the
> "Links only" and "Any text in the page" radio buttons didn't work when use find
> as you type was unchecked (even in 2.0).  It is fixed in this patch, but I
> could move the small fix to a separate patch if desired.
Yes, and file a new bug please, so we can fix it in 2.0.1 too.
Comment 30 Stefan [:stefanh] 2009-10-27 13:35:43 PDT
(In reply to comment #27)
 
> > Even though I don't know if it will work I'm curious to know if you have
> > considered doing it like Safari (below the tabs and search field at the right)?
> 
> I'd be willing to implement that if it's preferred.

That would be extremely cool imo, but you might want to get the idea confirmed by your reviewers before you start doing any work. Also, since the content area will decrease in height you'll need to compensate for that in some way (otherwise the page will jump downwards).
Comment 31 Ben Frisch 2009-10-30 15:39:31 PDT
Created attachment 409432 [details] [diff] [review]
Findbar Patch v.3

This patch changes initPrefs() to initFindPrefs() as Chatzilla already uses initPrefs(), resulting in Chatzilla working again.  I removed the patch for 524886 from my patch, and I removed the code to disable the "Show find toolbar during find as you type" checkbox since that option still applies to the manually started find as you type.  Also, I want to clarify that accessibility.typeaheadfind.autostart is being modified instead of accessibility.typeaheadfind.seamonkeyautostart by the preference pane now and used by both the overridden findbar and Seamonkey's status bar type ahead find.
Comment 32 Robert Kaiser 2009-11-02 07:40:25 PST
Comment on attachment 409432 [details] [diff] [review]
Findbar Patch v.3

From the UI POV, I like this as a first step - it's much better than the popup window and it allows people with an IME to use find as you type by flipping that pref.

I still think it would be nice to get it into the content area, ideally along with some way to not shift down a page that has scollbars enabled, but we can do that in a followup patch.
Comment 33 Robert Kaiser 2010-02-21 04:31:04 PST
Neil, can we move this patch forward?
Comment 34 neil@parkwaycc.co.uk 2010-02-21 06:54:30 PST
Comment on attachment 409432 [details] [diff] [review]
Findbar Patch v.3

One problem I noticed with this was that the menuitems for typeaheadfind did not invoke the findbar. (Obviously this should use the usefindbar pref.)

>-pref("browser.startup.homepage",	   "chrome://navigator-region/locale/region.properties");
>+pref("browser.startup.homepage",      "chrome://navigator-region/locale/region.properties");
Nit: some miscellaneous whitespace changes crept in to the patch. Rather annoying given that the patch contains 12 new whitespace inconsistencies.

>     <vbox id="appcontent" flex="1"
>          ondragdrop="nsDragAndDrop.drop(event, contentAreaDNDObserver);">
> 
>+      <findbar id="FindToolbar" browserid="content"/>
Nit: not sure what that blank line was doing there before, but I think it would be slightly nicer to put the findbar before it.

>+      default:    
>+        // Don't start if typeahead find is disabled or
>+        //   if findbar is taking care of type ahead find
>+        if (!this.mPrefs.getBoolPref("autostart") ||
>+            this.mPrefs.getBoolPref("usefindbar"))            
I'm not sure this is necessary, the findbar should call preventDefault() already if it is active.

>+    <field name="_fastFind">null</field>
Nit: incorrect indentation

>+      <property name="fastFind" readonly="true">
There's no obvious place to add these, but between goHome and homePage looks wrong; try making it either the first thing in the implementation or the third last i.e. just before the constructor.

>+   Seamonkey Flexibile Findbar
Flexible

>+  <binding id="findbar"
>+           extends="chrome://global/content/bindings/findbar.xml#findbar">
>+    <implementation>
>+      <constructor><![CDATA[
You should find that you don't need most of this since the extended findbar constructor will run anyway.

>+        prefsvc.addObserver("accessibility.typeaheadfind.usefindbar",
>+                            this._observer, false);
You never remove this observer.

>+      <field name="_observer"><![CDATA[({
I'm not sure whether it will help, but if you give your observer a different name then the toolkit findbar's observer will do the prefs that it knows about and your observer only has to know about the usefindbar pref.

>+  if (gFindPrefs.getBoolPref("enabled") && findToolbar)
Nit: check findToolbar first before the enabled pref. (Possibly even change initPrefs into isFindToolbarEnabled?)

>+    return true;
>+  else
Nit: don't need else after return.

>     <groupbox align="start">
>       <caption label="&findAsYouTypeBehavior.label;"/>
>       <checkbox id="findAsYouTypeEnableAuto"
>                 label="&findAsYouTypeEnableAuto.label;"
>                 accesskey="&findAsYouTypeEnableAuto.accesskey;"
>                 preference="accessibility.typeaheadfind.autostart"/>
>+      <checkbox id="findAsYouTypeFindbarEnable"
>+                class="indent"
>+                label="&findAsYouTypeFindbarEnable.label;"
>+                accesskey="&findAsYouTypeFindbarEnable.accesskey;"
>+                preference="accessibility.typeaheadfind.usefindbar"/>
>+      <description>&findAsYouTypeFindbarEnableTip.label;</description>
This checkbox makes no sense here. The sense of the flow is as follows:
>Find automatically when typing within a web page: Any text in the page / Links only.
I would say that it probably belongs after the sound and timeout checkboxes.
(Move the <preference> element too of course.)

>+<!ENTITY findAsYouTypeFindbarEnable.label "Show find toolbar during find as you type">
>+<!ENTITY findAsYouTypeFindbarEnable.accesskey "S">
>+<!ENTITY findAsYouTypeFindbarEnableTip.label "Find as you type without showing the findbar does not allow international text entry.">
Nit: This should say "Note: Find as you type without ...
Comment 35 Robert Kaiser 2010-04-06 06:00:28 PDT
Benjamin: Can you update that patch for the review comments?
Comment 36 Ben Frisch 2010-04-12 14:52:20 PDT
Created attachment 438579 [details] [diff] [review]
Findbar Patch v.4

Sorry about the delay.  I have been busy with school.

This patch should address all of Neil's comments.  I'm uncomfortable changing utilityOverlay.xul to get the find as you type menu items to work, but I figured it was better than changing nsTypeAheadFind.js or making the findbar able to respond to goDoCommand.  I'm open to suggestions though.

Thanks.
Comment 37 neil@parkwaycc.co.uk 2010-04-14 06:23:36 PDT
Comment on attachment 438579 [details] [diff] [review]
Findbar Patch v.4

>+  return (document.getElementById("FindToolbar")
>+          && gFindPrefs.getBoolPref("enabled"));
Nit: && belongs at end of previous line

>+function findLinksAsType()
>+function findTextAsType()
I'm not enthralled by these names, but then again the best suggestion I have is to insert "You" between "As" and "Type".

>+  var findbar = document.getElementById("FindToolbar");
>+  if (isFindbarEnabled())
>+    findbar.open(findbar.FIND_LINKS);
findbar.open doesn't quite do all the things you need. See _onBrowserKeypress

>   <command id="cmd_findTypeText" 
>-           oncommand="goDoCommand('cmd_findTypeText')"/>
>+           oncommand="findTextAsType()"/>
>   <command id="cmd_findTypeLinks" 
>-           oncommand="goDoCommand('cmd_findTypeLinks')"/>
>+           oncommand="findLinksAsType()"/>
Nit: include a ; in the statement
Comment 38 neil@parkwaycc.co.uk 2010-04-14 13:10:04 PDT
Comment on attachment 438579 [details] [diff] [review]
Findbar Patch v.4

>+        this._useTypeAheadFind =
>+          prefsvc.getBoolPref("accessibility.typeaheadfind.autostart");
This doesn't quite work because the base binding is trying to update the same value, but for the accessibility.typeaheadfind preference. I guess we have to hope that nobody will actually change it. Or maybe removing the toolkit's observer for the accessibility.typeaheadfind preference will work.

>+            }
>+         }
Nit: indentation is one space too few.

>+var gFindPrefs;
We can now use Services.prefs.getBoolPref directly, simplifying this code. In fact, it might be worth eliminating isFindbarEnabled altogether, like this:
function findInPage(findInstData)
{
  var findbar = document.getElementById("FindToolbar");
  if (findbar && Services.prefs.getBoolPref("browser.findbar.enabled"))
    findbar.onFindCommand();
  else ...

>+function findLinksAsType()
>+{
>+  var findbar = document.getElementById("FindToolbar");
>+  if (isFindbarEnabled())
This is wrong since isFindbarEnabled checks the pref for the find dialog but you want to check the pref for the find as you type.

>+    findbar.open(findbar.FIND_LINKS);
Following on from my point about this not being enough to start a new type ahead find, it might be an idea to write a findbar.startNewFind method to avoid duplicating the code for links and text.
Comment 39 Robert Kaiser 2010-05-29 13:56:30 PDT
Note that bug 411754 now has removed our our view source and uses the toolkit one (with the findbar displayed at the top though) so that part/line of this patch can be dropped.
Comment 40 Robert Kaiser 2010-06-15 05:36:52 PDT
Ben, any chance we can have an updated patch this week? It looks like we're freezing for Alpha 2 on the 22nd, and I'd love to see this in the code until then...
Comment 41 Ben Frisch 2010-06-15 22:05:08 PDT
Created attachment 451474 [details] [diff] [review]
Findbar Patch v.5
Comment 42 Ben Frisch 2010-06-15 22:35:30 PDT
Comment on attachment 451474 [details] [diff] [review]
Findbar Patch v.5

This should address all of Neil's issues, except it brings up a problem/bug and a few things to discuss.  Thanks for waiting.  Hopefully, we can get something in by code freeze.

Problem (Bug):
If the user invokes FAYT on either about:blank or about:config using the keyboard with the findbar enabled, the component based FAYT is activated as findbar's FAYT will not start on either URL via the keyboard, but the component FAYT will.  I attached my attempted patch to disable component FAYT on about:config or about:blank.  I tried to get it working during my free time these past few days and I haven't figured out why the comparison is failing.  Any advice?

For Discussion:
1) Whether the findbar as implemented now should be in Alpha 2 as it:
- a) is located above the tab bar
- b) is decent looking but doesn't blend in with the other toolbars in any theme, especially on Mac OS X Classic
- c) problems may be introduced with mozilla-central fixes for the lazy loading findbar in Firefox, where it is currently not lazy loading in this patch
- d) nsTypeAheadFind.js will have to be updated to not use XPCOMComponentUtils
- e) see issue above (separate patch? file another bug? include about:addons?)

2) Future Findbar directions (File a meta-bug and dependent bug for each? Should any be a part two of this bug? Good plan?):
- a) Fix 1.e
- b) Fix the toolbar appearance
- c) Help out with lazy loading findbar.xml fixes, and then lazy load findbar in SeaMonkey too
- d) Fix 1.a. by porting bug 347930 to SeaMonkey (perhaps switch to extending Firefox's tabbrowser.xul with the previews and customizable close button?)
- e) Make sure nsTypeAheadFind.js keeps working

In my opinion, even with the above issues, it is an improvement that should go in after review+, but perhaps some of these should be put in the release notes if they aren't fixed by code freeze.  Of course, I'm open though.  I will see what can do in getting to the future steps before then, but any help would appreciated.
Comment 43 Philip Chee 2010-06-16 01:06:23 PDT
> Problem (Bug):
> If the user invokes FAYT on either about:blank or about:config using the
> keyboard with the findbar enabled, the component based FAYT is activated as
> findbar's FAYT will not start on either URL via the keyboard, but the component
> FAYT will.  I attached my attempted patch to disable component FAYT on
> about:config or about:blank.  I tried to get it working during my free time
> these past few days and I haven't figured out why the comparison is failing. 
> Any advice?

Related bugs?
Bug 569342 - Find bar should not be enabled in about:addons
  Bug 570760 - Make ctrl-f and / focus the search box in the add-ons manager.
Bug 567306 - Find command(ctrl+F) does not start looking for it with a selected text on the actual page.
Comment 44 neil@parkwaycc.co.uk 2010-06-16 16:44:07 PDT
Comment on attachment 451474 [details] [diff] [review]
Findbar Patch v.5

Mostly OK, but I did seem to find some new nits that I'd maybe missed before...

>+    // disable FAYT in about:config and about:blank to prevent FAYT
>+    // opening unexpectedly - to fix bugs 264562, 267150, 269712
FAYT should be pretty hard to accidentally trigger in about:config since it only contains a textbox and a tree, and they both eat keypresses.
IMHO about:blank is actually a bug, since a document could easily contain a blank frame and inject nodes into it. So maybe we should ignore them.

>+   Seamonkey Flexible Findbar
Nit: SeaMonkey

>+          xmlns:xbl="http://www.mozilla.org/xbl"
>+          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
Nit: these two attributes are only used in conjunction with <content>.

>+        prefsvc.removeObserver("accessibility.typeaheadfind",
>+                                 this._observer);
Nit: incorrect alignment         ^

>+      <field name="_smObserver"><![CDATA[({
Nit: Would you mind calling this _suiteObserver?

>+          prefsvc.removeObserver("accessibility.typeaheadfind",
>+                                 this._observer);
Nit: didn't you remove this in the constructor?

>+            if (elt instanceof HTMLInputElement) {
>+              // block FAYT when an <input> textfield element is focused
>+              var inputType = elt.type;
>+              switch (inputType) {
>+                case "text":
>+                case "password":
>+                case "file":
>+                  return false;
>+               }
Nit: toolkit code changed here to work with alternate input types.

>+          // disable FAYT in about:config and about:blank to prevent FAYT
>+          // opening unexpectedly - to fix bugs 264562, 267150, 269712
See above.

>+      <method name="smMenuFastFind">
Nit: This isn't very suite-specific so you could just call it startFastFind, or maybe suiteFastFind or suiteStartFastFind.

>+
>+
Nit: doubled blank line

>+      <checkbox id="findAsYouTypeFindbarEnable"
>+                  label="&findAsYouTypeFindbarEnable.label;"
>+                  accesskey="&findAsYouTypeFindbarEnable.accesskey;"
>+                  preference="accessibility.typeaheadfind.usefindbar"/>
>       </vbox>
>+      <description>&findAsYouTypeFindbarEnableTip.label;</description>
I need to check against my Windows build, but on my Linux build this overflows the pref pane :-( One workaround is to make the radiogroup horizontal.

>+<!ENTITY findAsYouTypeFindbarEnable.label "Show find toolbar during find as you type">
Nit: Show the find toolbar
Comment 45 Robert Kaiser 2010-06-16 17:52:38 PDT
(In reply to comment #42)
> For Discussion:
> 1) Whether the findbar as implemented now should be in Alpha 2 as it:
> - a) is located above the tab bar

We should look into tab bar issues anyhow, let's file a followup bug for this issue.

> - b) is decent looking but doesn't blend in with the other toolbars in any
> theme, especially on Mac OS X Classic

That's another thing that shouldn't block us but go into a followup bug.

> - c) problems may be introduced with mozilla-central fixes for the lazy loading
> findbar in Firefox, where it is currently not lazy loading in this patch

We should try to have this patch working at the point in time where it's landing in the tree, anything else can be addressed later.

> - d) nsTypeAheadFind.js will have to be updated to not use XPCOMComponentUtils

Why that?

> In my opinion, even with the above issues, it is an improvement that should go
> in after review+

I agree. We are still in alpha state anyhow.
Comment 46 neil@parkwaycc.co.uk 2010-06-17 02:27:35 PDT
(In reply to comment #44)
>(From update of attachment 451474 [details] [diff] [review])
>>+      <checkbox id="findAsYouTypeFindbarEnable"
>>+                  label="&findAsYouTypeFindbarEnable.label;"
>>+                  accesskey="&findAsYouTypeFindbarEnable.accesskey;"
>>+                  preference="accessibility.typeaheadfind.usefindbar"/>
>>       </vbox>
>>+      <description>&findAsYouTypeFindbarEnableTip.label;</description>
>I need to check against my Windows build, but on my Linux build this overflows
>the pref pane :-(
This looks fine on Windows, so maybe it's an issue with my Linux build. Anyone else care to comment?
Comment 47 neil@parkwaycc.co.uk 2010-06-17 02:28:21 PDT
Comment on attachment 451474 [details] [diff] [review]
Findbar Patch v.5

r=me if you remove the about:blank/config checks and fix the other minor nits (don't worry about the pref pane for now).
Comment 48 Jens Hatlak (:InvisibleSmiley) 2010-06-27 04:43:54 PDT
(In reply to comment #46)
> >I need to check against my Windows build, but on my Linux build this overflows
> >the pref pane :-(
> This looks fine on Windows, so maybe it's an issue with my Linux build. Anyone
> else care to comment?

I cannot see an issue there here on Kubuntu Lucid Lynx (pretty much with default settings, after all this is just my newly setup Linux test VM). Maybe it'd help if you added a screenshot.

Pro Tip: Request feedback on an attachment from specific persons to actually get feedback. ;-)
Comment 49 Robert Kaiser 2010-06-27 16:02:34 PDT
(In reply to comment #48)
> Pro Tip: Request feedback on an attachment from specific persons to actually
> get feedback. ;-)

Erm, the patch has review. The only thing needed here is an updated patch for the latest comments. Unfortunately, this has missed Alpha 2 just because that updated patch didn't come around, but I hope we get that fast so we can drive Benjamin's cool work here into the tree!
Comment 50 Ben Frisch 2010-07-11 13:47:36 PDT
Created attachment 456771 [details] [diff] [review]
Findbar Patch v.6

Thanks for the reviews, and sorry about the delay.  This should address all of Neil's comments, and should hopefully be ready for check-in.  I renamed smMenuFastFind to startFastFind.  

The preferences dialog looks fine on Mac OS X 10.6 and Ubuntu 10.04 with the default settings for me.
Comment 51 Philip Chee 2010-07-11 21:54:04 PDT
> +findbar[xpfe="false"] {
> +  -moz-binding: url("chrome://communicator/content/bindings/findbar.xml#findbar");
> +}
> +findbar {
> +  -moz-binding: url("chrome://communicator/content/bindings/findbar.xml#findbar");
> +}
Hmm? Typo?

In Firefox toggleAffectedChrome() opens/closes the findbar. Don't we have to do the same?

In Firefox there is this comment:

/**
 * Returns true if |aMimeType| is text-based, false otherwise.
 *
 * @param aMimeType
 *        The MIME type to check.
 *
 * If adding types to this function, please also check the similar
 * function in findbar.xml
 */
function mimeTypeIsTextBased(aMimeType)

Perhaps we should add a similar comment to our implementation of mimeTypeIsTextBased()
Comment 52 neil@parkwaycc.co.uk 2010-07-14 04:48:14 PDT
(In reply to comment #51)
> > +findbar[xpfe="false"] {
> > +  -moz-binding: url("chrome://communicator/content/bindings/findbar.xml#findbar");
> > +}
> > +findbar {
> > +  -moz-binding: url("chrome://communicator/content/bindings/findbar.xml#findbar");
> > +}
> Hmm? Typo?
> 
> In Firefox toggleAffectedChrome() opens/closes the findbar. Don't we have to do
> the same?
Looks like it.

> In Firefox there is this comment:
> 
> /**
>  * Returns true if |aMimeType| is text-based, false otherwise.
>  *
>  * @param aMimeType
>  *        The MIME type to check.
>  *
>  * If adding types to this function, please also check the similar
>  * function in findbar.xml
>  */
> function mimeTypeIsTextBased(aMimeType)
> 
> Perhaps we should add a similar comment to our implementation of
> mimeTypeIsTextBased()
We could do but that's beyond the scope of this bug.
Comment 53 neil@parkwaycc.co.uk 2010-07-14 04:50:38 PDT
Comment on attachment 456771 [details] [diff] [review]
Findbar Patch v.6

>+findbar[xpfe="false"] {
>+  -moz-binding: url("chrome://communicator/content/bindings/findbar.xml#findbar");
>+}
r=me with this fixed.

It would be nice if you could fix toggleAffectedChrome too but if you prefer you can do it in a follow up patch.
Comment 54 Ben Frisch 2010-07-20 22:04:51 PDT
Created attachment 458910 [details] [diff] [review]
Findbar Patch v.7

This should address Neil's and Philip's comments.  I created bug 580520 for the comment fix.
Comment 55 neil@parkwaycc.co.uk 2010-07-21 04:01:37 PDT
(In reply to comment #54)
> Created attachment 458910 [details] [diff] [review]
> Findbar Patch v.7
Wrong fix for comment #53 - the problem was that the [xpfe="false"] binding had the wrong URL which needed to be corrected, not removed ;-)

toggleAffectedChrome changes look fine though.
Comment 56 Ben Frisch 2010-07-23 04:56:01 PDT
Created attachment 459774 [details] [diff] [review]
Findbar Patch v.8

Ah, I took a look at communicator.css again, and I now understand what xpfe="false" should do.  This patch should have the proper URL and apply again to the trunk.  

Hopefully, it's finally ready for check-in!  (Fingers crossed.)
Comment 57 Jens Hatlak (:InvisibleSmiley) 2010-07-23 08:24:37 PDT
@Ben: Since this affects UI, please also request sr from Neil before setting checkin-needed. Should be quick.
Comment 58 neil@parkwaycc.co.uk 2010-07-23 08:34:45 PDT
Comment on attachment 459774 [details] [diff] [review]
Findbar Patch v.8

I was going to check it in later today anyway...
Comment 59 neil@parkwaycc.co.uk 2010-07-23 12:08:40 PDT
Pushed changeset fbc3a0154606 to comm-central.
Comment 60 Jens Hatlak (:InvisibleSmiley) 2010-07-24 09:28:29 PDT
*** Bug 62467 has been marked as a duplicate of this bug. ***
Comment 61 Rimas Kudelis 2010-07-24 12:44:34 PDT
<!ENTITY findAsYouTypeFindbarEnableTip.label "Note: Find as you type without showing the findbar does not allow international text entry.">

IMHO, "international text" is very confusing wording. What exactly does that mean? Does it only affect complex input methods, or anything that doesn't fall under ASCII?

Plus, I guess a Japanese person would hardly clasify solely Japanese text as international...
Comment 62 neil@parkwaycc.co.uk 2010-07-24 13:13:16 PDT
(In reply to comment #61)
> <!ENTITY findAsYouTypeFindbarEnableTip.label "Note: Find as you type without
> showing the findbar does not allow international text entry.">
> 
> IMHO, "international text" is very confusing wording.
You're right, the wording is very confusing. Feel free to improve it.

> Does it only affect complex input methods, or anything that doesn't fall
> under ASCII?
I'm not really sure. It might affect dead keys, or it might not.
Comment 63 Robert Kaiser 2010-07-24 15:10:34 PDT
I'm actually not sure if that note there is worth having at all.
Comment 64 Philip Chee 2010-07-24 18:11:49 PDT
The Japanese localizers would probably traslate this into something understandable. Also looking at the dependency tree, moving to a findbar probably fixes a problem with IME not working with the statusbar FYAT. So I'd guess the Japanese text would probably say something like "Enable the findbar if you want to search using Japanese input method."
Comment 65 Rimas Kudelis 2010-07-24 22:26:06 PDT
And what do I say for Lithuanian users?
Comment 66 Robert Kaiser 2010-07-25 04:22:33 PDT
1) We should handle this in a followup,
2) We might want to rephrase this to talk about either "...if you want to use an IME for searching" or "...if you want to input characters not on a normal keyboard (via IME)" - or remove that message altogether and describe this in help only.
Comment 67 neil@parkwaycc.co.uk 2010-07-25 07:47:53 PDT
Comment on attachment 459774 [details] [diff] [review]
Findbar Patch v.8

>    content/communicator/bindings/general.xml                        (bindings/general.xml)
>+   content/communicator/bindings/findbar.xml                        (bindings/findbar.xml)
I failed to notice that these were in the wrong order, so I pushed changeset d29fbbf9a3dc to comm-central to fix that and one other mismerge that isn't apparent from the patch because it doesn't have enough context.
Comment 68 Ian Neal 2010-08-30 03:31:24 PDT
Created attachment 470403 [details] [diff] [review]
Tidy up findUtils.js

This patch:
* Reuses findbar where it wasn't being;
* Replace missing isFindbarEnabled with relevant code.
Comment 69 neil@parkwaycc.co.uk 2010-08-30 07:03:10 PDT
Created attachment 470425 [details] [diff] [review]
Fix for find again

That reminded me of the following problem:
1. Turn off the "Show the find toolbar during find as you type" in Preferences
2. Start a type ahead find (in-page)
3. Try to find next
In this case, you would expect find next to find next in-page rather than open the find bar. This patch fixes that. I had to roll your patch in to the fix.
Comment 70 Ian Neal 2010-08-30 07:50:05 PDT
Comment on attachment 470425 [details] [diff] [review]
Fix for find again

>diff -r b0c0a81d13cb suite/common/findUtils.js
>--- a/suite/common/findUtils.js	Sun Aug 29 12:40:20 2010 +0200
>+++ b/suite/common/findUtils.js	Mon Aug 30 14:52:45 2010 +0100
>@@ -100,7 +100,15 @@ function findAgainInPage(findInstData, r
> {
>   var findbar = document.getElementById("FindToolbar");
>   if (findbar && Services.prefs.getBoolPref("browser.findbar.enabled"))
>-    document.getElementById("FindToolbar").onFindAgainCommand(reverse);
>+  {
>+    // first, look to see whether XPFE typeaheadfind wants to find next
>+    var sip = Components.classes['@mozilla.org/supports-interface-pointer;1']
Nit: use " instead of '
Comment 71 neil@parkwaycc.co.uk 2010-08-30 09:29:44 PDT
Pushed changeset 57162e47434c to comm-central.
Comment 72 Robert Kaiser 2010-08-30 12:34:36 PDT
Just be happy I wasn't around this weekend and today. PLEASE FILE FOLLOWUPS for followup fixes and don't pointlessly reopen bugs that have been fixed, spamming ALL dependencies unneededly with bugspam about reopening and re-fixing? Pretty please? Thanks.

Note You need to log in before you can comment on or make changes to this bug.