⚑️ Live updates comments, jobs, and issues, tagged with #wcag322 will update issues and activities on this page.

Issues

The last 100 updated issues.

Activities

The last 7 days of comments and CI jobs.

  • πŸ‡§πŸ‡·Brazil mabho Rio de Janeiro, RJ

    Thank you for sharing that information, @finnsky, I will try these commands.

  • πŸ‡§πŸ‡·Brazil mabho Rio de Janeiro, RJ

    Hum, I see the code fails the pipeline, I guess I need to run Javascript code linting against the Drupal recommended standards, I will check how to do that...

  • πŸ‡·πŸ‡ΈSerbia finnsky

    Thank you! I gonna review in next few days.
    Please for now fix linter to pass CI js linter and run functional tests.

    cd core
    yarn
    yarn run lint:core-js-passing --fix
    
  • πŸ‡§πŸ‡·Brazil mabho Rio de Janeiro, RJ

    Guys, I just pushed the code. This is how I suggest testing this:

    Add console.time('timer') and console.timeEnd('timer') to measure the time it takes to execute the event attached to the table instance. I suggest applying the same change to the original code for comparison. It can be applied exactly at this position:

          e.target.addEventListener(
            'input',
            debounce((event) => {
              tables.forEach((tableElement) => {
                console.time('timer')
                tableElement.dispatchEvent(
                  new CustomEvent(FILTER_EVENT, {
                    detail: {
                      event,
                    },
                  }),
                );
                console.timeEnd('timer')
              });
            }, 200),
          );
    

    This performance test will measure the time it takes to run each keystroke. It won't take into account the time we are saving by not activating the filter script on each page load.

    Let me know your thoughts.

  • πŸ‡¬πŸ‡§United Kingdom joachim

    > the next time the script is triggered (let's say, when you completed typing 'conte'), there is no need to start from the 200 records, but we can use a temporary resultset including the ~ 20 search results for 'con';

    This and the other improvements in #55 sound fantastic!

  • πŸ‡·πŸ‡ΈSerbia finnsky

    I had same problem.
    But now seems fine with git and not https

  • πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

    mabho, if you go all the way up to the summary of this issue do you see this button? (Or search this page for "Get push access")

    Looking forward to seeing your code!

  • πŸ‡§πŸ‡·Brazil mabho Rio de Janeiro, RJ

    @finnsky, I am getting a message stating that I am. not allowed to push code to this project. Is this something you can grant to me?

    git push origin 3028968-
    remote: 
    remote: ========================================================================
    remote: 
    remote: You are not allowed to push code to this project.
    remote: 
    remote: ========================================================================
    remote: 
    fatal: Could not read from remote repository.
    
  • πŸ‡§πŸ‡·Brazil mabho Rio de Janeiro, RJ

    Guys, I went over the frontend part of the 'problem', and started off from @innsky's code, which doesn't mean I have any opinion on the ideal approach discussed above. I think the ideal place is somewhere in the middle: keep the backend API allowing module/core developers to provide customization and override the defaults, but provide a set of conventions that would allow users to quickly plug the filter library by using the defaults (table selector, targets, etc.); this way, if no complexity is required, someone could easily and quickly plug the library and have the filters working immediately if no customization if a more complex/custom setup is not needed.

    That said, here is the explanation on the changes I applied on the code available in branch 3028968-:

    • Use a case-insensitive (this was working already), accent insensitive search (Latin languages use accent very often; I can tell you it is very frustrating when systems don't take accents into account; I am thus 'normalizing' strings before searching
    • Instead of searching straight into the DOM elements themselves, I am setting up an array of objects to iterate through. Each array item object carries a lower-case, no-accent version of the string being searched for, as well as a reference to the corresponding DOM element being manipulated.
    • I am setting a mechanism to accelerate the queries. Imagine 200 rows to search from. Every time you type a letter, the script searches among the entire 200 rows. Usually, though, users are incrementally typing a word, of multiple search words, and we don't actually need to run a lookup on the entire 200 rows for each keystroke. Example: type string 'con' for 'content' and you are already ruling out most of the potential rows not carrying that string sequence. The next time the script is triggered (let's say, when you completed typing 'conte'), there is no need to start from the 200 records, but we can use a temporary resultset including the ~ 20 search results for 'con'; this tends to deliver good performance improvement on larger tables (not so much on smaller sets, but it still improves the speed).
    • The approach with once() is indicating that we can potentially carry more than one input filter per page. If that happens, we don't want all the variables to be duplicated (one instance per input/table). I separated that portion of the code to prevent that type of problem and keep resources usage lower in that case.
    • Last but not least, probably the most important change: we don't need to activate the filters if users are not using it; I would say, most of the times users don't use the filter when reaching the users permissions page, or modules list page. I am thus keeping the filter dormant until the filter field is focused. When that happens, then the entire mechanism is activated.

    The code is ready on my local environment. @finnsky, let me know if I can push it over your branch as it applies many changes to the original code (the original concept and structure is preserved). Feel free to review, comment and improve from there, and of course, if you don't like it, it is always possible to revert my commits.

  • πŸ‡¬πŸ‡§United Kingdom joachim

    > Users will be any people who will filter tables in the admin panel and possibly in custom modules/themes.

    Ok, yes. But my aim at least was to keep the current behaviour, because I felt it had a better chance of this issue getting in that way.

    > Therefore, in this task, first of all, a simple and predictable JavaScript is needed. And the backend architecture should simply support it.

    I still disagree. The two need to work in tandem.

    > In any case, the render element can be added to my MR, and it will be much simpler, as it seems to me.

    That would be great. I don't know enough JS to have an opinion about how it should be written! :) I would really like to keep the backend code from my MR though.

  • πŸ‡·πŸ‡ΈSerbia finnsky

    Here, the users will be developers writing PHP code to apply this filtering functionality to their page.

    Users will be any people who will filter tables in the admin panel and possibly in custom modules/themes.
    Therefore, in this task, first of all, a simple and predictable JavaScript is needed. And the backend architecture should simply support it.
    JavaScript is not a facade here, but a foundation.
    As you can see, everything works without a complex API.

    In any case, the render element can be added to my MR, and it will be much simpler, as it seems to me. So let's let the community decide how to move forward with this task.

  • πŸ‡¬πŸ‡§United Kingdom joachim

    > But I think building a frontend library should start with JavaScript. And then adapt it to the backend. And not the other way around.

    I disagree. Complexity should be kept away from users of a system. Here, the users will be developers writing PHP code to apply this filtering functionality to their page. So the API is that part. I don't think there's going to be much need for extending the JS.

    I think my approach of a dedicated render element is much better DX than adding attributes. It's easier to document, it's easier to understand, and it also allows developers to control where they place the search filter box on the page.

  • πŸ‡·πŸ‡ΈSerbia finnsky

    1. Added `Search only from start of words` and `Min length of search query` features.
    2. Applied library for config-translation

    @joachim
    Don't get me wrong. You've done a great job here. And I've been inspired by it in many ways. But I think building a frontend library should start with JavaScript. And then adapt it to the backend. And not the other way around. So I will continuing with my approach because it's ready to use right now.

    @rkoller
    In this task we solve the problem of multiple scripts for the same task, preserving what has already been done. But without adding new features. At least not complex ones.

    If there is something that worked before and does not work now, please write here. Otherwise, let's continue working on it in future iterations of this library.

  • πŸ‡¬πŸ‡§United Kingdom joachim

    Yes, @mabho that would be great.

    The main branch is 3028968-filter-js-library, which has my attempt at JS (I am not a front-end dev, and jQuery is all the JavaScript I know!).

    There is vanilla JS on branch 3028968- but that AFAIK is not feature-complete.

    Please feel free to make changes to the JS on the 3028968-filter-js-library branch.

  • πŸ‡§πŸ‡·Brazil mabho Rio de Janeiro, RJ

    Hello, guys, do you want me to go over the code and try to remove jQuery, switching it to a pure Vanilla JS approach?

    On this ticket πŸ“Œ Improve the performance of the script delivering the permissions search filter functionality in admin/people/permissions. Needs review I was able to achieve an excellent performance enhancement (affecting the user permissions page only) by getting rid of jQuery on the user permissions script (core/modules/user/user.permissions.js). The code changes are available here: https://git.drupalcode.org/project/drupal/-/merge_requests/9433/diffs.

    I am putting my thread on hold since this issue creating a Drupal filtering library is a much more promising approach.

    If I can help adjust the code to a no-jQuery approach, should I commit and submit the changes on the main branch? Or on a separate branch? Let me know what would be your recommendation.

Production build 0.71.5 2024