Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// into Blueprint and @box/threaded-annotations components, breaking their
// styling. This file resets those rules within the v2 adapter boundary.

@import '../../common/variables';

.bcs-NewActivityFeed {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -52,6 +54,20 @@
&-mentionEmpty {
padding: var(--bp-space-030) var(--bp-space-040);
}

// Wrapper is transparent to layout; serves only as a DOM hook for the
// focused descendant selector below. The visible focus chrome (border,
// background) is painted directly onto the vendor's threaded-annotation
// card so its own border-radius, padding, and position are reused.
// Class name is CSS-modules-hashed; substring match survives bumps.
&-threadRow {
display: contents;

&.is-focused [class*='threadedAnnotations'] {
border-color: $bdl-box-blue-80;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should use bp tokens. for $bdl-box-blue-80, it should be "--bp-box-blue-80"

background-color: rgba($bdl-box-blue, 0.04);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should use blueprint tokens

}
}
}

// Lets inner ellipsis truncation resolve against the sidebar width.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ const ActivityFeedV2 = ({
{filteredItems.map(item => (
<FeedItemRow
key={item.id}
activeFeedEntryId={activeFeedEntryId}
currentUserId={currentUserId}
fps={fps}
isDisabled={isDisabled}
Expand Down
101 changes: 55 additions & 46 deletions src/elements/content-sidebar/activity-feed-v2/FeedItemRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*/

import * as React from 'react';
import classNames from 'classnames';
import noop from 'lodash/noop';

import { ActivityFeed } from '@box/activity-feed';
Expand All @@ -30,6 +31,7 @@ import {
} from '../../../constants';

type FeedItemRowProps = {
activeFeedEntryId?: string;
currentUserId?: string;
fps: number;
isDisabled: boolean;
Expand Down Expand Up @@ -81,6 +83,7 @@ const buildReplyPost =
};

const FeedItemRow = ({
activeFeedEntryId,
currentUserId,
fps,
isDisabled,
Expand All @@ -104,6 +107,10 @@ const FeedItemRow = ({
timeFormat,
userSelectorProps,
}: FeedItemRowProps) => {
const threadRowClassName = classNames('bcs-NewActivityFeed-threadRow', {
'is-focused': item.id === activeFeedEntryId,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

would this be always active? when would the focus turn off? is the logic inside the consumer of buie then?

});

switch (item.type) {
case 'comment': {
const { permissions } = item;
Expand Down Expand Up @@ -145,27 +152,28 @@ const FeedItemRow = ({
? { ...item.annotationTarget, timestamp: formatByTimeFormat(timestampMs, timeFormat, fps) }
: item.annotationTarget;
return (
<ActivityFeed.List.ThreadedAnnotation
key={item.id}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This doesn't affect rendering in any way downstream?

annotationTarget={commentAnnotationTarget}
isAnnotations={false}
isEditDisabled={isDisabled || item.isResolved}
isResolved={item.isResolved}
messages={item.messages}
onAnnotationBadgeClick={handleBadgeClick}
onAvatarClick={noop}
onCopyLink={onCommentCopyLink ? (id: string) => onCommentCopyLink({ id }) : undefined}
onDelete={handleDelete}
onEdit={handleEdit}
onEditError={logEditError}
onPost={buildReplyPost(item.id, FEED_ITEM_TYPE_COMMENT, isDisabled, onReplyCreate)}
onResolve={handleStatusChange('resolved')}
onThreadDelete={() => handleDelete(item.id)}
onUnresolve={handleStatusChange('open')}
resolvedAt={item.resolvedAt}
resolvedBy={item.resolvedBy}
userSelectorProps={userSelectorProps}
/>
<div key={item.id} className={threadRowClassName}>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we have need any tests for these changes to make sure nothing breaks adding a non-semantic div around the activity item?

<ActivityFeed.List.ThreadedAnnotation
annotationTarget={commentAnnotationTarget}
isAnnotations={false}
isEditDisabled={isDisabled || item.isResolved}
isResolved={item.isResolved}
messages={item.messages}
onAnnotationBadgeClick={handleBadgeClick}
onAvatarClick={noop}
onCopyLink={onCommentCopyLink ? (id: string) => onCommentCopyLink({ id }) : undefined}
onDelete={handleDelete}
onEdit={handleEdit}
onEditError={logEditError}
onPost={buildReplyPost(item.id, FEED_ITEM_TYPE_COMMENT, isDisabled, onReplyCreate)}
onResolve={handleStatusChange('resolved')}
onThreadDelete={() => handleDelete(item.id)}
onUnresolve={handleStatusChange('open')}
resolvedAt={item.resolvedAt}
resolvedBy={item.resolvedBy}
userSelectorProps={userSelectorProps}
/>
</div>
);
}

Expand Down Expand Up @@ -209,31 +217,32 @@ const FeedItemRow = ({
}
: badgeTarget;
return (
<ActivityFeed.List.ThreadedAnnotation
key={item.id}
annotationTarget={annotationBadgeTarget}
isAnnotations={false}
isEditDisabled={isDisabled || item.isResolved}
isResolved={item.isResolved}
messages={item.messages}
onAnnotationBadgeClick={() => onAnnotationSelect?.(item.annotation)}
onAvatarClick={noop}
onCopyLink={
onAnnotationCopyLink && fileVersionId
? () => onAnnotationCopyLink({ annotationId: item.id, fileVersionId })
: undefined
}
onDelete={handleDelete}
onEdit={handleEdit}
onEditError={logEditError}
onPost={buildReplyPost(item.id, FEED_ITEM_TYPE_ANNOTATION, isDisabled, onReplyCreate)}
onResolve={handleStatusChange('resolved')}
onThreadDelete={() => handleDelete(item.id)}
onUnresolve={handleStatusChange('open')}
resolvedAt={item.resolvedAt}
resolvedBy={item.resolvedBy}
userSelectorProps={userSelectorProps}
/>
<div key={item.id} className={threadRowClassName}>
<ActivityFeed.List.ThreadedAnnotation
annotationTarget={annotationBadgeTarget}
isAnnotations={false}
isEditDisabled={isDisabled || item.isResolved}
isResolved={item.isResolved}
messages={item.messages}
onAnnotationBadgeClick={() => onAnnotationSelect?.(item.annotation)}
onAvatarClick={noop}
onCopyLink={
onAnnotationCopyLink && fileVersionId
? () => onAnnotationCopyLink({ annotationId: item.id, fileVersionId })
: undefined
}
onDelete={handleDelete}
onEdit={handleEdit}
onEditError={logEditError}
onPost={buildReplyPost(item.id, FEED_ITEM_TYPE_ANNOTATION, isDisabled, onReplyCreate)}
onResolve={handleStatusChange('resolved')}
onThreadDelete={() => handleDelete(item.id)}
onUnresolve={handleStatusChange('open')}
resolvedAt={item.resolvedAt}
resolvedBy={item.resolvedBy}
userSelectorProps={userSelectorProps}
/>
</div>
);
}

Expand Down
Loading