Closed Bug 996332 Opened 10 years ago Closed 10 years ago

Switch back to alphabets after @ is typed

Categories

(Firefox OS Graveyard :: Gaia::Keyboard, enhancement)

x86_64
Linux
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: nsm, Assigned: scriptofer, Mentored)

References

Details

(Whiteboard: [good first bug][mentor-lang=zh])

Attachments

(1 file)

The Nokia N9 keyboard has some very subtle tricks and this is one of them.

When you switch to symbols and type '@', the keyboard switches back to alphabets immediately. This is based on the fact that in a majority of cases users are typing '@' as part of an email address and so will usually type an alphabet next. Something worth considering? It's a very small change but which really improves the typing experience, especially on the web where we're always logging in.
Sounds good to me.
Mentor: timdream, rlu, janjongboom
Whiteboard: [good first bug][mentor-lang=zh]
Hay Tim,

I am a very new to the whole GAIA world and just finished with all the setup at my dev box to contribute.

Can I start exploring this issue?

Regards,
Scriptofer
No problem. I assume you already have Gaia set-up and running. What you need to do is to modify this if block

https://github.com/mozilla-b2g/gaia/blob/master/apps/keyboard/js/imes/latin/latin.js#L419-L421

So that it could recognize not only space and return key but also the @ key.

I am pretty sure three expressions linked with || will be ugly, so we might want to use array.indexOf() instead. It's your choice.

If all goes well the next step will be to add some test cases so that people won't break your modification here unintentionally when working on other part of the code.
Assignee: nobody → scriptofer
Status: NEW → ASSIGNED
Tim : Could you please provide more details about the screen on which I can test this change.

I tried by putting console logs on line 419 with keycodes and pressed the key of the keyboard on b2d desktop nightly build running app, but those logs didnt get printed over console.

How I can test this function? Sorry for this dumb question, but i am new. :)
First you need to make sure you are indeed running your own Gaia. To do that you can try to change the style of any app to make sure there are visible changes.

The JS Console of B2G Desktop can be strange. I would recommend you use dump() to print a string -- it would show up in the terminal.

The alternative would be use something other than B2G Desktop to run Gaia. Unfortunately I am not sure of the current support status on running Gaia in Firefox Nightly, nor how to replace the Gaia in FxOS Simulator -- you can try both but they might be worse than B2G Desktop.
Ohh. I made a visible change (same lockscreen.css change mentioned over below url), but it didnt work. I tried by restarting B2G window and runn32ing the app again.

https://developer.mozilla.org/en-US/Firefox_OS/Developing_Gaia/Making_Gaia_code_changes

I am running below command on /b2g directory

scriptofer@scriptofer-system:~/b2g$ ./b2g -profile /home/scriptofer/projects/gaia/gaia/profile-debug -no-remote

Could you please help me to figure out how to see code change in the running app in the B2G desktop?
Did you run |DEBUG=1 make| in the Gaia directory so your change in can be build into the debug profile?

("DEBUG=1 make" will build the profile under gaia/profile-debug and "make" will build the one in gaia/profile)
Yes Tim. I already run thus command. This created profile-debug directory inside the Gai folder. And running the same with b2g.
(In reply to Scriptofer from comment #8)
> Yes Tim. I already run thus command. This created profile-debug directory
> inside the Gai folder. And running the same with b2g.

I don't know what happen in this case :'( If |make| created the folder it must contain your modifications.

Have you try to modify other style sheet instead? Something that is more obvious than lockscreen.css?
Please review the changes. 

This is my first checkin.
Attachment #8499992 - Flags: review?(timdream)
Attachment #8499992 - Flags: review?(rlu)
Attachment #8499992 - Flags: review?(dflanagan)
Comment on attachment 8499992 [details]
Bug 996332 - Fix -keyboard should Switch back to alphabets after @ is typed R=scriptofer

The change looks good. I checked latin_test.js and realized there isn't a test in place for this part of the code.

I will merge your commit. The commit message was not marked correctly (the R= part) but let's not spend time on correcting that.
Attachment #8499992 - Flags: review?(timdream)
Attachment #8499992 - Flags: review?(rlu)
Attachment #8499992 - Flags: review?(dflanagan)
Attachment #8499992 - Flags: review+
master: https://github.com/mozilla-b2g/gaia/commit/f00b5919694214bef4309a3aa5f65e997a2960f5

Thank you for your contribution!
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Thanks tim for your help and support
feature-b2g: --- → 2.2+
Remove the feature b2g tag to match the new v2.2 scope.
feature-b2g: 2.2+ → ---
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: