feat(profile)!: replace sidebar and add avatar navigation
Rename the global Sidebar route, UI, assets, analytics, and payment return context to Profile. Add accessible message-avatar navigation and preserve the source character across auth and logout flows. BREAKING CHANGE: /sidebar has been removed; use /profile instead.
This commit is contained in:
@@ -31,7 +31,6 @@ describe("chat Tailwind components", () => {
|
||||
<MessageAvatar isFromAI={false} userAvatarUrl="/user-avatar.png" />,
|
||||
);
|
||||
|
||||
expect(aiHtml).toContain('aria-label="AI avatar"');
|
||||
expect(aiHtml).toContain("size-(--chat-avatar-size,43px)");
|
||||
expect(aiHtml).toContain("size-full object-cover");
|
||||
expect(aiHtml).toContain("%2Fimages%2Favatar%2Felio.png");
|
||||
@@ -39,6 +38,28 @@ describe("chat Tailwind components", () => {
|
||||
expect(userHtml).toContain("%2Fuser-avatar.png");
|
||||
});
|
||||
|
||||
it("renders message avatar actions with explicit destinations", () => {
|
||||
const aiHtml = renderWithCharacter(
|
||||
<MessageAvatar isFromAI={true} onClick={() => undefined} />,
|
||||
);
|
||||
const userHtml = renderWithCharacter(
|
||||
<MessageAvatar isFromAI={false} onClick={() => undefined} />,
|
||||
);
|
||||
|
||||
expect(aiHtml).toContain('<button type="button"');
|
||||
expect(aiHtml).toContain(
|
||||
'data-analytics-key="chat.open_private_room_from_avatar"',
|
||||
);
|
||||
expect(aiHtml).toContain(
|
||||
'aria-label="Open Elio Silvestri's private room"',
|
||||
);
|
||||
expect(userHtml).toContain('<button type="button"');
|
||||
expect(userHtml).toContain(
|
||||
'data-analytics-key="chat.open_profile_from_avatar"',
|
||||
);
|
||||
expect(userHtml).toContain('aria-label="Open profile"');
|
||||
});
|
||||
|
||||
it("renders the active character avatar", () => {
|
||||
const maya = getCharacterBySlug("maya");
|
||||
expect(maya).not.toBeNull();
|
||||
@@ -196,12 +217,12 @@ describe("chat Tailwind components", () => {
|
||||
expect(guestHtml).toContain('aria-label="Back to home"');
|
||||
expect(guestHtml).toContain('data-analytics-key="chat.back_to_home"');
|
||||
expect(guestHtml).toContain("px-(--chat-inline-padding,16px)");
|
||||
expect(guestHtml).not.toContain('aria-label="Menu"');
|
||||
expect(guestHtml).not.toContain('aria-label="Profile"');
|
||||
expect(memberHtml).toContain("Offer");
|
||||
expect(memberHtml).toContain('href="/characters/elio/splash"');
|
||||
expect(memberHtml).toContain('aria-label="Back to home"');
|
||||
expect(memberHtml).toContain('aria-label="Menu"');
|
||||
expect(memberHtml).toContain('data-analytics-key="chat.open_menu"');
|
||||
expect(memberHtml).toContain('aria-label="Profile"');
|
||||
expect(memberHtml).toContain('data-analytics-key="chat.open_profile"');
|
||||
expect(memberHtml).toContain('data-analytics-key="chat.back_to_home"');
|
||||
expect(memberHtml).toContain("px-(--chat-inline-padding,16px)");
|
||||
expect(memberHtml).not.toContain("px-(--spacing-md,12px)");
|
||||
@@ -222,7 +243,7 @@ describe("chat Tailwind components", () => {
|
||||
memberWithHintHtml.indexOf(
|
||||
'data-analytics-key="chat.external_browser_hint"',
|
||||
),
|
||||
).toBeLessThan(memberWithHintHtml.indexOf('aria-label="Menu"'));
|
||||
).toBeLessThan(memberWithHintHtml.indexOf('aria-label="Profile"'));
|
||||
expect(guestWithHintHtml).not.toContain(
|
||||
'data-analytics-key="chat.external_browser_hint"',
|
||||
);
|
||||
@@ -239,7 +260,7 @@ describe("chat Tailwind components", () => {
|
||||
);
|
||||
|
||||
expect(html).toContain('href="/characters/maya/splash"');
|
||||
expect(html).not.toContain('aria-label="Menu"');
|
||||
expect(html).not.toContain('aria-label="Profile"');
|
||||
expect(html).not.toContain(
|
||||
'data-analytics-key="chat.external_browser_hint"',
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user