Skip to content
Merged
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
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions docs/steam-class-mapping.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand Down
5 changes: 4 additions & 1 deletion frontend/chat-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
}
10 changes: 5 additions & 5 deletions frontend/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
32 changes: 16 additions & 16 deletions frontend/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -41,15 +41,15 @@ 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;
right: 8px;
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;
Expand All @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}