First Last Prev Next    No search results available
Details
: Composer does not focus into body of mail
Bug#: 26465
: smarttemplate4
: General
Status: REOPENED
Resolution:
: PC
: Windows 7
: unspecified
: P2
: major
: ---

:
:
:
:
:
  Show dependency tree - Show dependency graph
People
Reporter: nischwartz@yahoo.com
Assigned To: Axel Grude <axel.grude@gmail.com>
:

Attachments
1.5.1 prerelease 16 (495.12 KB, application/x-xpinstall)
2018-04-29 09:59, Axel Grude
no flags Details
1.5.1 prerelease 17 (495.17 KB, application/x-xpinstall)
2018-04-29 12:24, Axel Grude
no flags Details
1.5.1 prerelease 19 (495.28 KB, application/x-xpinstall)
2018-04-30 06:03, Axel Grude
no flags Details
1.5.1 prerelease 21 (495.32 KB, application/x-xpinstall)
2018-04-30 10:18, Axel Grude
no flags Details
1.5.2 prerelease 45 (476.38 KB, application/x-xpinstall)
2018-05-19 06:34, Axel Grude
no flags Details
console² patched version (166.00 KB, application/x-xpinstall)
2018-05-24 11:48, Axel Grude
no flags Details
Jaswami log file for Smart Template--24 May 2018 (1.69 KB, text/plain)
2018-05-24 12:48, jaswami@gmail.com
no flags Details
jaswami SmartTemplate -- Toolbox log (848 bytes, text/plain)
2018-05-24 14:43, jaswami@gmail.com
no flags Details


Note

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

Related actions


Description:   Opened: 2018-01-04 10:28
When forwarding or replying, the focus should be in the body of the email, but
it is somewhere else on the compose window.  I can use Shift+Tab to get the
cursor where it should be.  My template uses the %cursor% code in it.  This was
not a problem with TB 52.
------- Comment #1 From nischwartz@yahoo.com 2018-01-04 10:32:32 -------
I should add that I'm using version 1.5pre69
------- Comment #2 From Axel Grude 2018-01-04 11:30:47 -------
Could be another Add-on, but I need to test this on daily first. It may be a
little early for posting this bug as Tb 58 is probably going to change very
soon again.
------- Comment #3 From nischwartz@yahoo.com 2018-01-04 12:20:24 -------
My other limited add-ons are: MinimizeToTray revived (MinTrayR); Open With;
QuickFolders; Restart Thunderbird; and Xpunge.  I've used them all together
without issues for a long time and after disabling them all except
SmartTemplate4, the issue still persists.  When I disable SmartTemplate4, the
cursor is in the expected location.

No problem if this is too early for reporting, but it's certainly not the
expected behavior.  
------- Comment #4 From nischwartz@yahoo.com 2018-01-16 13:10:16 -------
A quick follow up that the same issue is happening in 58b3
------- Comment #5 From Axel Grude 2018-01-17 04:45:12 -------
tested on Tb 58 beta3. in my case the editor does focus to the top of the
document (but ignores my %cursor% variable in all cases)

Debugging is, I found that apparently the false re-focusing (or in your case
not focusing at all) is happening after SmartTemplate4 has processed the

NotifyComposeBodyReady

event. So it is due to some change within the Thunderbird code base, which must
do additional processing after the NotifyComposeBodyReeady event. I guess we
need to raise a bug with the Thunderbird bugzilla.
------- Comment #6 From Axel Grude 2018-01-17 05:00:27 -------
(In reply to comment #5)
> tested on Tb 58 beta3. in my case the editor does focus to the top of the
> document (but ignores my %cursor% variable in all cases)
> 
> Debugging is, I found that apparently the false re-focusing (or in your case
> not focusing at all) is happening after SmartTemplate4 has processed the
> 
> NotifyComposeBodyReady
> 
> event. So it is due to some change within the Thunderbird code base, which must
> do additional processing after the NotifyComposeBodyReeady event. I guess we
> need to raise a bug with the Thunderbird bugzilla.
> 

I raised:

https://bugzilla.mozilla.org/show_bug.cgi?id=1431059

please add your own observations/ test cases / votes there.
------- Comment #7 From Novak 2018-04-29 02:51:25 -------
I've just updated SmartTemplate and I experience the same problem with lost
focus on Thunderbird 52.7.0 (just updated from 52.6.0). It seems it is a
problem with the latest version of SmartTemplate.
------- Comment #8 From Novak 2018-04-29 03:04:13 -------
Update: I downgraded to version 1.4 and it works fine. The problem is only in
the version 1.5
------- Comment #9 From Axel Grude 2018-04-29 09:11:17 -------
(In reply to comment #8)
> Update: I downgraded to version 1.4 and it works fine. The problem is only in
> the version 1.5
> 

I can't reproduce the issue even with version 1.5. Can you temporarily disable
all other ADd-ons to rule out side effects?
------- Comment #10 From Axel Grude 2018-04-29 09:59:41 -------
Created an attachment (id=8443) [details]
1.5.1 prerelease 16

can you check if it still happens in this version please?
------- Comment #11 From Novak 2018-04-29 10:25:56 -------
(In reply to comment #10)
> Created an attachment (id=8443) [details] [details]
> 1.5.1 prerelease 16
> 
> can you check if it still happens in this version please?
> 

No change.
Testing on clean Win10, fresh new Thunderbird 52.7.0 without any addons, no
settings changed, clean SmartTemplate.
------- Comment #12 From Axel Grude 2018-04-29 11:16:41 -------
(In reply to comment #11)
> (In reply to comment #10)
> > Created an attachment (id=8443) [details] [details] [details]
> > 1.5.1 prerelease 16
> > 
> > can you check if it still happens in this version please?
> > 
> 
> No change.
> Testing on clean Win10, fresh new Thunderbird 52.7.0 without any addons, no
> settings changed, clean SmartTemplate.
> 

Can you try with forwarding? If it still happens increase the time in
about.config

extensions.smartTemplate4.forwardInlineImg.delay = 2000
------- Comment #13 From Axel Grude 2018-04-29 11:25:46 -------
(In reply to comment #12)
> (In reply to comment #11)
> > (In reply to comment #10)
> > > Created an attachment (id=8443) [details] [details] [details] [details]
> > > 1.5.1 prerelease 16
> > > 
> > > can you check if it still happens in this version please?
> > > 
> > 
> > No change.
> > Testing on clean Win10, fresh new Thunderbird 52.7.0 without any addons, no
> > settings changed, clean SmartTemplate.
> > 
> 
> Can you try with forwarding? If it still happens increase the time in
> about.config
> 
> extensions.smartTemplate4.forwardInlineImg.delay = 2000
> 
Also, any messages in error console?
------- Comment #14 From Novak 2018-04-29 11:35:34 -------
> Can you try with forwarding? If it still happens increase the time in
> about.config
> 
> extensions.smartTemplate4.forwardInlineImg.delay = 2000
> 

I have just tried both reply/forward with default (200) and 2000 delay. No
difference.

Error console: (translated)

window.controllers is outdated. Do not use UA detection
TypeError: this.NotifyComposeBodyReadyReply is not a function
MsgComposeCommands.js:319:7
------- Comment #15 From Axel Grude 2018-04-29 12:24:00 -------
Created an attachment (id=8444) [details]
1.5.1 prerelease 17

Added a forced focus on the editor after the template was inserted.
------- Comment #16 From Axel Grude 2018-04-30 05:38:18 -------
*** Bug 26520 has been marked as a duplicate of this bug. ***
------- Comment #17 From Axel Grude 2018-04-30 06:03:43 -------
Created an attachment (id=8445) [details]
1.5.1 prerelease 19

When a new Email is written (e.g. with CTRL+N) then the  focus is expected in
the "To:" field. Pre17 _always_ forced focus into the Email Body.

This version fixes this behavior and puts focus into "To" when creating a new
Email.
------- Comment #18 From nischwartz@yahoo.com 2018-04-30 09:17:09 -------
Using TB 60.0b4, prerelease 19 and setting the
extensions.smartTemplate4.forwardInlineImg.delay to 2000, I'm only getting an
issue with forwarding emails.  Two problems: Focus is on the body of the email,
not the "To" field and I've set my template to have a return between the cursor
mark and my name, but it is ignored.  Everything else seems to work fine
throughout TB so far.
------- Comment #19 From Novak 2018-04-30 09:31:17 -------
(In reply to comment #17)
> Created an attachment (id=8445) [details] [details]
> 1.5.1 prerelease 19
> 
> When a new Email is written (e.g. with CTRL+N) then the  focus is expected in
> the "To:" field. Pre17 _always_ forced focus into the Email Body.
> 
> This version fixes this behavior and puts focus into "To" when creating a new
> Email.
> 

"Reply" works fine in this release.
------- Comment #20 From Axel Grude 2018-04-30 10:18:30 -------
Created an attachment (id=8446) [details]
1.5.1 prerelease 21

Ok -  I didn't know we need to focus on "to:" in the "forwarding" case. Fixed
version attached.
------- Comment #21 From nischwartz@yahoo.com 2018-04-30 10:36:00 -------
Working great!
------- Comment #22 From Axel Grude 2018-05-01 03:03:51 -------
Fixed for Release 1.5.1
------- Comment #23 From nischwartz@yahoo.com 2018-05-01 08:16:20 -------
I've found one more instance of this bug!  When opening an email from the
templates folder, it focuses at the beginning of the body text instead of the
"To" field.  This should be done even if there is an email address already in
the template to allow for additional email addresses.

TB 60.0b4, 1.5.1 prerelease 21
------- Comment #24 From Alessandro Fontana 2018-05-01 17:12:43 -------
Sorry, but SmartTemplate4 1.5.1 creates an additional bug for me.

My template for both Reply and Forward is as follows:

------------------------------------

<blockquote cite="" type="cite" style="border: 0pt none ; margin-top: 0pt;
margin-bottom: 0pt; margin-left: 0pt; padding-left: 0pt; padding-right: 0pt;
padding-bottom: 0pt;">
<div style="margin-top: 1.5em; margin-bottom: 1.25em;">
<hr noshade="noshade" color="#C0C0C0" size="1" width="100%">
</div>
<div style="margin-bottom: 1em; color: black; text-decoration:none !important;
size: medium;">
<b>To: </b>%to(initial)%<br>
[[<b>CC: </b>%cc(name,bracketMail())%<br>]]
[[<b>BCC: </b>%bcc(name,bracketMail())%<br>]]
<b>From: </b>%from(name,bracketMail())%<br>
[[<b>Reply to: </b>%reply-to(mail)%<br>]]
<b>Date: </b>%X:=sent% %a% %e% %b% %Y% %H%:%M%:%S% %date_tz%<br>
<b>Subject: </b>%subject%
</div>
</blockquote>

------------------------------------

This works fine with version 1.5.0; but; with the new version; an additional
carriage return is inserted in the body of the e-mail as soon as I type a
character. This happens with replies, not forwards (not sure why, but would
seem related to this thread).

It should be immediately visible to anyone using my template and comparing how
it works with 1.5.0 compared to 1.5.1, but I can send a video if needed.

Will it be possible to fix this?

Incidentally, I personally much prefer the cursor to immediately focus on the
body text, rather than on the to/cc/bcc headers. This is especially true of
replies; after all, in most cases, I don't add recipients to straightforward
replies. Focusing on the headers is a not only annoying, but a complete waste
of time.

Maybe an idea would be to add an option allowing a choice of where to focus the
cursor?

TB 52.7 macOS 10.13.4
------- Comment #25 From Axel Grude 2018-05-19 06:34:32 -------
Created an attachment (id=8460) [details]
1.5.2 prerelease 45

This one addresses the "Template" case. Apparently no processing happens in
this case. I probably need to raise a separate bug for enabling processing in a
Template from Thunderbird.
------- Comment #26 From Alessandro Fontana 2018-05-19 07:23:18 -------
(In reply to comment #25)
> Created an attachment (id=8460) [details] [details]
> 1.5.2 prerelease 45
> 
> This one addresses the "Template" case. Apparently no processing happens in
> this case. I probably need to raise a separate bug for enabling processing in a
> Template from Thunderbird.
> 

Works perfectly. Thank you.
------- Comment #27 From Axel Grude 2018-05-19 09:56:05 -------
(In reply to comment #26)
> (In reply to comment #25)
> > Created an attachment (id=8460) [details] [details] [details]
> > 1.5.2 prerelease 45
> > 
> > This one addresses the "Template" case. Apparently no processing happens in
> > this case. I probably need to raise a separate bug for enabling processing in a
> > Template from Thunderbird.
> > 
> 
> Works perfectly. Thank you.
> 

Cool. Currently working on a version that allows using %variables% within the
templates, but it's going to take a little while. It's tricky :)
------- Comment #28 From Axel Grude 2018-05-19 11:09:36 -------
(In reply to comment #27)
> 
> Cool. Currently working on a version that allows using %variables% within the
> templates, but it's going to take a little while. It's tricky :)
> 
Related: [Bug 26536]

either I am going to land this in 1.5.2 or make a version jump to 1.6 which
rolls in all maintenance fixes.
------- Comment #29 From jaswami@gmail.com 2018-05-24 09:19:36 -------
Using SmartTemplate 1.5.0 or 1.5.1, when I start a new text the cursor defaults
to the end of the Reply-To field. 

I just upgraded to Ubuntu 18.04 (TB 52.7.0), and since then this behavior
consistently occurs, even with all other add-ons disabled.

Expected behavior: When I start a new text, the focus should default to the
"To" field. 
------- Comment #30 From Axel Grude 2018-05-24 09:36:29 -------
(In reply to comment #29)
> Using SmartTemplate 1.5.0 or 1.5.1, when I start a new text the cursor defaults
> to the end of the Reply-To field. 
> 
> I just upgraded to Ubuntu 18.04 (TB 52.7.0), and since then this behavior
> consistently occurs, even with all other add-ons disabled.
> 
> Expected behavior: When I start a new text, the focus should default to the
> "To" field. 
> 

Did you test 1.5.2 pre 45, which is attached in comment #25 ?
------- Comment #31 From jaswami@gmail.com 2018-05-24 10:12:51 -------
(In reply to comment #30)
> (In reply to comment #29)
> > Using SmartTemplate 1.5.0 or 1.5.1, when I start a new text the cursor defaults
> > to the end of the Reply-To field. 
> > 
> > I just upgraded to Ubuntu 18.04 (TB 52.7.0), and since then this behavior
> > consistently occurs, even with all other add-ons disabled.
> > 
> > Expected behavior: When I start a new text, the focus should default to the
> > "To" field. 
> > 
> 
> Did you test 1.5.2 pre 45, which is attached in comment #25 ?
> 

Yes, I did. With all other add-ons disabled, the behavior persists.
------- Comment #32 From Axel Grude 2018-05-24 11:44:36 -------
I tr(In reply to comment #31)
> (In reply to comment #30)
> > (In reply to comment #29)
> > > Using SmartTemplate 1.5.0 or 1.5.1, when I start a new text the cursor defaults
> > > to the end of the Reply-To field. 
> > > 
> > > I just upgraded to Ubuntu 18.04 (TB 52.7.0), and since then this behavior
> > > consistently occurs, even with all other add-ons disabled.
> > > 
> > > Expected behavior: When I start a new text, the focus should default to the
> > > "To" field. 
> > > 
> > 
> > Did you test 1.5.2 pre 45, which is attached in comment #25 ?
> > 
> 
> Yes, I did. With all other add-ons disabled, the behavior persists.
> 

I tried reproducing this with different settings (HTML email, Text only Email,
With and without Stationery Support) but I cannot reproduce it: the focus for
new emails is always in the "to:" element on the address widget. I suggest you
create a debug log with the latest version; I will attach a patched version of
console here so you can create a text only log.

Please follow the instructions here:
http://smarttemplate4.mozdev.org/support.html

1. ON SmartTemplate4 settings Advanced > Advanced Settings Tab
2. Make sure to enable chrome, disable Content and clear the error console
before hitting the "Write" button

Final expected output looks something like this (I am interested in anything
following NotifyComposeBodyReady):

SmartTemplate4 19:43:21.366  [1308 ms]   
NotifyComposeBodyReady
 ----------
SmartTemplate4 19:43:21.366  [0 ms]      
NotifyComposeBodyReady: Stationery 0.8+ - no action required.
 ----------
SmartTemplate4 19:43:21.534  [168 ms]    
SmartTemplate4.notifyComposeBodyReady()
Stationery is active
Template used is:blank
 ----------
SmartTemplate4 19:43:21.534  [0 ms]      
readSignatureFile() 
Trying to read attached signature file: sig-ag-amo-2017.html
at: C:\Users\Axel\Documents\Thunderbird\Signatures\sig-ag-amo-2017.html
 ----------
SmartTemplate4 {IMAGES} 19:43:21.540  [6 ms]     
getFileAsDataURI()
filename=thunderbird_blog2.png
 ----------
SmartTemplate4 {IMAGES} 19:43:21.540  [0 ms]     
opening image stream...
 ----------
SmartTemplate4 {IMAGES} 19:43:21.540  [0 ms]     
stream read. Adding data, including encoded filename part:
thunderbird_blog2.png
 ----------
SmartTemplate4 19:43:21.542  [2 ms]      
getLocale() returns: en-IE
------- Comment #33 From Axel Grude 2018-05-24 11:48:50 -------
Created an attachment (id=8481) [details]
console² patched version

This is a patched version of the console² Add-on which makes it easier to
captyure log output relevant to Add-on Developers. Note that you can rightclick
> select > all > copy the entire log output as TEXT FORMAT (please no
screenshots, logs should be text only).

My Add-ons all have a debug switch which provides more context in the log
should any errors occur; it's highly recommended to activate it before you
capture a log. Also clear the log before creating the erratic behavior and
disable content logging to avoid unnecessary spamming of the error console.

The browser console (in Tools > Developer Tools > Developer Toolbox) can also
be used but it's more complex & much harder to create a log file from this.
------- Comment #34 From jaswami@gmail.com 2018-05-24 12:48:52 -------
Created an attachment (id=8482) [details]
Jaswami log file for Smart Template--24 May 2018
------- Comment #35 From Axel Grude 2018-05-24 13:27:25 -------
Thanks I tried resurrecting my old VM Ubuntu installation but I couldn't
install the latest Thunderbird version. 

I probably need to download a complete new Ubuntu installer and generate a
fresh VM to really test this. If you can, start Browser Toolbox and debug the
code setting a breakpoint at smartTemplate-main.js line 561 (after
insertTemplate)

..

then single step and see if you get as far as line 575 or whether something
unforeseen happens. this is the line where the "focus element" is determined.

I can add some debugger statements to another test version to make it easier.
------- Comment #36 From jaswami@gmail.com 2018-05-24 14:43:51 -------
Created an attachment (id=8483) [details]
jaswami SmartTemplate -- Toolbox log

Thank you, Axel. 

I'm in unfamiliar territory with this. I didn't see "Browser Toolbox," but I
saw "Developer Toolbox," so I've tried that and I attach a log from it. I think
I must have done a sloppy job, but I hope it may be helpful. 

I'll have to go out soon and won't have much scope for doing more tonight.
Tomorrow I should have time again. 

I don't at all want to offload work onto you, but one thought about Ubuntu
18.04, meanwhile, is that if you run it from a pen drive it will have the
latest TB included.

Thank you again.

First Last Prev Next    No search results available