Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
5ac59f8
change button to div
ZacksBot Feb 19, 2026
85a9279
Update, can be button and div if !onCLick
ZacksBot Feb 20, 2026
bec5c63
unify DisambiguatedProfile onClick typing for button/div events
ZacksBot Feb 20, 2026
f492c3b
ESlint compain
ZacksBot Feb 20, 2026
20e523e
Update snapshots of effected components
ZacksBot Feb 20, 2026
5dd4b8e
Update snapshots to mimic component changes
ZacksBot Feb 20, 2026
df7a762
nuke all css button
ZacksBot Feb 20, 2026
f370520
Update snapshots
ZacksBot Feb 20, 2026
e933bc9
Update snapshots
ZacksBot Feb 20, 2026
b0fc6a3
Update snapshots
ZacksBot Feb 20, 2026
043ddba
Update snapshot and css
ZacksBot Feb 20, 2026
2231dcc
Update Snapshot and correct css
ZacksBot Feb 23, 2026
928def3
Update css
ZacksBot Feb 23, 2026
9a3d0d6
Update css for button and added onClick function
ZacksBot Feb 23, 2026
708d2e5
Update Eventtile
ZacksBot Feb 23, 2026
bf361b5
typo
ZacksBot Feb 23, 2026
9f93644
Update snapshots
ZacksBot Feb 23, 2026
766f008
Update snapshots + updated eventitle css
ZacksBot Feb 23, 2026
3ea134c
Update snapshots
ZacksBot Feb 24, 2026
9e86214
Remove MX css, should not be used
ZacksBot Feb 24, 2026
5abd1d6
Update pcss for eventitle to reflect component changes
ZacksBot Feb 24, 2026
ced96fb
Update css and snapshots
ZacksBot Feb 24, 2026
373e4e3
fix missing of semicolon
ZacksBot Feb 24, 2026
04f20b6
Update css to remove the outline from the bottom
ZacksBot Feb 24, 2026
6c39106
Update snapshots for the change of bottom
ZacksBot Feb 24, 2026
c481cbf
Remove wrong css adaption
ZacksBot Feb 24, 2026
d2bf505
Update snapshot + css to fix issues with bottom
ZacksBot Feb 24, 2026
0990c8e
Update css and snapshots
ZacksBot Feb 24, 2026
bb37f96
Update snapshot
ZacksBot Feb 24, 2026
1cbe650
Update snapshots
ZacksBot Feb 24, 2026
1a3080c
Update view and html
ZacksBot Feb 24, 2026
cae48be
Eslint FIx
ZacksBot Feb 24, 2026
6f0bace
Add css back to pcss
ZacksBot Feb 25, 2026
5f57560
Update bottom + snapshots
ZacksBot Feb 25, 2026
844f925
Update css + snapshots
ZacksBot Feb 25, 2026
ca8aecb
Update
ZacksBot Feb 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/res/css/views/rooms/_EventTile.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ $left-gutter: 64px;
}

> .mx_DisambiguatedProfile {
line-height: $font-20px;
margin-bottom: 4px;
margin-left: $left-gutter;
max-width: calc(100% - $left-gutter);
}
Expand Down
2 changes: 2 additions & 0 deletions apps/web/src/components/views/messages/SenderProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ export default function SenderProfile({ mxEvent, onClick, withTooltip }: IProps)
emphasizeDisplayName: true,
withTooltip,
className: "mx_DisambiguatedProfile",
classNameDisplayName: "mx_DisambiguatedProfile_displayName",
classNameDisplayIdentifier: "mx_DisambiguatedProfile_mxid",
}),
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export function RoomMemberTileView(props: IProps): JSX.Element {
member,
withTooltip: true,
className: "mx_DisambiguatedProfile",
classNameDisplayName: "mx_DisambiguatedProfile_displayName",
classNameDisplayIdentifier: "mx_DisambiguatedProfile_mxid",
}),
);
useEffect(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
*/
import {
BaseViewModel,
type DisambiguatedProfileViewActions,
type DisambiguatedProfileViewSnapshot,
type DisambiguatedProfileViewModel as DisambiguatedProfileViewModelInterface,
} from "@element-hq/web-shared-components";
import { type MouseEvent } from "react";

import type { MouseEvent } from "react";
import { _t } from "../../languageHandler";
import { getUserNameColorClass } from "../../utils/FormattingUtils";
import UserIdentifier from "../../customisations/UserIdentifier";
Expand Down Expand Up @@ -65,11 +64,19 @@ export interface DisambiguatedProfileViewModelProps {
/**
* Optional click handler for the profile.
*/
onClick?: DisambiguatedProfileViewActions["onClick"];
onClick?: (event: MouseEvent<HTMLButtonElement | HTMLDivElement>) => void;
/**
* Optional CSS class name to apply to the profile.
*/
className?: string;
/**
* Optional CSS class name to apply to the display name span.
*/
classNameDisplayName?: string;
/**
* Optional CSS class name to apply to the display identifier span.
*/
classNameDisplayIdentifier?: string;
}

/**
Expand All @@ -83,7 +90,16 @@ export class DisambiguatedProfileViewModel
private static readonly computeSnapshot = (
props: DisambiguatedProfileViewModelProps,
): DisambiguatedProfileViewSnapshot => {
const { member, fallbackName, colored, emphasizeDisplayName, withTooltip, className } = props;
const {
member,
fallbackName,
colored,
emphasizeDisplayName,
withTooltip,
className,
classNameDisplayName,
classNameDisplayIdentifier,
} = props;

// Compute display name
const displayName = member?.rawDisplayName || fallbackName;
Expand Down Expand Up @@ -124,6 +140,8 @@ export class DisambiguatedProfileViewModel
displayName,
colorClass,
className,
classNameDisplayName,
classNameDisplayIdentifier,
displayIdentifier,
title,
emphasizeDisplayName,
Expand All @@ -141,7 +159,7 @@ export class DisambiguatedProfileViewModel
this.snapshot.set(DisambiguatedProfileViewModel.computeSnapshot(this.props));
}

public onClick = (evt: MouseEvent<HTMLDivElement>): void => {
this.props.onClick?.(evt);
};
public get onClick(): ((event: MouseEvent<HTMLButtonElement | HTMLDivElement>) => void) | undefined {
return this.props.onClick;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ exports[`ReplyChain should call setQuoteExpanded if chain is longer than 2 lines
u
</span>
<div
class="mx_DisambiguatedProfile _disambiguatedProfile_oa3at_8"
role="button"
tabindex="0"
class="mx_DisambiguatedProfile _disambiguatedProfile_s5fes_8"
>
<span
class="mx_Username_color2 _disambiguatedProfile_displayName_oa3at_14 mx_DisambiguatedProfile_displayName"
class="mx_DisambiguatedProfile_displayName mx_Username_color2 _disambiguatedProfile_displayName_s5fes_13"
dir="auto"
>
@userId:matrix.org
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@ exports[`MemberTileView RoomMemberTileView should display an verified E2EIcon wh
class="mx_MemberTileView_name"
>
<div
class="mx_DisambiguatedProfile _disambiguatedProfile_oa3at_8"
role="button"
tabindex="0"
class="mx_DisambiguatedProfile _disambiguatedProfile_s5fes_8"
title="@userId:matrix.org (@userId:matrix.org)"
>
<span
class=""
class="mx_DisambiguatedProfile_displayName"
dir="auto"
>
@userId:matrix.org
Expand Down Expand Up @@ -111,13 +109,11 @@ exports[`MemberTileView RoomMemberTileView should display an warning E2EIcon whe
class="mx_MemberTileView_name"
>
<div
class="mx_DisambiguatedProfile _disambiguatedProfile_oa3at_8"
role="button"
tabindex="0"
class="mx_DisambiguatedProfile _disambiguatedProfile_s5fes_8"
title="@userId:matrix.org (@userId:matrix.org)"
>
<span
class=""
class="mx_DisambiguatedProfile_displayName"
dir="auto"
>
@userId:matrix.org
Expand Down Expand Up @@ -187,13 +183,11 @@ exports[`MemberTileView RoomMemberTileView should not display an E2EIcon when th
class="mx_MemberTileView_name"
>
<div
class="mx_DisambiguatedProfile _disambiguatedProfile_oa3at_8"
role="button"
tabindex="0"
class="mx_DisambiguatedProfile _disambiguatedProfile_s5fes_8"
title="@userId:matrix.org (@userId:matrix.org)"
>
<span
class=""
class="mx_DisambiguatedProfile_displayName"
dir="auto"
>
@userId:matrix.org
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,18 +70,17 @@ exports[`<LayoutSwitcher /> should render 1`] = `
data-self="true"
tabindex="-1"
>
<div
class="mx_DisambiguatedProfile _disambiguatedProfile_oa3at_8"
role="button"
tabindex="0"
<button
class="mx_DisambiguatedProfile _disambiguatedProfile_s5fes_8"
type="button"
>
<span
class="mx_Username_color2 _disambiguatedProfile_displayName_oa3at_14 mx_DisambiguatedProfile_displayName"
class="mx_DisambiguatedProfile_displayName mx_Username_color2 _disambiguatedProfile_displayName_s5fes_13"
dir="auto"
>
Alice
</span>
</div>
</button>
<div
class="mx_EventTile_avatar"
>
Expand Down Expand Up @@ -211,18 +210,17 @@ exports[`<LayoutSwitcher /> should render 1`] = `
data-self="true"
tabindex="-1"
>
<div
class="mx_DisambiguatedProfile _disambiguatedProfile_oa3at_8"
role="button"
tabindex="0"
<button
class="mx_DisambiguatedProfile _disambiguatedProfile_s5fes_8"
type="button"
>
<span
class="mx_Username_color2 _disambiguatedProfile_displayName_oa3at_14 mx_DisambiguatedProfile_displayName"
class="mx_DisambiguatedProfile_displayName mx_Username_color2 _disambiguatedProfile_displayName_s5fes_13"
dir="auto"
>
Alice
</span>
</div>
</button>
<div
class="mx_EventTile_avatar"
>
Expand Down Expand Up @@ -355,18 +353,17 @@ exports[`<LayoutSwitcher /> should render 1`] = `
<span
class="mx_MessageTimestamp"
/>
<div
class="mx_DisambiguatedProfile _disambiguatedProfile_oa3at_8"
role="button"
tabindex="0"
<button
class="mx_DisambiguatedProfile _disambiguatedProfile_s5fes_8"
type="button"
>
<span
class="mx_Username_color2 _disambiguatedProfile_displayName_oa3at_14 mx_DisambiguatedProfile_displayName"
class="mx_DisambiguatedProfile_displayName mx_Username_color2 _disambiguatedProfile_displayName_s5fes_13"
dir="auto"
>
Alice
</span>
</div>
</button>
<div
class="mx_EventTile_avatar"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,18 +213,17 @@ exports[`AppearanceUserSettingsTab should render 1`] = `
data-self="true"
tabindex="-1"
>
<div
class="mx_DisambiguatedProfile _disambiguatedProfile_oa3at_8"
role="button"
tabindex="0"
<button
class="mx_DisambiguatedProfile _disambiguatedProfile_s5fes_8"
type="button"
>
<span
class="mx_Username_color2 _disambiguatedProfile_displayName_oa3at_14 mx_DisambiguatedProfile_displayName"
class="mx_DisambiguatedProfile_displayName mx_Username_color2 _disambiguatedProfile_displayName_s5fes_13"
dir="auto"
>
@userId:matrix.org
</span>
</div>
</button>
<div
class="mx_EventTile_avatar"
>
Expand Down Expand Up @@ -354,18 +353,17 @@ exports[`AppearanceUserSettingsTab should render 1`] = `
data-self="true"
tabindex="-1"
>
<div
class="mx_DisambiguatedProfile _disambiguatedProfile_oa3at_8"
role="button"
tabindex="0"
<button
class="mx_DisambiguatedProfile _disambiguatedProfile_s5fes_8"
type="button"
>
<span
class="mx_Username_color2 _disambiguatedProfile_displayName_oa3at_14 mx_DisambiguatedProfile_displayName"
class="mx_DisambiguatedProfile_displayName mx_Username_color2 _disambiguatedProfile_displayName_s5fes_13"
dir="auto"
>
@userId:matrix.org
</span>
</div>
</button>
<div
class="mx_EventTile_avatar"
>
Expand Down Expand Up @@ -498,18 +496,17 @@ exports[`AppearanceUserSettingsTab should render 1`] = `
<span
class="mx_MessageTimestamp"
/>
<div
class="mx_DisambiguatedProfile _disambiguatedProfile_oa3at_8"
role="button"
tabindex="0"
<button
class="mx_DisambiguatedProfile _disambiguatedProfile_s5fes_8"
type="button"
>
<span
class="mx_Username_color2 _disambiguatedProfile_displayName_oa3at_14 mx_DisambiguatedProfile_displayName"
class="mx_DisambiguatedProfile_displayName mx_Username_color2 _disambiguatedProfile_displayName_s5fes_13"
dir="auto"
>
@userId:matrix.org
</span>
</div>
</button>
<div
class="mx_EventTile_avatar"
>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;

.disambiguatedProfile_displayName {
font: var(--cpd-font-body-md-semibold);
Expand All @@ -25,3 +24,11 @@
margin-inline-start: 5px;
}
}

button {
/* Clear default <button> styles */
padding: 0;
border: none;
vertical-align: baseline;
background: none;
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/

import React, { type JSX } from "react";
import { fn } from "storybook/test";

import type { Meta, StoryObj } from "@storybook/react-vite";
import {
Expand All @@ -33,14 +32,17 @@ const meta = {
displayName: { control: "text" },
colorClass: { control: "text" },
className: { control: "text" },
classNameDisplayName: { control: "text" },
classNameDisplayIdentifier: { control: "text" },
displayIdentifier: { control: "text" },
title: { control: "text" },
emphasizeDisplayName: { control: "boolean" },
},
args: {
displayName: "Alice",
emphasizeDisplayName: true,
onClick: fn(),
classNameDisplayName: "mx_DisambiguatedProfile_displayName",
classNameDisplayIdentifier: "mx_DisambiguatedProfile_mxid",
},
} satisfies Meta<typeof DisambiguatedProfileViewWrapper>;

Expand Down Expand Up @@ -78,6 +80,14 @@ export const WithTooltip: Story = {
},
};

export const WithTooltipAndActions: Story = {
args: {
displayName: "Diana",
title: "Diana (@diana:example.org)",
onClick: () => console.log("Clicked disambiguated profile"),
},
};

export const FullExample: Story = {
args: {
displayName: "Eve",
Expand Down
Loading
Loading