fix: play/pause icon toggle and disappearing conversation controls
Rebuild & Deploy / rebuild (push) Successful in 39s
Rebuild & Deploy / rebuild (push) Successful in 39s
- The play/pause button never swapped icons: app.js set the .hidden property on <svg> elements, which does not reflect to the hidden attribute (that IDL attribute is on HTMLElement, not SVGElement), so the CSS [hidden] rule never applied and both glyphs overlapped. Toggle a .playing class on the button and show/hide the icons via CSS instead. - The Start conversation and mute buttons were pushed off-screen as the transcript grew: the workspace grid had no template-rows, so row 1 auto-sized to the tall transcript and stretched the voice-console beyond the clipped 700px box. Pin the row with grid-template-rows: minmax(0,1fr) and give both grid columns min-height:0 so the transcript (and the inner #messages) scroll instead of expanding the layout.
This commit is contained in:
1 parent
4f8eb00c9f
commit
e2626ba54e
3 files changed
+19
-4
No files matched your search
+1
-2
@@ -1322,8 +1322,7 @@ function updateMediaBadge(s) {
|
|||||||
// ── Playback controls ───────────────────────────────────────────────────────
|
// ── Playback controls ───────────────────────────────────────────────────────
|
||||||
function updateMediaControls() {
|
function updateMediaControls() {
|
||||||
const playing = !mediaAudio.paused && !!mediaCurrentTrackId;
|
const playing = !mediaAudio.paused && !!mediaCurrentTrackId;
|
||||||
playIcon.hidden = playing;
|
playPauseBtn.classList.toggle("playing", playing);
|
||||||
pauseIcon.hidden = !playing;
|
|
||||||
playPauseBtn.setAttribute("aria-label", playing ? "Pause" : "Play");
|
playPauseBtn.setAttribute("aria-label", playing ? "Pause" : "Play");
|
||||||
updateMediaBadge({ pending: [] });
|
updateMediaBadge({ pending: [] });
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -185,8 +185,8 @@
|
|||||||
<svg viewBox="0 0 24 24" width="19" height="19" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M11 17a5 5 0 1 0-5-5"></path><path d="M11 17H6v-5"></path><path d="m19 5-4 4h-3"></path><path d="m15 9 4-4"></path></svg>
|
<svg viewBox="0 0 24 24" width="19" height="19" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M11 17a5 5 0 1 0-5-5"></path><path d="M11 17H6v-5"></path><path d="m19 5-4 4h-3"></path><path d="m15 9 4-4"></path></svg>
|
||||||
</button>
|
</button>
|
||||||
<button id="playPauseBtn" class="btn btn-icon media-play" aria-label="Play or pause" title="Play / pause">
|
<button id="playPauseBtn" class="btn btn-icon media-play" aria-label="Play or pause" title="Play / pause">
|
||||||
<svg id="playIcon" viewBox="0 0 24 24" width="22" height="22" fill="currentColor" aria-hidden="true"><path d="M8 5v14l11-7Z"></path></svg>
|
<svg id="playIcon" class="play-icon" viewBox="0 0 24 24" width="22" height="22" fill="currentColor" aria-hidden="true"><path d="M8 5v14l11-7Z"></path></svg>
|
||||||
<svg id="pauseIcon" viewBox="0 0 24 24" width="22" height="22" fill="currentColor" aria-hidden="true" hidden><path d="M7 5h4v14H7zM13 5h4v14h-4z"></path></svg>
|
<svg id="pauseIcon" class="pause-icon" viewBox="0 0 24 24" width="22" height="22" fill="currentColor" aria-hidden="true"><path d="M7 5h4v14H7zM13 5h4v14h-4z"></path></svg>
|
||||||
</button>
|
</button>
|
||||||
<button id="fwdBtn" class="btn btn-icon" aria-label="Forward 10 seconds" title="Forward 10s">
|
<button id="fwdBtn" class="btn btn-icon" aria-label="Forward 10 seconds" title="Forward 10s">
|
||||||
<svg viewBox="0 0 24 24" width="19" height="19" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13 17a5 5 0 1 1 5-5"></path><path d="M13 17h5v-5"></path><path d="m5 5 4 4h3"></path><path d="m9 9 4-4"></path></svg>
|
<svg viewBox="0 0 24 24" width="19" height="19" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M13 17a5 5 0 1 1 5-5"></path><path d="M13 17h5v-5"></path><path d="m5 5 4 4h3"></path><path d="m9 9 4-4"></path></svg>
|
||||||
|
|||||||
@@ -255,6 +255,7 @@ button {
|
|||||||
.workspace {
|
.workspace {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: minmax(390px, 0.92fr) minmax(420px, 1.08fr);
|
grid-template-columns: minmax(390px, 0.92fr) minmax(420px, 1.08fr);
|
||||||
|
grid-template-rows: minmax(0, 1fr);
|
||||||
height: min(700px, calc(100dvh - 108px));
|
height: min(700px, calc(100dvh - 108px));
|
||||||
min-height: 610px;
|
min-height: 610px;
|
||||||
border: 1px solid var(--line);
|
border: 1px solid var(--line);
|
||||||
@@ -270,6 +271,7 @@ button {
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
min-height: 0;
|
||||||
padding: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 4vw, 3.25rem) 1.6rem;
|
padding: clamp(2rem, 4vw, 3.5rem) clamp(1.5rem, 4vw, 3.25rem) 1.6rem;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
background:
|
background:
|
||||||
@@ -708,6 +710,7 @@ button {
|
|||||||
/* ── Conversation ───────────────────────────────────────────────────────── */
|
/* ── Conversation ───────────────────────────────────────────────────────── */
|
||||||
.transcript {
|
.transcript {
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
|
min-height: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
padding: clamp(1.4rem, 3vw, 2.1rem);
|
padding: clamp(1.4rem, 3vw, 2.1rem);
|
||||||
@@ -1377,6 +1380,19 @@ body[data-mode="text"] .mic-meter {
|
|||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.media-play .play-icon,
|
||||||
|
.media-play .pause-icon {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.media-play:not(.playing) .play-icon {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.media-play.playing .pause-icon {
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
|
||||||
.media-play:hover:not(:disabled) {
|
.media-play:hover:not(:disabled) {
|
||||||
filter: brightness(1.1);
|
filter: brightness(1.1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user