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

Introduce support for draft PRs #1122

Merged
merged 6 commits into from
Oct 13, 2021
Merged

Introduce support for draft PRs #1122

merged 6 commits into from
Oct 13, 2021

Conversation

Fs00
Copy link
Contributor

@Fs00 Fs00 commented Oct 11, 2021

This PR makes OctoDroid able to recognize draft PRs and update the UI accordingly.
When a PR is a draft:

  • the UI color changes to gray for the app bar and comment/review sheets' bottom bar. The base gray color (#6e7781) was taken directly from the GitHub web UI, all other tones were derived from that
  • the merge button disappears since draft PRs can't be merged

The app now also displays converted to draft / marked as ready for review events in PR conversation.

draft_light
draft_dark

Extra notes:

  • I've removed pressed states for edit issue/PR fab in cd22140 because they are actually useless thanks to ripple. They were also visually conflicting with the latter.
  • in 771318e I've merged two drawables for review-related PR events that were perfectly equal. I don't see a good reason to keep them separate, given also that other PR events share drawables with others too

Fixes #1040

@Fs00
Copy link
Contributor Author

Fs00 commented Oct 11, 2021

A sidenote: I would have liked to implement a way to distinguish draft PRs in the open PRs list.
However, this requires a non-trivial amount of work since issue and PR lists share the same adapter which operates on Issue objects. Issues have a pullRequest field which holds a partial PR object with almost all fields (including draft state) set to null.
Therefore I doubt that the work required to implement this distinction is worth it.

@maniac103
Copy link
Collaborator

Therefore I doubt that the work required to implement this distinction is worth it.

I agree. It's also really sad there's no API for converting a PR between draft and normal state.

@maniac103 maniac103 merged commit b998516 into slapperwan:master Oct 13, 2021
@Fs00 Fs00 deleted the draft-prs branch October 13, 2021 08:33
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.

Support draft pr
2 participants