From 46ffb6afa43a5885d5111564a62742612aff1683 Mon Sep 17 00:00:00 2001 From: yangdx Date: Mon, 7 Apr 2025 05:20:12 +0800 Subject: [PATCH] fix: improve form accessibility with proper label associations Added missing htmlFor attributes to labels and corresponding IDs to form elements throughout the web UI to enhance accessibility. This ensures screen readers can correctly identify form controls and improves browser autofill functionality. Changes include: - Fixed label associations in login form - Added proper IDs to form elements in Settings component - Replaced decorative labels with semantic headings in PropertiesView - Added screen reader accessible labels in RetrievalTesting - Improved checkbox accessibility in QuerySettings --- .../src/components/graph/PropertiesView.tsx | 16 +- .../src/components/graph/Settings.tsx | 16 +- .../components/retrieval/QuerySettings.tsx | 216 ++++++++++-------- .../src/features/DocumentManager.tsx | 8 +- .../src/features/RetrievalTesting.tsx | 20 +- 5 files changed, 168 insertions(+), 108 deletions(-) diff --git a/lightrag_webui/src/components/graph/PropertiesView.tsx b/lightrag_webui/src/components/graph/PropertiesView.tsx index 627049ea..3aa248de 100644 --- a/lightrag_webui/src/components/graph/PropertiesView.tsx +++ b/lightrag_webui/src/components/graph/PropertiesView.tsx @@ -184,9 +184,11 @@ const PropertyRow = ({ return translation === translationKey ? name : translation } + // Since Text component uses a label internally, we'll use a span here instead of a label + // to avoid nesting labels which is not recommended for accessibility return (
- : + {getPropertyNameTranslation(name)}: { return (
- +

{t('graphPanel.propertiesView.node.title')}

- +

{t('graphPanel.propertiesView.node.properties')}

{Object.keys(node.properties) .sort() @@ -256,9 +258,9 @@ const NodePropertiesView = ({ node }: { node: NodeType }) => {
{node.relationships.length > 0 && ( <> -