Re: [pgAdmin4][Patch]: Allow user to Comment/Uncomment code in query editor

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Murtuza Zabuawala <murtuza(dot)zabuawala(at)enterprisedb(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>, Chethana Kumar <chethana(dot)kumar(at)enterprisedb(dot)com>
Subject: Re: [pgAdmin4][Patch]: Allow user to Comment/Uncomment code in query editor
Date: 2017-07-19 10:47:38
Message-ID: CA+OCxoxK8rsD_t1BeN-QcyKQtg=ZNKikNp_kPGm+-1dqN-Bu=g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Thanks, applied.

I also took the opportunity to tidy up the menus a little and add access
keys for accessibility.

One change I made was to make the Edit and Clear menus not have a default
option - e.g. instead of a button with a drop-down next to it, they're now
a single dropdown button with icon. I think this works better as there are
no obvious candidates for the "default" option for those menus. I'm not
overly enthusiastic about the look of those buttons though, so if anyone
has a better idea how they should be styled, please yelp (CCing Chethana
for his input as well)...

On Wed, Jul 19, 2017 at 9:56 AM, Murtuza Zabuawala <
murtuza(dot)zabuawala(at)enterprisedb(dot)com> wrote:

> Just a FYI,
> You need to run yarn bundle for this to be working as Surinder has moved
> all the CodeMirror code into bundle package.
>
> On Wed, Jul 19, 2017 at 2:20 PM, Murtuza Zabuawala <murtuza.zabuawala@
> enterprisedb.com> wrote:
>
>> Hi,
>>
>> PFA updated patch,
>> 1) Added Keyboard shortcuts to comment line, uncomment line and
>> comment/uncomment block of code also added drop-down for the same.
>> 2) Also added options for indent & unindent code in the same drop-down.
>> 3) Updated shortcut documents accordingly.
>>
>> Please review.
>>
>> On Mon, Jul 17, 2017 at 3:05 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
>>
>>> Hi
>>>
>>> On Mon, Jul 17, 2017 at 10:31 AM, Murtuza Zabuawala <
>>> murtuza(dot)zabuawala(at)enterprisedb(dot)com> wrote:
>>>
>>>> Hi Dave,
>>>>
>>>> On Mon, Jul 17, 2017 at 2:33 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> On Wed, Jul 12, 2017 at 1:16 PM, Murtuza Zabuawala <
>>>>> murtuza(dot)zabuawala(at)enterprisedb(dot)com> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> PFA patch which will add functionality to allow user to
>>>>>> comment/uncomment code in query editor.
>>>>>> RM#2456
>>>>>>
>>>>>
>>>>> This is cool, but I'm not sure it's right as-is:
>>>>>
>>>>> * I prefer SQL style commenting, e.g.
>>>>>
>>>>> -- This is a comment
>>>>>
>>>>> Should we make that a config option if CodeMirror can do it? Or a
>>>>> different hotkey?
>>>>>
>>>>>
>>>> I'll check the extension code and update you accordingly, and It will
>>>> be good idea to keep the both the options because with large code block
>>>> current style works the best.
>>>>
>>>
>>> Right.
>>>
>>>
>>>> * You've added it as an option to the Clear XXX dropdown, which really
>>>>> isn't the right place in my opinion. Should we add a new drop down for
>>>>> this, and include some/all of the other Editing options on there? E.g.
>>>>> tab/shift-tab.
>>>>>
>>>>> I thought that is misc options dropdown for our editor, but I don't
>>>> see any point adding new drop down for one single option, Can we add new
>>>> button instead?
>>>>
>>>
>>> I think you missed this bit: "and include some/all of the other
>>> Editing options on there? E.g. tab/shift-tab.". Essentially, we'd be adding
>>> an Edit menu...
>>>
>>>
>>>> * I think the docs should say Ctrl+Shift+/ rather than Shift+Ctrl+/,
>>>>> and be ordered in the table to reflect that. It seems more natural to me.
>>>>>
>>>>> Initially I wrote ctrl + shift + /only but when I saw all other
>>>> shortcuts starts with Shift , then I changed it to shift + ctrl + / :)
>>>>
>>>
>>> No they don't - Ctrl+Alt+Left for example. I believe it's normal to put
>>> Ctrl first, then Shift as it's a modifier.
>>>
>>>
>>>> Thoughts?
>>>>>
>>>>> --
>>>>> Dave Page
>>>>> Blog: http://pgsnake.blogspot.com
>>>>> Twitter: @pgsnake
>>>>>
>>>>> EnterpriseDB UK: http://www.enterprisedb.com
>>>>> The Enterprise PostgreSQL Company
>>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Dave Page
>>> Blog: http://pgsnake.blogspot.com
>>> Twitter: @pgsnake
>>>
>>> EnterpriseDB UK: http://www.enterprisedb.com
>>> The Enterprise PostgreSQL Company
>>>
>>
>>
>

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment Content-Type Size
image/png 52.1 KB

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Murtuza Zabuawala 2017-07-19 10:55:03 Re: [pgAdmin4][Patch]: Allow user to Comment/Uncomment code in query editor
Previous Message Dave Page 2017-07-19 10:43:49 pgAdmin 4 commit: Add controls and shortcuts for commenting/uncommentin