Closed Bug 1193160 Opened 10 years ago Closed 2 years ago

Cannot create new contact (Ctrl+N) or new list when AB quick search field has focus: cmd_newCard and cmd_newlist commands wrongly disabled

Categories

(MailNews Core :: Address Book, defect)

defect

Tracking

(firefox43 affected)

RESOLVED WORKSFORME
Tracking Status
firefox43 --- affected

People

(Reporter: thomas8, Assigned: aceman)

References

(Depends on 1 open bug)

Details

(Keywords: regression, Whiteboard: [regression:TB38])

+++ This bug was initially created as a clone of Bug #1143812 +++ Per bug 1143812, we want [New Contact] and [New List] commands to be always enabled in AB regardless of current focus, defaulting to "Personal AB". They should never be disabled. In bug 1143812, as a workaround we temporarily disabled focusing the search box to keep these enabled when AB window opens, as it was not clear how to reliably enable them. So that workaround should be reverted here. http://mxr.mozilla.org/comm-central/source/mail/components/addrbook/content/addressbook.js#214 > 214 // Focus the searchbox as we think the user will want to do that > 215 // with the highest probability. > 216 // Bug 1143812: This is disabled for now to keep the New Contact command enabled. > 217 // QuickSearchFocus(); (In reply to :aceman from bug 1143812 comment #51) > (In reply to Thomas D. from bug 1143812 comment #50) > > Would it help to remove the following lines which seem superfluous: > > http://mxr.mozilla.org/comm-central/source/mail/components/addrbook/content/ > > abCommon.js#498 > > 498 goUpdateCommand('cmd_newlist'); > > 499 goUpdateCommand('cmd_newCard'); > > > > goUpdateCommand does nothing but en/disable commands; if we never disable, > > this shouldn't be needed. > > Even if we remove the explicit updates, something implicit may still update > the commands. So I would still consider it risky.
Depends on: 1193168
Blocks: 1143812
No longer depends on: 1143812
Aceman, are you taking this?
Yes, thanks.
Assignee: nobody → acelists
See Also: → 1046121
Summary: Allow creating new contacts and lists when AB quick search field has focus: Enable [New Contact] and [New List] commands which are disabled → Cannot create new contact (Ctrl+N) or new list when AB quick search field has focus: cmd_newCard and cmd_newlist commands wrongly disabled

From my analysis, the reason for this bug is simply that the search box is outside the scope of the command controllers which handle the disabling/enabling of the key. The annoying part of this is not only the inability to create a new contact when it's most likely (after searching if you already have it), but also that it prevents us from having a useful focus in the quick search box when main AB window gets opened (as that would disable new contact / new list buttons from the start, this bug).

Proposed fix:

Re-implement the keyboard shortcut Ctrl+N as a normal HTML event listener for the entire AB window document.
I suspect that it'll just work without much more tweaks.

Keywords: good-first-bug
Blocks: 1686428

I doubt that will work as there are multiple documents in there. Unlikely to be a good first bug.

Keywords: good-first-bug
Severity: normal → S3

I can't reproduce with current beta.

Flags: needinfo?(bugzilla2007)

(In reply to Wayne Mery (:wsmwk) from comment #5)

I can't reproduce with current beta.

Looks good on Beta and Daily 115.0a1 (2023-05-15) (64-bit), where Ctrl+N to create a new contact (or respective buttons incl. New List) now works from literally everywhere including AB search field (this bug). However, we've taken this a bit too far: While editing existing or new contact, Ctrl+N still works and discards changes without asking. Will file that as new bug.

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(bugzilla2007)
Resolution: --- → WORKSFORME

(In reply to Thomas D. (:thomas8) from comment #6)

While editing existing or new contact, Ctrl+N still works and discards changes without asking. Will file that as new bug.

I've filed this as Bug 1833262.

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