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

Poll Feature - Create #4360

Merged
merged 20 commits into from
Nov 15, 2021
Merged

Poll Feature - Create #4360

merged 20 commits into from
Nov 15, 2021

Conversation

onurays
Copy link
Contributor

@onurays onurays commented Oct 28, 2021

Onuray Sahin added 9 commits October 25, 2021 14:47
* develop: (129 commits)
  Improve Rx sequence regarding listener
  adding changelog entry
  using correct license for matrix-sdk test
  extending the room name resolved to create a dedicated room name data class which contains a normalized version of the room name
  Remove shortcut as soon as a PIN code is set
  ensuring the store migration class is always equal to other store migration instances - is needed as realm will throw if multiple migration instances are created and they don't match
  removing extra query definition by chaining the query creation with modifiers
  removing noisy log which duplicates a type clause and fixing when casing formatting to have a case per line
  documenting the different query cases
  making the isNormalized function an extension and internal to the sdk
  Cache immutable value
  Do not show shortcuts if a PIN code is set
  Remove (disable) shortcut if a room is left
  Ensure ShortcutsHandler get all the joined rooms #4168
  Add `sortOrder: RoomSortOrder` parameter, with no API break
  Clean code
  adding normalised room display name field and making use of it when filtering rooms by name - fixes non latin-1 character set room names from being ignored when searching with inexact casing
  adding normalisation to the query string cases
  making value processing an injectable class, it will need to have its own dependencies to support normalisation
  porting QueryStringValue to sealed interface with a sub category for the content based values - allows for handling those cases separately for normalisation
  ...

# Conflicts:
#	vector/src/main/java/im/vector/app/core/di/ScreenComponent.kt
@onurays onurays requested a review from bmarty October 28, 2021 15:05
@github-actions
Copy link

github-actions bot commented Oct 28, 2021

Unit Test Results

  62 files  ±0    62 suites  ±0   1m 4s ⏱️ -1s
118 tests ±0  118 ✔️ ±0  0 💤 ±0  0 ±0 
350 runs  ±0  350 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 299d81f. ± Comparison against base commit 868548d.

♻️ This comment has been updated with latest results.

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Nice work, thanks.
Some remarks plus:

  1. How to the attachment picker is displayed if the keyboard is opened?
  2. Maybe temporarily hide the option to create poll in this PR so that we can merge it once it's approved

@bmarty
Copy link
Member

bmarty commented Oct 28, 2021

Also please have a look at the CI

@bmarty
Copy link
Member

bmarty commented Oct 28, 2021

Is there an existing issue? If yes it should be linked to this PR
Also is there a Figma link?

Copy link
Member

@ganfra ganfra left a comment

Choose a reason for hiding this comment

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

Some remarks

@onurays onurays linked an issue Oct 29, 2021 that may be closed by this pull request
4 tasks
@onurays onurays requested review from bmarty and ganfra October 29, 2021 14:19
@onurays
Copy link
Contributor Author

onurays commented Oct 29, 2021

Nice work, thanks. Some remarks plus:

  1. How to the attachment picker is displayed if the keyboard is opened?
  2. Maybe temporarily hide the option to create poll in this PR so that we can merge it once it's approved
  1. It is hiding the text composer. Composer design is changed completely. I will also implement it next week. So this shouldn't block this PR.
  2. Done, good idea.

@onurays onurays marked this pull request as ready for review November 1, 2021 07:54
@onurays onurays changed the title Poll Feature Poll Feature - Create Nov 1, 2021
Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Thanks for the update.
A few more comments for you. Also can you please check the CI status?

val intent = CreatePollActivity.getIntent(context, CreatePollArgs(roomId = roomId))
val intent = CreatePollActivity.getIntent(
context,
CreatePollArgs(roomId = roomId, minOptionsCount = CreatePollViewModel.MIN_OPTIONS_COUNT)
Copy link
Member

Choose a reason for hiding this comment

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

What is the point to pass minOptionsCount as an Activity parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought it was necessary to use it in CreatePollViewState. Fixed by using const value in ViewModel directly.

canCreatePoll = canCreatePoll(question, options),
canAddMoreOptions = options.size < MAX_OPTIONS_COUNT
)
}
Copy link
Member

Choose a reason for hiding this comment

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

👍

) : MavericksState {

constructor(args: CreatePollArgs) : this(
roomId = args.roomId
roomId = args.roomId,
options = List(args.minOptionsCount) { "" }
Copy link
Member

Choose a reason for hiding this comment

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

This is not the best place to init options. I would have done it on line 24 instead

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@gaelledel
Copy link

@onurays I'm not able to see the polls feature in the test build you sent

@onurays onurays requested review from bmarty and gaelledel November 4, 2021 08:44
Copy link

@gaelledel gaelledel left a comment

Choose a reason for hiding this comment

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

  • We need to left align the close button with the content below please ( cross aligned with title under)

  • Change the colour of the text field frames so it matches Figma colours --> Quinary

  • The option text fields should not grow (this behaviour should only happen for the poll question)

  • The delete Option button should be centre aligned with the text field

  • The Create Poll button disabled state visual does not match Figma's disabled state. For more info on buttons and core components please check Compound UI kit.

  • Weird animation when no options fields are displayed and you press on Add option. The add option text animates downwards. Could you remove this?

  • On user input in the text field: the Return key Dismiss the keyboard and the field should return to unfocussed state.

  • Enlarge the default height of the question to double size. The field should only grow if the character limit is reached. The return button should dismiss the keyboard and the field should be unfocussed. See Figma here https://www.figma.com/file/tepA3ELWBE5v4O2WB8PqWn/Polls?node-id=496%3A52205

  • The Create poll CTA should not move above the composer. It should remain under the Add option button at all times

@onurays onurays requested a review from gaelledel November 8, 2021 14:26
Copy link

@gaelledel gaelledel left a comment

Choose a reason for hiding this comment

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

Thanks for the edits @onurays!

@ouchadam
Copy link
Contributor

how does the screen look in dark mode?

Copy link
Contributor

@ouchadam ouchadam left a comment

Choose a reason for hiding this comment

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

small remark about double checking dark mode, otherwise looks good!

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Just a few more questions / remark.
Also please fix errors reported by the CI


holder.textInputEditText.isEnabled = enabled
if (singleLine) {
holder.textInputEditText.setSingleLine()
Copy link
Member

Choose a reason for hiding this comment

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

When doing binding, we have to take care of the recycling of views. So a else block is needed here I think

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

}
imeOptions?.let {
holder.textInputEditText.imeOptions = it
}
Copy link
Member

Choose a reason for hiding this comment

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

same remark here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
views.toolbar.visibility = View.GONE
Copy link
Member

Choose a reason for hiding this comment

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

Strange to hide the toolbar here. I guess the toolbar is part of the fragment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Otherwise, it shows the back button on Toolbar. We are doing the same for CreateDirectRoomActivity and InviteUsersToRoomActivity.

}

private val hideToastRunnable = Runnable {
views.createPollToast.isVisible = false
Copy link
Member

Choose a reason for hiding this comment

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

I think this can crash if the Fragment has been destroyed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are using the same mechanism while recording voice messages. It is not crashing because it uses Handler inside. Also, we will never show toast on this screen, since we disable the button.

But I want to keep this to protect against post improvements.

@onurays onurays requested a review from bmarty November 11, 2021 10:42
Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

The CI is not happy, can you have a look please?

<string name="create_poll_title">Create Poll</string>
<string name="create_poll_question_title">Poll question or topic</string>
<string name="create_poll_question_hint">Question or topic</string>
<string name="create_poll_options_title">Create options</string>
Copy link
Member

Choose a reason for hiding this comment

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

We discussed about that wording in a Matrix room. Maybe "Options" is better here. What is the status?
CC @gaelledel

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@gaelledel wants to use "Create options".

Copy link
Member

Choose a reason for hiding this comment

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

OK, thanks

@onurays onurays requested a review from bmarty November 15, 2021 12:41
Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

Thanks for the update.
I will do a quick change on the style, sth I did not see before, but not blocking.

@bmarty bmarty merged commit 35e2a10 into develop Nov 15, 2021
@bmarty bmarty deleted the feature/ons/poll branch November 15, 2021 13:05
@bmarty bmarty mentioned this pull request Nov 15, 2021
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.

Poll Feature - Create Poll Screen
5 participants