style: fix stale comment, merge split tile-meta CSS block, clarify test variable
This commit is contained in:
@@ -463,7 +463,7 @@ function buildTileHTML(session, index, mobile) {
|
||||
const escapedName = escapeHtml(name);
|
||||
const timeStr = formatTimestamp(session.last_activity_at || null);
|
||||
|
||||
// Device badge — right-aligned in header, separate from name span
|
||||
// Device badge — shown inside tile-meta, before timestamp with · separator
|
||||
// Shown when multiple sources configured AND session has a device name
|
||||
let badgeHtml = '';
|
||||
if (_serverSettings && _serverSettings.multi_device_enabled && session.deviceName && ds.showDeviceBadges !== false) {
|
||||
|
||||
@@ -225,17 +225,13 @@ body {
|
||||
color: var(--text-muted);
|
||||
white-space: nowrap;
|
||||
margin-left: 8px;
|
||||
transition: opacity 150ms ease; /* × crossfade with badge + timestamp on hover */
|
||||
}
|
||||
|
||||
.tile-meta-sep {
|
||||
margin: 0 2px;
|
||||
}
|
||||
|
||||
/* × crossfade with badge + timestamp on hover */
|
||||
.tile-meta {
|
||||
transition: opacity 150ms ease;
|
||||
}
|
||||
|
||||
.session-tile:hover .tile-meta,
|
||||
.session-tile:focus-within .tile-meta {
|
||||
opacity: 0;
|
||||
|
||||
@@ -2522,6 +2522,9 @@ test('buildTileHTML places device-badge inside tile-meta span', () => {
|
||||
const session = { name: 'work', deviceName: 'Laptop', sessionKey: '::work', snapshot: '' };
|
||||
const html = app.buildTileHTML(session, 0, false);
|
||||
const tileMetaStart = html.indexOf('<span class="tile-meta">');
|
||||
// Note: finds the first </span> after tileMetaStart, which is device-badge's closing tag
|
||||
// (not tile-meta's own close), but the assertion still holds because device-badge
|
||||
// opens and closes before tile-time within the tile-meta container.
|
||||
const tileMetaEnd = html.indexOf('</span>', tileMetaStart);
|
||||
assert.ok(tileMetaStart !== -1, 'tile-meta span should exist');
|
||||
const deviceBadgePos = html.indexOf('device-badge');
|
||||
|
||||
Reference in New Issue
Block a user