diff --git a/apps/web/res/css/yap/_yap.pcss b/apps/web/res/css/yap/_yap.pcss index 7519da514a..78f7ea7940 100644 --- a/apps/web/res/css/yap/_yap.pcss +++ b/apps/web/res/css/yap/_yap.pcss @@ -8,7 +8,14 @@ * consume the --yap-* tokens defined here. */ @layer yap { - :root { + /* Compound defines its dark tokens on `.cpd-theme-dark.cpd-theme-dark`, and + element-web puts that class on
. Custom properties resolve by nearest + ancestor, so overrides declared only on :root () are shadowed by + Compound's body-level values for everything inside the app (this is how the + send button / unread bar stayed green). Declare on the theme-class elements + too so our values win on and inside nested cpd-theme-* wrappers. */ + :root, + [class*="cpd-theme-"] { /* ---- Typography ---- */ --yap-font-sans: "Hanken Grotesk", "Inter", system-ui, sans-serif; --yap-font-mono: "JetBrains Mono", "Courier New", monospace; @@ -504,6 +511,44 @@ text-transform: uppercase; color: var(--yap-text-faint); } + /* threads nested under their channel (Discord-style) */ + .mx_YapThreadRow { + margin-left: 22px; + padding-block: 3px; + font-size: 13px; + color: var(--yap-text-muted); + } + .mx_YapThreadRow .mx_YapRoomRow_name { + font-weight: 500; + } + .mx_YapThreadRow_glyph { + color: var(--yap-text-faint); + font-size: 13px; + width: 16px; + text-align: center; + flex-shrink: 0; + } + + /* collapsible section headers (Discord-style) */ + .mx_YapRoomList_header_toggle { + display: flex; + align-items: center; + gap: 4px; + cursor: pointer; + user-select: none; + } + .mx_YapRoomList_header_toggle:hover { + color: var(--yap-text-secondary); + } + .mx_YapRoomList_header_chevron { + display: inline-block; + font-size: 9px; + line-height: 1; + transition: transform 0.15s ease; + } + .mx_YapRoomList_header_collapsed .mx_YapRoomList_header_chevron { + transform: rotate(-90deg); + } /* in-call members shown under a voice channel (who's in before you join) */ .mx_YapVoiceMembers { display: flex; @@ -820,6 +865,115 @@ font-variant-numeric: tabular-nums; } + /* Never let the chat pane collapse when the right panel (threads, members…) + is open in a smaller window: below ~340px the message lines shrink so far + that the hover action bar (Edit, React…) positions outside the pane — + invisible and unclickable ("clicking edit does nothing"). The panel + resizer yields to this minimum instead. */ + .mx_MainSplit > .mx_RoomView_body { + min-width: 340px; + } + + /* ============================================================ + Focused thread view — a thread taking over the main pane + (Discord "open as page"), plus the header button that opens it. + ============================================================ */ + .mx_BlapCenteredThread { + display: flex; + flex-direction: column; + min-height: 0; + } + .mx_BlapCenteredThread_back { + display: flex; + align-items: center; + gap: 6px; + padding: 10px 16px; + color: var(--yap-text-secondary); + font-size: 13.5px; + border-bottom: 1px solid var(--yap-hairline); + } + .mx_BlapCenteredThread_back:hover { + color: var(--yap-text-primary); + } + .mx_BlapCenteredThread_back svg { + color: var(--yap-accent); + } + .mx_BlapCenteredThread .mx_ThreadView { + flex: 1 1 0; + min-height: 0; + /* keep long threads readable in the wide pane */ + max-width: 960px; + width: 100%; + margin: 0 auto; + } + /* the back bar owns "leave this view" in centered mode — drop the card's × + and let the timeline breathe a little */ + .mx_BlapCenteredThread .mx_BaseCard_close { + display: none; + } + .mx_BlapCenteredThread .mx_BaseCard_header { + border-bottom: none; + } + + /* the "open as page" button in the thread panel header */ + .mx_BlapThreadCenterButton { + display: flex; + align-items: center; + color: var(--yap-text-muted); + margin-left: auto; + } + .mx_BlapThreadCenterButton:hover { + color: var(--yap-accent); + } + /* the header title already flexes; keep the context menu at the edge */ + .mx_ThreadView .mx_BaseCard_header_title { + display: flex; + align-items: center; + } + + /* ============================================================ + Reply quotes — Blap card (matches the thread chip vocabulary): + soft rounded card + accent edge instead of Element's bare + 2px username-colored border. + ============================================================ */ + .mx_ReplyChain { + background-color: rgba(255, 255, 255, 0.035); + border-left: 3px solid var(--yap-accent); + border-radius: 10px; + padding: 5px 10px; + margin-bottom: 4px; + } + .mx_ReplyChain .mx_ReplyTile > a { + color: var(--yap-text-secondary); + } + .mx_ReplyChain .mx_ReplyChain_show.mx_AccessibleButton_kind_link_inline { + color: var(--yap-text-muted); + font-size: 11.5px; + } + /* the quoted sender name reads as a Blap label, not a rainbow username */ + .mx_ReplyChain .mx_DisambiguatedProfile > span { + color: var(--yap-accent) !important; + font-weight: 600; + } + /* composer reply preview ("Replying to …") gets the same card */ + .mx_ReplyPreview { + background-color: var(--yap-surface-composer); + border: 1px solid rgba(255, 255, 255, 0.05); + border-radius: 13px 13px 0 0; + margin: 0 16px; + } + .mx_ReplyPreview .mx_ReplyPreview_header { + color: var(--yap-text-muted); + } + /* markdown blockquotes match the quote language too */ + .mx_EventTile_content blockquote { + border-left: 3px solid var(--yap-accent); + background-color: rgba(255, 255, 255, 0.03); + border-radius: 0 8px 8px 0; + margin: 4px 0; + padding: 4px 10px; + } + /* ============================================================ Thread summary — chip ============================================================ */ diff --git a/apps/web/src/components/structures/MatrixChat.tsx b/apps/web/src/components/structures/MatrixChat.tsx index 71094c9163..04da58ead0 100644 --- a/apps/web/src/components/structures/MatrixChat.tsx +++ b/apps/web/src/components/structures/MatrixChat.tsx @@ -113,6 +113,7 @@ import { leaveRoomBehaviour } from "../../utils/leave-behaviour"; import { CallStore } from "../../stores/CallStore"; import { type IRoomStateEventsActionPayload } from "../../actions/MatrixActionCreators"; import { type ShowThreadPayload } from "../../dispatcher/payloads/ShowThreadPayload"; +import { getBlapCenteredRoomId } from "../../stores/BlapThreadFocus"; import { RightPanelPhases } from "../../stores/right-panel/RightPanelStorePhases"; import RightPanelStore from "../../stores/right-panel/RightPanelStore"; import { TimelineRenderingType } from "../../contexts/RoomContext"; @@ -945,6 +946,14 @@ export default class MatrixChat extends React.PureComponent