diff --git a/README.md b/README.md index 42351d3..6dbb110 100644 --- a/README.md +++ b/README.md @@ -28,8 +28,6 @@ On a typical Windows installation, the final path is: C:\Program Files (x86)\Steam\millennium\plugins\recent-chats ``` -If upgrading from the early proof of concept, remove the old `recent-chats-poc` folder after installing `recent-chats` so Millennium does not load both copies. - ## Privacy and compatibility - Chat metadata stays in Steam's memory; this plugin does not persist message content. diff --git a/docs/steam-class-mapping.md b/docs/steam-class-mapping.md index 9e4f089..dc4aeb3 100644 --- a/docs/steam-class-mapping.md +++ b/docs/steam-class-mapping.md @@ -15,7 +15,7 @@ A native class is kept only when a desktop rule matches the element's real tag, ## Effective injected structure ```text -div#recent-chats-poc-tab-host.friendTab.socialListTab.rcp-tab-button[.activeTab] +div#recent-chats-tab-host.friendTab.socialListTab.rcp-tab-button[.activeTab] span.tabLabel div.rcp-panel.FriendsListContent @@ -51,7 +51,7 @@ The tab's native classes are copied from the live sibling. The diagram shows the | `tabLabel` | `.socialListTab .tabLabel` | Opacity and the label transition. | | `friendTab` | No rule in Valve's stylesheet | Deliberate exception: it is a native markup and Millennium-theme hook. It is copied from the live sibling even though Valve does not style it directly. | -The tab element is itself the host (`#recent-chats-poc-tab-host`) and mounts as a direct sibling of the native tab: a wrapper div changes the flex context, which let themes size the injected tab differently from the native one. Its inline padding is symmetric (`padding-inline`) so the label stays centered under any theme's start padding, and it is explicitly `box-sizing: content-box` to match the native tab — a theme's vertical padding must add to the shared 30px height on both tabs equally. +The tab element is itself the host (`#recent-chats-tab-host`) and mounts as a direct sibling of the native tab: a wrapper div changes the flex context, which let themes size the injected tab differently from the native one. Its inline padding is symmetric (`padding-inline`) so the label stays centered under any theme's start padding, and it is explicitly `box-sizing: content-box` to match the native tab — a theme's vertical padding must add to the shared 30px height on both tabs equally. The label carries `opacity: 1 !important` at ID specificity: single-tab theme designs blank all native tab labels (`.socialListTab .tabLabel { opacity: 0 !important }`) because a lone FRIENDS label is redundant, but the label is the only thing identifying the Chats tab. Every other inherited theme style still applies to it. diff --git a/frontend/chat-actions.ts b/frontend/chat-actions.ts index f0833c3..9f54f53 100644 --- a/frontend/chat-actions.ts +++ b/frontend/chat-actions.ts @@ -52,5 +52,8 @@ export function openConversation( return; } - console.warn(LOG_PREFIX, 'No compatible chat-opening method was found.', conversation); + console.warn(LOG_PREFIX, 'No compatible chat-opening method was found.', { + id: conversation.id, + kind: conversation.kind, + }); } diff --git a/frontend/index.tsx b/frontend/index.tsx index 52855ec..3bb1e66 100644 --- a/frontend/index.tsx +++ b/frontend/index.tsx @@ -21,11 +21,11 @@ import { import { FRIENDS_WINDOW_STYLES, THEMED_FALLBACK_STYLES } from './styles'; const LOG_PREFIX = '[Recent Chats]'; -const TAB_HOST_ID = 'recent-chats-poc-tab-host'; -const PANEL_HOST_ID = 'recent-chats-poc-panel-host'; -const STYLE_ID = 'recent-chats-poc-styles'; -const THEME_FALLBACK_STYLE_ID = 'recent-chats-poc-theme-fallback'; -const OPEN_ATTRIBUTE = 'data-recent-chats-poc-open'; +const TAB_HOST_ID = 'recent-chats-tab-host'; +const PANEL_HOST_ID = 'recent-chats-panel-host'; +const STYLE_ID = 'recent-chats-styles'; +const THEME_FALLBACK_STYLE_ID = 'recent-chats-theme-fallback'; +const OPEN_ATTRIBUTE = 'data-recent-chats-open'; const DOCUMENT_RECONCILE_INTERVAL_MS = 500; const STARTUP_RECONCILE_INTERVAL_MS = 50; const STARTUP_RECONCILE_DURATION_MS = 5_000; diff --git a/frontend/styles.ts b/frontend/styles.ts index ff88d91..208c7f7 100644 --- a/frontend/styles.ts +++ b/frontend/styles.ts @@ -30,7 +30,7 @@ function fontDeclarations(metrics: FontMetrics, important = false): string { } export const FRIENDS_WINDOW_STYLES = ` -#recent-chats-poc-tab-host { +#recent-chats-tab-host { /* Match the native tab when themes add vertical padding. */ box-sizing: content-box; cursor: pointer; @@ -41,7 +41,7 @@ export const FRIENDS_WINDOW_STYLES = ` position: relative; } -#recent-chats-poc-tab-host.rcp-header-fallback { +#recent-chats-tab-host.rcp-header-fallback { bottom: 8px; height: 30px; position: absolute; @@ -49,7 +49,7 @@ export const FRIENDS_WINDOW_STYLES = ` z-index: 20; } -#recent-chats-poc-tab-host:not(.rcp-fallback)::before { +#recent-chats-tab-host:not(.rcp-fallback)::before { background-color: currentColor; content: ''; inset: 0; @@ -60,35 +60,35 @@ export const FRIENDS_WINDOW_STYLES = ` z-index: 0; } -#recent-chats-poc-tab-host:not(.rcp-fallback):not(.activeTab):hover::before, -#recent-chats-poc-tab-host:not(.rcp-fallback):not(.activeTab):focus-visible::before { +#recent-chats-tab-host:not(.rcp-fallback):not(.activeTab):hover::before, +#recent-chats-tab-host:not(.rcp-fallback):not(.activeTab):focus-visible::before { opacity: 0.32; } /* Some single-tab themes hide native labels, but this label identifies Chats. */ -#recent-chats-poc-tab-host .tabLabel { +#recent-chats-tab-host .tabLabel { opacity: 1 !important; position: relative; z-index: 1; } -#recent-chats-poc-panel-host { +#recent-chats-panel-host { display: none; flex: 1 1 auto; min-height: 0; overflow: hidden; } -html[data-recent-chats-poc-open] #recent-chats-poc-panel-host { +html[data-recent-chats-open] #recent-chats-panel-host { display: flex; } -html[data-recent-chats-poc-open] #recent-chats-poc-panel-host ~ .FriendsListContent { +html[data-recent-chats-open] #recent-chats-panel-host ~ .FriendsListContent { display: none !important; } -html[data-recent-chats-poc-open] #recent-chats-poc-panel-host.rcp-content-fallback ~ .friendlistListContainer, -html[data-recent-chats-poc-open] #recent-chats-poc-panel-host.rcp-content-fallback ~ .FriendsListChatSection { +html[data-recent-chats-open] #recent-chats-panel-host.rcp-content-fallback ~ .friendlistListContainer, +html[data-recent-chats-open] #recent-chats-panel-host.rcp-content-fallback ~ .FriendsListChatSection { display: none !important; } @@ -407,7 +407,7 @@ html:not(.rcp-themed) .rcp-toolbar .rcp-search.friendSearchInput { } @media (prefers-reduced-motion: reduce) { - #recent-chats-poc-tab-host:not(.rcp-fallback)::before { + #recent-chats-tab-host:not(.rcp-fallback)::before { transition: none; } @@ -451,7 +451,7 @@ html:not(.rcp-themed) .rcp-toolbar .rcp-search.friendSearchInput { text-align: center; } -#recent-chats-poc-tab-host.rcp-fallback { +#recent-chats-tab-host.rcp-fallback { align-items: center; background: transparent; border: 0; @@ -470,16 +470,16 @@ html:not(.rcp-themed) .rcp-toolbar .rcp-search.friendSearchInput { transition: background-color 233ms ease-in-out, box-shadow 233ms ease-in-out, color 233ms ease-in-out; } -.compactView #recent-chats-poc-tab-host.rcp-fallback { +.compactView #recent-chats-tab-host.rcp-fallback { height: 24px; } -#recent-chats-poc-tab-host.rcp-fallback:hover { +#recent-chats-tab-host.rcp-fallback:hover { background-color: rgba(67, 73, 83, 0.55); color: #b7ccd5; } -#recent-chats-poc-tab-host.rcp-fallback.activeTab { +#recent-chats-tab-host.rcp-fallback.activeTab { background-color: #434953; box-shadow: 0 -2px 3px rgba(0, 0, 0, 0.05), 4px -1px 1px rgba(0, 0, 0, 0.05); color: #b7ccd5; diff --git a/package.json b/package.json index 3dbf58d..7e911b4 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ }, "type": "module", "name": "recent-chats", - "version": "0.4.0", + "version": "0.4.1", "description": "A recent-conversations view for Steam Friends & Chat", "author": "Alex Broaddus", "license": "MIT" diff --git a/plugin.json b/plugin.json index ec8b5cd..7211032 100644 --- a/plugin.json +++ b/plugin.json @@ -3,6 +3,6 @@ "name": "recent-chats", "common_name": "Recent Chats", "description": "Adds a recent-conversations view to Steam's desktop and overlay Friends windows.", - "version": "0.4.0", + "version": "0.4.1", "useBackend": false }