Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reopen last article #1090

Closed
wants to merge 41 commits into from
Closed

Reopen last article #1090

wants to merge 41 commits into from

Conversation

Rbcoder1
Copy link

I Have Successfully Implemented The Functionality of Reopening last article after unclicking cofiguration and about button.

@Jaifroid
Copy link
Member

OK, great. So I can review it, can you please update the branch again (button below), do some manual tests in both jQuery and ServiceWorker modes, and then let me know when it is ready for review.

@Jaifroid
Copy link
Member

Please also link this PR to the issue that it closes.

www/js/lib/require.js Fixed Show fixed Hide fixed
@Jaifroid
Copy link
Member

@Rbcoder1 You will see that this test is failing: https://github.com/kiwix/kiwix-js/actions/runs/6039794791/job/16393978914?pr=1090. The reason is given there. However, you should not be adding a require script to this Repo. We spent a long time removing require.js and converting the repository to ES6 modules. You should only use the ES6 module syntax.

However, I can't really understand why you've included this file, because you don't seem to use any require statements in the rest of your code.

Copy link
Author

@Rbcoder1 Rbcoder1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

every chaged

@Rbcoder1
Copy link
Author

Rbcoder1 commented Sep 1, 2023

This Issue Is Closes #523 and #127

@Jaifroid Jaifroid linked an issue Sep 1, 2023 that may be closed by this pull request
@Jaifroid
Copy link
Member

Jaifroid commented Sep 1, 2023

This Issue Is Closes #523 and #127

It would close #127, but not #523!

@Jaifroid
Copy link
Member

Jaifroid commented Sep 1, 2023

@Rbcoder1 I've done some quick tests, and the general functionality is working, which is great.

However, I noticed the following issues:

  • When I "unclick" either Configuration or About, it returns to the loaded article, but the button I unclicked remains depressed. See screenshot below;
  • When I unclick one of these buttons, the UI slide animation is not used., it just immediately shows the article. The animation should be preserved if the user has that option turned on.

image

@Jaifroid
Copy link
Member

Jaifroid commented Sep 1, 2023

NB I haven't reviewed your code yet, but in general terms I notice you have blocks of repeated code. It would be much better if you were to consolidate required code in a function, and re-use the viewArticle function that you will find in uiUtil.js here: https://github.com/kiwix/kiwix-js/blob/main/www/js/lib/uiUtil.js#L632 . That code already does the job (and does it correctly with the UI Animation), so there is no point your reinventing the wheel.

What I suggest you do is make a separate viewArticle function in uiUtil.js, which will be used both by the showReturnLink function and by you for this PR. This would be the most efficient solution.

@Jaifroid Jaifroid self-requested a review September 1, 2023 08:20
Copy link
Member

@Jaifroid Jaifroid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see comments above for requested changes.

@Jaifroid
Copy link
Member

Is this PR still alive?

@Rbcoder1
Copy link
Author

Rbcoder1 commented Oct 18, 2023 via email

@Jaifroid
Copy link
Member

OK, no problem. No rush, I just wanted to check.

@Jaifroid Jaifroid modified the milestones: v3.11, v4.0 Nov 1, 2023
@Rbcoder1
Copy link
Author

Why My Test Are Failed.
Can You Please Tell Me

@Jaifroid
Copy link
Member

Hi, I'm just running them to see.

@Jaifroid
Copy link
Member

Tests are passing now.

@Rbcoder1
Copy link
Author

I done with all problem can You check it again is their any changes need

Copy link
Member

@Jaifroid Jaifroid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see the stylistic changes, and also one exception produced by your code in console. Also, you need to attend to accessibility, which means you need to ensure your implementation can be used by keyboard-only users, using tab key and spacebar, not mouse. The blur() method you use is preventing keyboard use of the UI.

www/js/app.js Outdated Show resolved Hide resolved
www/js/app.js Outdated Show resolved Hide resolved
www/js/app.js Outdated Show resolved Hide resolved
www/js/app.js Outdated Show resolved Hide resolved
www/js/lib/uiUtil.js Show resolved Hide resolved
www/js/lib/uiUtil.js Outdated Show resolved Hide resolved
www/js/app.js Outdated Show resolved Hide resolved
www/js/app.js Outdated Show resolved Hide resolved
@Rbcoder1
Copy link
Author

Rbcoder1 commented Nov 12, 2023 via email

@Jaifroid
Copy link
Member

Just a quick suggestion: compare your implementation with the online version at https://browser-extension.kiwix.org/ (let it update to v3.11.0). You'll see there that when a user clicks on one of the tabs, it remains "pressed" until they go to a different tab. I think this is quite important for an "unclick" solution like yours. Maybe when you remove the "blur()" method from your code, this will just work as it is expected to.

@Rbcoder1
Copy link
Author

Rbcoder1 commented Nov 13, 2023 via email

Copy link
Author

@Rbcoder1 Rbcoder1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all changes are reviewed and updated please check it again

@Jaifroid
Copy link
Member

OK, thanks, I'll check again.

@Jaifroid
Copy link
Member

@Rbcoder1 I just tested your PR again, and I immediately noticed this regression. I've mentioned this problem a number of times above. Please thoroughly test your PR , extensively, before asking for review, to make sure all such issues are ironed out. Please see https://github.com/kiwix/kiwix-js/blob/main/CONTRIBUTING.md#testing for all the testing you should do, and which should have picked this up straight away.

image

@Jaifroid Jaifroid modified the milestones: v4.0, v4.1 Feb 21, 2024
@Jaifroid Jaifroid closed this Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reopen the last article after switching between menu items
2 participants