feat(threads): thread panel header says who started it and when (#165)
CI / Build & Quality Checks (push) Successful in 1m33s
CI / Docker image build & smoke test (push) Skipped
CI / Secret scan (gitleaks) (push) Successful in 8s
CI / Trigger Desktop Build (push) Successful in 4s
CI / Playwright smoke (e2e) (push) Failing after 10m28s
CI / Build & Quality Checks (push) Successful in 1m33s
CI / Docker image build & smoke test (push) Skipped
CI / Secret scan (gitleaks) (push) Successful in 8s
CI / Trigger Desktop Build (push) Successful in 4s
CI / Playwright smoke (e2e) (push) Failing after 10m28s
The subtitle was only the room name. It now reads e.g. "Thread Lab · started by alice, Fri 09:18 PM" (the user's clock/date preferences via the #139 formatter), which is what you want to know when arriving from the Threads list. Verified in the 360 px desktop panel: fits without clipping. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
c088b4c0e6
commit
64af736c6e
@@ -28,6 +28,8 @@ import {
|
||||
ThreadNotificationModeSwitcher,
|
||||
} from '../../../components/ThreadNotificationModeSwitcher';
|
||||
import { useThreadNotificationMode } from '../../../hooks/useThreadNotifications';
|
||||
import { useTimestampFormatter } from '../../../hooks/useTimestampFormatter';
|
||||
import { getMemberName } from '../../../utils/room';
|
||||
import { ThreadNotificationMode } from '../../../utils/threadNotifications';
|
||||
|
||||
type ThreadPanelHeaderProps = {
|
||||
@@ -37,6 +39,12 @@ type ThreadPanelHeaderProps = {
|
||||
};
|
||||
function ThreadPanelHeader({ room, threadId, requestClose }: ThreadPanelHeaderProps) {
|
||||
const mode = useThreadNotificationMode(room.roomId, threadId);
|
||||
const { format } = useTimestampFormatter();
|
||||
// [Gitea #165] Who started the thread and when — the first thing you want
|
||||
// when arriving from the Threads list.
|
||||
const root = room.findEventById(threadId) ?? room.getThread(threadId)?.rootEvent;
|
||||
const rootSender = root?.getSender();
|
||||
const startedBy = rootSender ? getMemberName(room, rootSender) : undefined;
|
||||
|
||||
return (
|
||||
<Header className={css.ThreadPanelHeader} variant="Background" size="600">
|
||||
@@ -47,6 +55,7 @@ function ThreadPanelHeader({ room, threadId, requestClose }: ThreadPanelHeaderPr
|
||||
</Text>
|
||||
<Text size="T200" truncate style={{ opacity: 0.65 }}>
|
||||
{room.name}
|
||||
{startedBy && root && ` · started by ${startedBy}, ${format(root.getTs())}`}
|
||||
</Text>
|
||||
</Box>
|
||||
<Box shrink="No" alignItems="Center" gap="100">
|
||||
|
||||
Reference in New Issue
Block a user