Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-82016

Create a generic modal-as-popup or modal-as-page framework

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.1.10
    • UX
    • MOODLE_401_STABLE

      There is an large increase of pages using modals in Moodle which is good in some situations but honestly a UX regression in other cases. An example is not being able to deep link to the editing page for a user in workplace is really frustrating and you are forced to navigate to a list of users and edit them in a modal. This is not limited to workplace and is increasingly happening in lots of places.

      The same UX issue from another angle is if there is a link to edit something you should always be able to right click on it and open it in a new tab, but this is broken if it is a pure JS that triggers an in-page modal.

      This sounds like a small thing but can be pretty rage inducing, both personally and watching multiple clients in screen shares, when you intend to right click to open something in a new window and are moving fairly quickly and instead of it opening a new tab you end up clicking 'Back' in the browser and lose work done on the current page.

      Here is an older Moodle and if you right click on the cog for a user and click the first link in the context menu it does what you expect:

      Here is a newer Moodle workplace which you do the exact same thing on and it doesn't work at all, it just opens the list of users and not the edit page:

      In other places you don't get a real link, so you end up with a context menu like this and then inadvertently click on 'Back'

       

      Jira itself is a great example of how to do this correctly and it would be really good if Moodle adopted a good pattern here and nipped this anti-pattern in the bud, and fixed up the existing new-ish modals which have already been shipped.

      For example if you click 'Create' in Jira you get a modal with a form:

       

      but if you right click on the button and open it in a new tab it works perfectly too:

      https://tracker.moodle.org/secure/CreateIssue!default.jspa

      The ways you make a Moodle modal should guide you towards a solution where you write one bit of code that seamlessly gets re-used in both situations. There is probably going to be two different things here, one focused on a moodleform inside a modal, and one which is some other generic page.

            Unassigned Unassigned
            brendanheywood Brendan Heywood
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 32 minutes
                1h 32m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.