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

Fix #4532: Prevent multiple concept card fragments #4939

Merged
merged 22 commits into from
May 9, 2023

Conversation

masclot
Copy link
Collaborator

@masclot masclot commented Apr 6, 2023

Explanation

Fix #4532: only allow one concept card open at a time. If the new new concept card has the same skill id as an existing one, do not open and instead reuse the existing one.

I modified a couple of concept card data for dev so that they link to each other. This change is not necessary for this PR to work, but it allows manually testing the scenario where a concept car links to another.

Current behavior:
multiple concept cards allowed, even with same skill id.webm

New behavior:
ConceptCard deduplication demo.webm

Essential Checklist

  • The PR title and explanation each start with "Fix #bugnum: " (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • Any changes to scripts/assets files have their rationale included in the PR explanation.
  • The PR follows the style guide.
  • The PR does not contain any unnecessary code changes from Android Studio (reference).
  • The PR is made from a branch that's not called "develop" and is up-to-date with "develop".
  • The PR is assigned to the appropriate reviewers (reference).

For UI-specific PRs only

If your PR includes UI-related changes, then:

  • Add screenshots for portrait/landscape for both a tablet & phone of the before & after UI changes
  • For the screenshots above, include both English and pseudo-localized (RTL) screenshots (see RTL guide)
  • Add a video showing the full UX flow with a screen reader enabled (see accessibility guide)
  • Add a screenshot demonstrating that you ran affected Espresso tests locally & that they're passing

@masclot masclot requested a review from BenHenning as a code owner April 6, 2023 13:52
@masclot masclot marked this pull request as draft April 6, 2023 13:52
@BenHenning
Copy link
Sponsor Member

BenHenning commented Apr 11, 2023

@masclot is this ready for review or did you open the draft so that people can help with specific parts? Just wanted to make sure that we aren't inadvertently ignoring this. :)

@masclot
Copy link
Collaborator Author

masclot commented Apr 11, 2023

@masclot is this ready for review or did you open the draft so that people can help with specific parts? Just wanted to make sure that we aren't inadvertently ignoring this. :)

It is not ready. Since the change is not trivial, I just wanted to show what my idea is, so that I get early comments. @adhiamboperes already commented on chat.

…wn tag. Allow to switch concept cards by reusing instances instead of creating a new one each time.
- Modify two test concept cards to link to each other; this allows testing the functionality
- Only allow one concept card at a time
- Finish implementation
- Add unit tests
@masclot masclot changed the title Fix part of #4532: Prevent multiple revision card fragments Fix #4532: Prevent multiple revision card fragments Apr 16, 2023
@masclot masclot changed the title Fix #4532: Prevent multiple revision card fragments Fix #4532: Prevent multiple concept card fragments Apr 16, 2023
@masclot masclot marked this pull request as ready for review April 16, 2023 16:18
@masclot
Copy link
Collaborator Author

masclot commented Apr 16, 2023

@adhiamboperes PTAL

@masclot
Copy link
Collaborator Author

masclot commented Apr 16, 2023

@BenHenning PTAL

@masclot
Copy link
Collaborator Author

masclot commented Apr 16, 2023

The error in the checks seems to be temporal:

# A fatal error has been detected by the Java Runtime Environment:
#
# SIGSEGV (0xb) at pc=0x00007f02ba37d3e0, pid=2671, tid=2685

Could anybody rerun them?

Copy link
Collaborator

@adhiamboperes adhiamboperes left a comment

Choose a reason for hiding this comment

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

Thanks @masclot! I took a first pass, and I'll be able to provide more specific feedback in the next pass.

  • Since you've made changes to scripts/assets files , please have their rationale included in the PR explanation.
  • There are some unrelated commits/changes, please remove them.

@oppiabot
Copy link

oppiabot bot commented Apr 17, 2023

Unassigning @adhiamboperes since the review is done.

@oppiabot
Copy link

oppiabot bot commented Apr 17, 2023

Hi @masclot, it looks like some changes were requested on this pull request by @adhiamboperes. PTAL. Thanks!

Copy link
Sponsor Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Thanks @masclot! Just had a few follow-ups--PTAL.

@masclot
Copy link
Collaborator Author

masclot commented Apr 28, 2023

Addressed the last two conversations.
@BenHenning PTAL

@masclot masclot assigned BenHenning and unassigned masclot Apr 28, 2023
Copy link
Sponsor Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Thanks @masclot! Really sorry for the delayed review here.

The PR LGTM, but had 1 nit left and I think the branch needs to be brought up-to-date with the latest develop changes. Please assign back once both are done and I'll go ahead and kick-off the merge.

@BenHenning BenHenning assigned masclot and unassigned BenHenning May 3, 2023
@masclot
Copy link
Collaborator Author

masclot commented May 4, 2023

Thanks @masclot! Really sorry for the delayed review here.

The PR LGTM, but had 1 nit left and I think the branch needs to be brought up-to-date with the latest develop changes. Please assign back once both are done and I'll go ahead and kick-off the merge.

I addressed the comment. Regarding "bringing the branch up-to-date with the latest develop changes", I'm not sure I'm doing it right. In Android Studio, I checked out my develop branch and clicked "Update" on it. I then checked-out the branch for this change and also clicked "Update". Would that be enough?

@masclot
Copy link
Collaborator Author

masclot commented May 4, 2023

I don't think Android Studio -> <branch-name> -> Update does a merge. This menu is what oppia documentation says we should do in Android Studio to update our repository: https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#making-a-local-code-change-using-android-studios-ui-based-github-workflow

Instead I did the following in Android Studio:

  • checkout develop
  • fetch
  • merge upsteam/develop
  • checkout <my-branch>
  • fetch
  • merge develop

I hope these steps are good. Please let me know otherwise.

@masclot masclot assigned BenHenning and unassigned masclot May 4, 2023
Copy link
Sponsor Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Thanks @masclot! Re: updating the branch, I think we have instructions in the wiki for this but I can't find them off hand at the moment (@MohitGupta121 might you know?). We generally recommend doing this via Git CLI since it's easier to "debug" when something goes wrong, and I'm less familiar with the Android Studio Git interface.

PR LGTM!

@BenHenning
Copy link
Sponsor Member

Updating to latest develop & enabling auto-merge.

@BenHenning BenHenning enabled auto-merge (squash) May 9, 2023 03:00
@oppiabot
Copy link

oppiabot bot commented May 9, 2023

Unassigning @BenHenning since they have already approved the PR.

@oppiabot oppiabot bot added the PR: LGTM label May 9, 2023
@oppiabot
Copy link

oppiabot bot commented May 9, 2023

Hi @masclot, this PR is ready to be merged. Please address any remaining comments prior to merging, and feel free to ask someone to merge your PR once the CI checks pass and you're happy with it. Thanks!

@BenHenning BenHenning merged commit ac4eb44 into oppia:develop May 9, 2023
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiple tabs are opening on clicking the concept cards link thrice
3 participants