Skip to content

Commit cb844af

Browse files
Add role=search on container; mark list as role=list; harden clearConversations empty state
- Use role=search for the search container for better semantics - Mark chat list as role=list while retaining native button items for activation - Make Clear conversations resilient to empty list after reset Build and lint pass.
1 parent a66551e commit cb844af

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/pages/IndependentPanel/App.jsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,14 @@ function App() {
106106
}
107107

108108
const clearConversations = async () => {
109-
const sessions = await resetSessions()
110-
setSessions(sessions)
111-
await setSessionIdSafe(sessions[0].sessionId)
109+
const next = await resetSessions()
110+
setSessions(next)
111+
if (next && next.length > 0) {
112+
await setSessionIdSafe(next[0].sessionId)
113+
} else {
114+
setSessionId(null)
115+
setCurrentSession(null)
116+
}
112117
}
113118

114119
const handleSearchChange = (e) => {
@@ -217,7 +222,7 @@ function App() {
217222
{t('Export')}
218223
</button>
219224
</div>
220-
<div className="search-container">
225+
<div className="search-container" role="search">
221226
<input
222227
type="search"
223228
placeholder={t('Search conversations...')}
@@ -234,7 +239,7 @@ function App() {
234239
/>
235240
</div>
236241
<hr />
237-
<div className="chat-list" id="chat-list">
242+
<div className="chat-list" id="chat-list" role="list">
238243
{filteredSessions.length === 0 && (
239244
<div className="no-results" role="status" aria-live="polite">
240245
{t('No conversations found')}

0 commit comments

Comments
 (0)