Put view prefix to room list item file and folder (#32418)
* chore: put `view` prefix to room list item file and folder * chore: add missing `storybook-static` in gitignore * test: update visual tests
@@ -10,3 +10,5 @@
|
|||||||
/coverage/
|
/coverage/
|
||||||
# Ignore generated docs
|
# Ignore generated docs
|
||||||
typedoc
|
typedoc
|
||||||
|
# Build storybook
|
||||||
|
storybook-static
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.5 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 4.1 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.8 KiB After Width: | Height: | Size: 3.8 KiB |
|
After Width: | Height: | Size: 7.0 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 7.3 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 6.6 KiB |
|
After Width: | Height: | Size: 7.2 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
@@ -28,7 +28,7 @@ export * from "./rich-list/RichList";
|
|||||||
export * from "./room-list/RoomListHeaderView";
|
export * from "./room-list/RoomListHeaderView";
|
||||||
export * from "./room-list/RoomListSearchView";
|
export * from "./room-list/RoomListSearchView";
|
||||||
export * from "./room-list/RoomListView";
|
export * from "./room-list/RoomListView";
|
||||||
export * from "./room-list/RoomListItem";
|
export * from "./room-list/RoomListItemView";
|
||||||
export * from "./room-list/RoomListPrimaryFilters";
|
export * from "./room-list/RoomListPrimaryFilters";
|
||||||
export * from "./room-list/VirtualizedRoomListView";
|
export * from "./room-list/VirtualizedRoomListView";
|
||||||
export * from "./utils/Box";
|
export * from "./utils/Box";
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import React, { type JSX } from "react";
|
|||||||
import { Flex } from "../../utils/Flex";
|
import { Flex } from "../../utils/Flex";
|
||||||
import { RoomListItemMoreOptionsMenu, type RoomItemViewModel } from "./RoomListItemMoreOptionsMenu";
|
import { RoomListItemMoreOptionsMenu, type RoomItemViewModel } from "./RoomListItemMoreOptionsMenu";
|
||||||
import { RoomListItemNotificationMenu } from "./RoomListItemNotificationMenu";
|
import { RoomListItemNotificationMenu } from "./RoomListItemNotificationMenu";
|
||||||
import styles from "./RoomListItem.module.css";
|
import styles from "./RoomListItemView.module.css";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Props for RoomListItemHoverMenu component
|
* Props for RoomListItemHoverMenu component
|
||||||
@@ -12,7 +12,7 @@ import { describe, it, expect, vi } from "vitest";
|
|||||||
|
|
||||||
import { RoomListItemMoreOptionsMenu } from "./RoomListItemMoreOptionsMenu";
|
import { RoomListItemMoreOptionsMenu } from "./RoomListItemMoreOptionsMenu";
|
||||||
import { useMockedViewModel } from "../../viewmodel";
|
import { useMockedViewModel } from "../../viewmodel";
|
||||||
import type { RoomListItemSnapshot } from "./RoomListItem";
|
import type { RoomListItemSnapshot } from "./RoomListItemView";
|
||||||
import { defaultSnapshot } from "./default-snapshot";
|
import { defaultSnapshot } from "./default-snapshot";
|
||||||
|
|
||||||
describe("<RoomListItemMoreOptionsMenu />", () => {
|
describe("<RoomListItemMoreOptionsMenu />", () => {
|
||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
|
|
||||||
import { _t } from "../../utils/i18n";
|
import { _t } from "../../utils/i18n";
|
||||||
import { useViewModel, type ViewModel } from "../../viewmodel";
|
import { useViewModel, type ViewModel } from "../../viewmodel";
|
||||||
import type { RoomListItemSnapshot, RoomListItemActions } from "./RoomListItem";
|
import type { RoomListItemSnapshot, RoomListItemActions } from "./RoomListItemView";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* View model type for room list item
|
* View model type for room list item
|
||||||
@@ -13,7 +13,7 @@ import { describe, it, expect, vi } from "vitest";
|
|||||||
import { RoomListItemNotificationMenu } from "./RoomListItemNotificationMenu";
|
import { RoomListItemNotificationMenu } from "./RoomListItemNotificationMenu";
|
||||||
import { RoomNotifState } from "./RoomNotifs";
|
import { RoomNotifState } from "./RoomNotifs";
|
||||||
import { useMockedViewModel } from "../../viewmodel";
|
import { useMockedViewModel } from "../../viewmodel";
|
||||||
import type { RoomListItemSnapshot } from "./RoomListItem";
|
import type { RoomListItemSnapshot } from "./RoomListItemView";
|
||||||
import { defaultSnapshot } from "./default-snapshot";
|
import { defaultSnapshot } from "./default-snapshot";
|
||||||
|
|
||||||
describe("<RoomListItemNotificationMenu />", () => {
|
describe("<RoomListItemNotificationMenu />", () => {
|
||||||
@@ -16,7 +16,7 @@ import {
|
|||||||
import { _t } from "../../utils/i18n";
|
import { _t } from "../../utils/i18n";
|
||||||
import { RoomNotifState } from "./RoomNotifs";
|
import { RoomNotifState } from "./RoomNotifs";
|
||||||
import { useViewModel, type ViewModel } from "../../viewmodel";
|
import { useViewModel, type ViewModel } from "../../viewmodel";
|
||||||
import type { RoomListItemSnapshot, RoomListItemActions } from "./RoomListItem";
|
import type { RoomListItemSnapshot, RoomListItemActions } from "./RoomListItemView";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* View model type for room list item
|
* View model type for room list item
|
||||||
@@ -9,8 +9,8 @@ import React, { type JSX } from "react";
|
|||||||
import { fn } from "storybook/test";
|
import { fn } from "storybook/test";
|
||||||
|
|
||||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||||
import type { Room } from "./RoomListItem";
|
import type { Room } from "./RoomListItemView";
|
||||||
import { RoomListItemView, type RoomListItemSnapshot, type RoomListItemActions } from "./RoomListItem";
|
import { RoomListItemView, type RoomListItemSnapshot, type RoomListItemActions } from "./RoomListItemView";
|
||||||
import { useMockedViewModel } from "../../viewmodel";
|
import { useMockedViewModel } from "../../viewmodel";
|
||||||
import { defaultSnapshot } from "./default-snapshot";
|
import { defaultSnapshot } from "./default-snapshot";
|
||||||
import { renderAvatar } from "../story-mocks";
|
import { renderAvatar } from "../story-mocks";
|
||||||
@@ -69,7 +69,7 @@ const RoomListItemWrapper = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const meta = {
|
const meta = {
|
||||||
title: "Room List/RoomListItem",
|
title: "Room List/RoomListItemView",
|
||||||
component: RoomListItemWrapper,
|
component: RoomListItemWrapper,
|
||||||
tags: ["autodocs"],
|
tags: ["autodocs"],
|
||||||
decorators: [
|
decorators: [
|
||||||
@@ -11,7 +11,7 @@ import userEvent from "@testing-library/user-event";
|
|||||||
import { composeStories } from "@storybook/react-vite";
|
import { composeStories } from "@storybook/react-vite";
|
||||||
import { describe, it, expect } from "vitest";
|
import { describe, it, expect } from "vitest";
|
||||||
|
|
||||||
import * as stories from "./RoomListItem.stories";
|
import * as stories from "./RoomListItemView.stories";
|
||||||
|
|
||||||
const {
|
const {
|
||||||
Default,
|
Default,
|
||||||
@@ -13,7 +13,7 @@ import { NotificationDecoration, type NotificationDecorationData } from "./Notif
|
|||||||
import { RoomListItemHoverMenu } from "./RoomListItemHoverMenu";
|
import { RoomListItemHoverMenu } from "./RoomListItemHoverMenu";
|
||||||
import { RoomListItemContextMenu } from "./RoomListItemContextMenu";
|
import { RoomListItemContextMenu } from "./RoomListItemContextMenu";
|
||||||
import { type RoomNotifState } from "./RoomNotifs";
|
import { type RoomNotifState } from "./RoomNotifs";
|
||||||
import styles from "./RoomListItem.module.css";
|
import styles from "./RoomListItemView.module.css";
|
||||||
import { useViewModel, type ViewModel } from "../../viewmodel";
|
import { useViewModel, type ViewModel } from "../../viewmodel";
|
||||||
import { _t } from "../../utils/i18n";
|
import { _t } from "../../utils/i18n";
|
||||||
|
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
* Please see LICENSE files in the repository root for full details.
|
* Please see LICENSE files in the repository root for full details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { type RoomListItemSnapshot } from "./RoomListItem";
|
import { type RoomListItemSnapshot } from "./RoomListItemView";
|
||||||
import { RoomNotifState } from "./RoomNotifs";
|
import { RoomNotifState } from "./RoomNotifs";
|
||||||
|
|
||||||
export const mockRoom = { name: "General" };
|
export const mockRoom = { name: "General" };
|
||||||
@@ -5,14 +5,14 @@
|
|||||||
* Please see LICENSE files in the repository root for full details.
|
* Please see LICENSE files in the repository root for full details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
export { RoomListItemView } from "./RoomListItem";
|
export { RoomListItemView } from "./RoomListItemView";
|
||||||
export type {
|
export type {
|
||||||
Room,
|
Room,
|
||||||
RoomListItemSnapshot,
|
RoomListItemSnapshot,
|
||||||
RoomItemViewModel,
|
RoomItemViewModel,
|
||||||
RoomListItemActions,
|
RoomListItemActions,
|
||||||
RoomListItemViewProps,
|
RoomListItemViewProps,
|
||||||
} from "./RoomListItem";
|
} from "./RoomListItemView";
|
||||||
export { RoomListItemNotificationMenu } from "./RoomListItemNotificationMenu";
|
export { RoomListItemNotificationMenu } from "./RoomListItemNotificationMenu";
|
||||||
export type { RoomListItemNotificationMenuProps } from "./RoomListItemNotificationMenu";
|
export type { RoomListItemNotificationMenuProps } from "./RoomListItemNotificationMenu";
|
||||||
export { RoomListItemMoreOptionsMenu, MoreOptionContent } from "./RoomListItemMoreOptionsMenu";
|
export { RoomListItemMoreOptionsMenu, MoreOptionContent } from "./RoomListItemMoreOptionsMenu";
|
||||||
@@ -9,7 +9,7 @@ import React, { type JSX } from "react";
|
|||||||
import { fn } from "storybook/test";
|
import { fn } from "storybook/test";
|
||||||
|
|
||||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||||
import type { Room } from "../RoomListItem/RoomListItem";
|
import type { Room } from "../RoomListItemView";
|
||||||
import type { FilterId } from "../RoomListPrimaryFilters";
|
import type { FilterId } from "../RoomListPrimaryFilters";
|
||||||
import { RoomListView, type RoomListSnapshot, type RoomListViewActions } from "./RoomListView";
|
import { RoomListView, type RoomListSnapshot, type RoomListViewActions } from "./RoomListView";
|
||||||
import { useMockedViewModel } from "../../viewmodel";
|
import { useMockedViewModel } from "../../viewmodel";
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import { RoomListPrimaryFilters, type FilterId } from "../RoomListPrimaryFilters
|
|||||||
import { RoomListLoadingSkeleton } from "./RoomListLoadingSkeleton";
|
import { RoomListLoadingSkeleton } from "./RoomListLoadingSkeleton";
|
||||||
import { RoomListEmptyStateView } from "./RoomListEmptyStateView";
|
import { RoomListEmptyStateView } from "./RoomListEmptyStateView";
|
||||||
import { VirtualizedRoomListView, type RoomListViewState } from "../VirtualizedRoomListView";
|
import { VirtualizedRoomListView, type RoomListViewState } from "../VirtualizedRoomListView";
|
||||||
import { type Room } from "../RoomListItem";
|
import { type Room } from "../RoomListItemView";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Snapshot for the room list view
|
* Snapshot for the room list view
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import React, { type JSX } from "react";
|
|||||||
import { fn } from "storybook/test";
|
import { fn } from "storybook/test";
|
||||||
|
|
||||||
import type { Meta, StoryObj } from "@storybook/react-vite";
|
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||||||
import type { Room } from "../RoomListItem/RoomListItem";
|
import type { Room } from "../RoomListItemView";
|
||||||
import { VirtualizedRoomListView, type RoomListViewState } from "./VirtualizedRoomListView";
|
import { VirtualizedRoomListView, type RoomListViewState } from "./VirtualizedRoomListView";
|
||||||
import type { RoomListSnapshot, RoomListViewActions } from "../RoomListView";
|
import type { RoomListSnapshot, RoomListViewActions } from "../RoomListView";
|
||||||
import { useMockedViewModel } from "../../viewmodel";
|
import { useMockedViewModel } from "../../viewmodel";
|
||||||
|
|||||||
@@ -9,11 +9,10 @@ import React, { useCallback, useMemo, useRef, type JSX, type ReactNode } from "r
|
|||||||
import { type ScrollIntoViewLocation } from "react-virtuoso";
|
import { type ScrollIntoViewLocation } from "react-virtuoso";
|
||||||
import { isEqual } from "lodash";
|
import { isEqual } from "lodash";
|
||||||
|
|
||||||
import type { Room } from "../RoomListItem/RoomListItem";
|
import { RoomListItemView, type Room } from "../RoomListItemView";
|
||||||
import { useViewModel } from "../../viewmodel";
|
import { useViewModel } from "../../viewmodel";
|
||||||
import { _t } from "../../utils/i18n";
|
import { _t } from "../../utils/i18n";
|
||||||
import { VirtualizedList, type VirtualizedListContext } from "../../utils/VirtualizedList";
|
import { VirtualizedList, type VirtualizedListContext } from "../../utils/VirtualizedList";
|
||||||
import { RoomListItemView } from "../RoomListItem";
|
|
||||||
import type { RoomListViewModel } from "../RoomListView";
|
import type { RoomListViewModel } from "../RoomListView";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -8,9 +8,7 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { fn } from "storybook/test";
|
import { fn } from "storybook/test";
|
||||||
|
|
||||||
import type { Room } from "./RoomListItem/RoomListItem";
|
import { type Room, type RoomListItemSnapshot, RoomNotifState } from "./RoomListItemView";
|
||||||
import type { RoomListItemSnapshot } from "./RoomListItem";
|
|
||||||
import { RoomNotifState } from "./RoomListItem/RoomNotifs";
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mock avatar component for stories
|
* Mock avatar component for stories
|
||||||
|
|||||||