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

add WebHomeMiniAvatarUploadButton Interaction #57

Merged
merged 3 commits into from
May 9, 2022

Conversation

justjanne
Copy link
Contributor

Related: element-hq/element-web#21946
Dependents: matrix-org/matrix-react-sdk#8474

In Short

  • Adds new WebHomeMiniAvatarUploadButton interaction

@justjanne justjanne marked this pull request as ready for review May 3, 2022 12:05
@justjanne
Copy link
Contributor Author

justjanne commented May 4, 2022

As "interaction" doesn’t really fit for an avatar upload, the other option that I can see right now would be adding a new event type, e.g.:

{
  "type": "object",
  "description": "Triggered when a user uploads an avatar.",
  "properties": {
    "eventName": {
      "enum": ["AvatarUpload"]
    },
    "target": {
      "description": "Whose avatar is being changed.",
      "type": "string",
      "oneOf": [
        { "const": "User", "description":  "User replaced their own avatar." },
        { "const": "Room", "description": "User replaced the avatar of a room." },
        { "const": "Space", "description": "User replaced the avatar of a room." }
      ]
    },
    "isInitial": {
      "description": "Whether the target was without avatar before this upload.",
      "type": "boolean"
    },
    "source": {
      "description": "UI element which caused the upload",
      "type": "string",
      "oneOf": [
        { "const": "HomePage", "description": "New user welcome screen" },
        { "const": "NewRoomIntro", "description": "New room welcome message" },
        { "const": "RoomProfileSettings", "description": "Room settings dialog" },
        { "const": "SpaceBasicSettings", "description": "Space settings dialog" },
        { "const": "ProfileSettings", "description": "Profile settings dialog" }
      ]
    }
  },
  "required": ["eventName", "target", "isInitial", "source"],
  "additionalProperties": false
}

Is that preferred? If so, I’ll update both PRs accordingly

@justjanne justjanne requested a review from t3chguy May 4, 2022 14:32
@t3chguy
Copy link
Member

t3chguy commented May 4, 2022

I think we're wanting to avoid very pidgeonholed events so it doesn't become overwhelming

@justjanne
Copy link
Contributor Author

We’re now tracking the onClick event of the upload button, as previously discussed :)

schemas/Interaction.json Outdated Show resolved Hide resolved
@justjanne justjanne merged commit a0687ca into main May 9, 2022
@t3chguy t3chguy deleted the justjanne/feat/21946-welcome-screen-avatar-upload branch May 11, 2022 21:09
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