refactor: Consolidate icon imports across components and streamline import statements for improved readability

This commit is contained in:
2026-07-06 03:29:18 +10:00
parent 1f71fd7a51
commit 09db721b7e
221 changed files with 3472 additions and 2128 deletions
+301 -54
View File
@@ -96,6 +96,20 @@ export const ForumLeftColumn = style([
},
]);
/** Feed column inside Cinny space PageNav. */
export const ForumFeedSidebarRoot = style([
DefaultReset,
{
display: 'flex',
flex: '1 1 0',
flexDirection: 'column',
height: '100%',
minHeight: 0,
minWidth: 0,
overflow: 'hidden',
},
]);
export const ForumLeftHeader = style({
flexShrink: 0,
borderBottom: `${config.borderWidth.B300} solid ${color.Background.ContainerLine}`,
@@ -126,6 +140,7 @@ export const ForumListCard = style({
export const ForumDetailPane = style({
display: 'flex',
flex: '1 1 0',
flexDirection: 'column',
minHeight: 0,
minWidth: 0,
@@ -144,18 +159,32 @@ export const ForumTopicTargetFields = style({
/** @deprecated use ForumDetailPane */
export const ForumDetailAside = ForumDetailPane;
export const ForumTopicPostDetail = style({
/** Scroll slot for folds `Scroll` in forum panels (post list + thread detail). */
export const ForumPanelScroll = style({
flex: '1 1 0',
minHeight: 0,
overflowX: 'hidden',
overflowY: 'auto',
overscrollBehavior: 'contain',
minWidth: 0,
});
export const ForumTopicPostDetailScroll = style([
ForumPanelScroll,
{
backgroundColor: color.Surface.Container,
},
]);
export const ForumTopicPostDetailInner = style({
boxSizing: 'border-box',
padding: `0 ${forumDetailPad} ${forumDetailPad}`,
paddingRight: forumDetailPadRight,
backgroundColor: color.Surface.Container,
boxSizing: 'border-box',
});
/** @deprecated use ForumTopicPostDetailScroll + ForumTopicPostDetailInner */
export const ForumTopicPostDetail = style([
ForumTopicPostDetailScroll,
ForumTopicPostDetailInner,
]);
export const ForumTopicPostDetailWithThread = style({});
export const ForumComposerBar = style({
@@ -392,13 +421,7 @@ export const ForumPostCountMeta = style({
minWidth: 0,
});
export const ForumPostScroll = style({
flex: '1 1 0',
minHeight: 0,
overflowX: 'hidden',
overflowY: 'auto',
overscrollBehavior: 'contain',
});
export const ForumPostScroll = style([ForumPanelScroll]);
export const ForumPostList = style({
display: 'grid',
@@ -526,6 +549,148 @@ export const ForumCategoryLabel = style({
textTransform: 'lowercase',
});
const forumThreadRailHitBase = {
background: 'transparent',
border: 0,
bottom: 0,
cursor: 'pointer',
left: 0,
margin: 0,
padding: 0,
position: 'absolute' as const,
top: 0,
width: toRem(20),
zIndex: 10,
};
export const ForumThreadRailHitRoot = style({
...forumThreadRailHitBase,
selectors: {
'&::after': {
...threadLineBefore,
background: threadLineBase,
width: threadLineWidth,
},
'&:hover::after': {
background: threadLineActive,
},
},
});
export const ForumThreadRailHitNested = style({
...forumThreadRailHitBase,
selectors: {
'&::after': {
...threadLineBefore,
background: threadLineChild,
width: threadLineWidth,
},
'&:hover::after': {
background: threadLineActive,
},
},
});
const forumThreadCollapsedRowBase = {
alignItems: 'stretch',
background: 'transparent',
border: 0,
boxSizing: 'border-box' as const,
cursor: 'pointer',
display: 'flex',
gap: threadRailGap,
marginBottom: threadLineGap,
marginTop: threadLineGap,
minWidth: 0,
padding: 0,
textAlign: 'left' as const,
width: '100%',
};
export const ForumThreadCollapsedRowRoot = style([DefaultReset, forumThreadCollapsedRowBase]);
export const ForumThreadCollapsedRowNested = style([
DefaultReset,
forumThreadCollapsedRowBase,
{
marginLeft: threadLevelIndent,
width: `calc(100% - ${threadLevelIndent})`,
},
]);
export const ForumThreadCollapsedRailRoot = style({
alignSelf: 'stretch',
background: threadLineBase,
borderRadius: threadLineRadius,
flexShrink: 0,
minHeight: toRem(40),
transition: 'background 0.15s ease',
width: threadLineWidth,
selectors: {
[`${ForumThreadCollapsedRowRoot}:hover &`]: {
background: threadLineActive,
},
},
});
export const ForumThreadCollapsedRailNested = style({
alignSelf: 'stretch',
background: threadLineChild,
borderRadius: threadLineRadius,
flexShrink: 0,
minHeight: toRem(40),
transition: 'background 0.15s ease',
width: threadLineWidth,
selectors: {
[`${ForumThreadCollapsedRowNested}:hover &`]: {
background: threadLineActive,
},
},
});
export const ForumThreadCollapsedMiniPost = style({
background: color.Background.Container,
border: `${config.borderWidth.B300} solid ${threadLineBase}`,
borderRadius: toRem(6),
boxSizing: 'border-box',
display: 'flex',
flex: 1,
flexDirection: 'column',
gap: toRem(6),
justifyContent: 'center',
minHeight: toRem(40),
minWidth: 0,
padding: `${toRem(9)} ${toRem(11)}`,
transition: 'background 0.15s ease, border-color 0.15s ease',
selectors: {
[`${ForumThreadCollapsedRowRoot}:hover &, ${ForumThreadCollapsedRowNested}:hover &`]: {
background: color.Surface.ContainerHover,
borderColor: color.Primary.Main,
},
},
});
export const ForumThreadCollapsedMoreLabel = style({
color: muted,
fontSize: toRem(13),
fontWeight: 600,
lineHeight: 1.3,
selectors: {
[`${ForumThreadCollapsedRowRoot}:hover &, ${ForumThreadCollapsedRowNested}:hover &`]: {
color: color.Primary.Main,
},
},
});
export const ForumThreadCollapsible = style({
selectors: {
'&::before': {
opacity: 0,
pointerEvents: 'none',
},
},
});
export const ForumReplyMeta = style({
alignItems: 'center',
display: 'inline-flex',
@@ -574,11 +739,38 @@ export const ForumEmptyDetail = style({
export const ForumTopicDetailRoot = style({
display: 'flex',
flex: '1 1 0',
flexDirection: 'column',
minHeight: 0,
minWidth: 0,
width: '100%',
});
export const ForumTopicDetailBodyScroll = style([
ForumPanelScroll,
{
flex: '1 1 0',
minHeight: 0,
},
]);
export const ForumTopicDetailBody = style({
boxSizing: 'border-box',
padding: `0 ${forumDetailPad} ${forumDetailPad}`,
paddingRight: forumDetailPadRight,
});
export const ForumTopicPostDetailThreadLayout = style([
ForumPanelScroll,
{
backgroundColor: color.Surface.Container,
boxSizing: 'border-box',
display: 'flex',
flexDirection: 'column',
minHeight: 0,
},
]);
export const ForumTopicDetailHead = style({
alignItems: 'flex-start',
background: color.Surface.Container,
@@ -610,7 +802,16 @@ export const ForumTopicDetailOp = style({
marginRight: 0,
maxWidth: '100%',
minWidth: 0,
paddingBottom: toRem(36),
paddingBottom: toRem(12),
position: 'relative',
});
export const ForumThreadFooterComposer = style({
backgroundColor: color.Surface.Container,
borderTop: `${config.borderWidth.B300} solid ${color.Surface.ContainerLine}`,
boxSizing: 'border-box',
flexShrink: 0,
padding: `${toRem(12)} ${forumDetailPadRight} ${toRem(8)} ${forumDetailPad}`,
position: 'relative',
});
@@ -630,6 +831,11 @@ export const ForumMessageBodyRich = style({
wordBreak: 'break-word',
});
export const ForumEventContentRoot = style({
minWidth: 0,
width: '100%',
});
globalStyle(`${ForumMessageBodyRich} p`, {
margin: '0 0 0.65em',
});
@@ -645,11 +851,35 @@ globalStyle(`${ForumMessageBodyRich} blockquote`, {
color: muted,
});
const forumNativeScroll = `${ForumTopicPostDetailInner} pre, ${ForumMessageBodyRich} pre`;
globalStyle(`${ForumMessageBodyRich} pre`, {
background: color.SurfaceVariant.Container,
borderRadius: config.radii.R300,
overflow: 'auto',
padding: config.space.S300,
scrollbarWidth: 'thin',
scrollbarColor: `${color.Surface.ContainerLine} transparent`,
});
globalStyle(`${forumNativeScroll}::-webkit-scrollbar`, {
height: toRem(6),
width: toRem(6),
});
globalStyle(`${forumNativeScroll}::-webkit-scrollbar-track`, {
background: 'transparent',
});
globalStyle(`${forumNativeScroll}::-webkit-scrollbar-thumb`, {
backgroundColor: color.Surface.ContainerLine,
border: '2px solid transparent',
backgroundClip: 'padding-box',
borderRadius: config.radii.Pill,
});
globalStyle(`${forumNativeScroll}::-webkit-scrollbar-thumb:hover`, {
backgroundColor: color.SurfaceVariant.ContainerLine,
});
globalStyle(`${ForumMessageBodyRich} code`, {
@@ -672,28 +902,29 @@ globalStyle(`${ForumMessageBodyRich} img`, {
borderRadius: config.radii.R300,
});
export const ForumReplyActionsFooter = style({
bottom: toRem(6),
display: 'flex',
justifyContent: 'flex-end',
margin: 0,
pointerEvents: 'none',
position: 'absolute',
right: toRem(10),
zIndex: 2,
maxWidth: `calc(100% - ${toRem(12)})`,
});
export const ForumMessageOptionsBase = style([
DefaultReset,
{
position: 'absolute',
top: toRem(6),
right: toRem(6),
zIndex: 3,
// Extend hitbox for easier hover targeting (matches room messages).
paddingLeft: toRem(80),
marginLeft: toRem(-80),
pointerEvents: 'none',
},
]);
export const ForumMessageActions = style({
alignItems: 'center',
display: 'flex',
flexShrink: 0,
gap: toRem(3),
marginLeft: 'auto',
opacity: 0,
pointerEvents: 'none',
transition: 'opacity 0.16s ease',
});
export const ForumMessageOptionsBar = style([
DefaultReset,
{
padding: config.space.S100,
opacity: 0,
pointerEvents: 'none',
transition: 'opacity 0.12s ease',
},
]);
export const ForumMessageActionBtn = style({
alignItems: 'center',
@@ -751,6 +982,10 @@ export const ForumFeedReplyForm = style({
marginTop: 0,
});
export const ForumThreadReplyTarget = style({
borderLeft: `3px solid ${color.Primary.Main}`,
});
export const ForumReplyToDeleted = style({
borderLeft: `4px solid ${color.SurfaceVariant.ContainerLine}`,
color: muted,
@@ -1044,33 +1279,45 @@ globalStyle(`${ForumPostModalEditorWrap} .${editorCss.EditorTextarea}`, {
minHeight: toRem(180),
});
globalStyle(`${ForumThreadReplyInner}:hover ${ForumReplyActionsFooter} ${ForumMessageActions}`, {
opacity: 1,
pointerEvents: 'auto',
});
const forumMessageOptionsVisible = `${ForumMessageOptionsBase}:hover ${ForumMessageOptionsBar}, ${ForumMessageOptionsBase}:focus-within ${ForumMessageOptionsBar}`;
globalStyle(`${ForumThreadReplyInner}:focus-within ${ForumReplyActionsFooter} ${ForumMessageActions}`, {
opacity: 1,
pointerEvents: 'auto',
});
globalStyle(
`${ForumThreadReplyInner}:hover ${ForumMessageOptionsBase}, ${ForumThreadReplyInner}:focus-within ${ForumMessageOptionsBase}`,
{
pointerEvents: 'auto',
}
);
globalStyle(`${ForumThreadReplyInner}:has(${ForumMessageActionPanels}) ${ForumReplyActionsFooter}`, {
globalStyle(
`${ForumThreadReplyInner}:hover ${ForumMessageOptionsBar}, ${ForumThreadReplyInner}:focus-within ${ForumMessageOptionsBar}, ${forumMessageOptionsVisible}`,
{
opacity: 1,
pointerEvents: 'auto',
}
);
globalStyle(`${ForumThreadReplyInner}:has(${ForumMessageActionPanels}) ${ForumMessageOptionsBase}`, {
display: 'none',
});
globalStyle(`${ForumTopicDetailOp}:has(${ForumMessageActionPanels}) ${ForumReplyActionsFooter}`, {
globalStyle(`${ForumTopicDetailOp}:has(${ForumMessageActionPanels}) ${ForumMessageOptionsBase}`, {
display: 'none',
});
globalStyle(`${ForumTopicDetailOp}:hover ${ForumReplyActionsFooter} ${ForumMessageActions}`, {
opacity: 1,
pointerEvents: 'auto',
});
globalStyle(
`${ForumTopicDetailOp}:hover ${ForumMessageOptionsBase}, ${ForumTopicDetailOp}:focus-within ${ForumMessageOptionsBase}`,
{
pointerEvents: 'auto',
}
);
globalStyle(`${ForumTopicDetailOp}:focus-within ${ForumReplyActionsFooter} ${ForumMessageActions}`, {
opacity: 1,
pointerEvents: 'auto',
});
globalStyle(
`${ForumTopicDetailOp}:hover ${ForumMessageOptionsBar}, ${ForumTopicDetailOp}:focus-within ${ForumMessageOptionsBar}, ${ForumTopicDetailOp} ${forumMessageOptionsVisible}`,
{
opacity: 1,
pointerEvents: 'auto',
}
);
globalStyle(
`${ForumThread}:has(> ${ForumThreadReply} > ${ForumThreadReplyInner}:hover)::before, ${ForumThread}:has(> ${ForumThreadReply} > ${ForumThreadReplyInner}:focus-within)::before`,
@@ -1110,7 +1357,7 @@ globalStyle(`${ForumTopicDetailOp} ${ForumMessageBody}, ${ForumTopicDetailOp} ${
// Legacy aliases
export const ForumApp = ForumTopicLiveApp;
export const ForumDetailScroll = ForumTopicPostDetail;
export const ForumDetailScroll = ForumTopicPostDetailScroll;
export const ForumDetailComposerBar = ForumComposerBar;
export const ForumChrome = style({ display: 'none' });
export const ForumBrand = style({ display: 'none' });