Skip to content

First draft of Undo Call Response#305

Open
scottpeterson wants to merge 5 commits into
mainfrom
undo-call-response
Open

First draft of Undo Call Response#305
scottpeterson wants to merge 5 commits into
mainfrom
undo-call-response

Conversation

@scottpeterson
Copy link
Copy Markdown
Collaborator

@scottpeterson scottpeterson commented Apr 25, 2026

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization

Description

Related Issues

  • Related Issue #
  • Closes #

Were the changes tested?

  • Yes, automated tests in please name test methods or files
  • Yes, manually tested: please provide steps performed to test changes
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests

Snackbar action color lightened
Changed undo text
Changed from toast to snackbar
Copy link
Copy Markdown
Collaborator

@dektar dektar left a comment

Choose a reason for hiding this comment

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

Looks really good! If you can add tests that'd be awesome, but I don't think this area has any tests yet anyway so it might not be in scope. Some other comments below.

Outcome.getDisplayString(this, mPendingOutcome.status));
String contactName = mIssue.contacts.get(mPendingContactIndex).name;
String message = getResources().getString(
R.string.call_reported_undo_format, outcomeLabel, contactName);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can we test this with a long rep name -- that it clips or wraps OK?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I took Susan's advice and shortened the text (removed the rep's name).

Can definitely add it back if you feel strongly. But with it removed it obviates the need for this comment!

int index = mPendingContactIndex;
mPendingContactIndex = null;
mPendingOutcome = null;
mPendingCallHandler.removeCallbacksAndMessages(null);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

would we want to removeCallbacksAndMessages even if mPendingContactIndex == null, i.e. do this first in any case?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

yep, good catch.

Outcome outcome = mPendingOutcome;
mPendingContactIndex = null;
mPendingOutcome = null;
mPendingCallHandler.removeCallbacksAndMessages(null);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

would we want to removeCallbacksAndMessages even if mPendingContactIndex == null..., i.e. do this first in any case?

if (s == null || s.isEmpty()) {
return s;
}
return Character.toUpperCase(s.charAt(0)) + s.substring(1);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

will s.substring(1) work properly if the string is only 1 long?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

this won't throw unless beginIndex is > length. If they're equal it just returns ""

showContactsUi();
Intent intent = new Intent(getApplicationContext(), RepCallActivity.class);
intent.putExtra(KEY_ISSUE, mIssue);
intent.putExtra(RepCallActivity.KEY_ADDRESS, mAddress);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

i don't think we need to pass address to RepCallActivity any more.

finish();
}

private void returnToIssueWithDemoCalled() {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can you check the demo call behavior is as expected (no "undo" and it all plays nicely)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

confirmed

* main:
  Show a list of relevant rep types on the issue details page (#309)
  Use dynamic actions in issueDone (#308)
  Open deep links after tutorial completes, fixes #281 (#304)
  Release 82 (#303)
@scottpeterson scottpeterson marked this pull request as ready for review May 12, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants