+
+
{t(
'重置为AI分类将清除自定义分类设置,系统会根据AI标签自动推断分类。如果AI标签变化,分类可能会随之改变。',
@@ -937,9 +940,9 @@ export const RepositoryEditModal: React.FC = ({
)}
{editIntent.category === 'reset-to-original' && (
-
-
-
+
+
+
{t(
'重置为默认分类将清除自定义分类设置,系统会根据仓库信息(名称、描述、语言等)自动匹配分类。',
@@ -950,11 +953,11 @@ export const RepositoryEditModal: React.FC = ({
)}
- {/* Clear Category Warning */}
+ {/* Clear Category Warning - Enhanced */}
{editIntent.category === 'clear' && (
-
-
-
+
+
+
{t(
'清除分类后,仓库将不再有明确的分类归属。系统会尝试根据AI标签自动匹配分类,如果没有匹配到则可能显示在默认分类中。',
@@ -965,8 +968,8 @@ export const RepositoryEditModal: React.FC = ({
)}
- {/* Category Lock */}
-
+ {/* Category Lock - Enhanced */}
+
{formData.categoryLocked && formData.category ? (
@@ -1097,38 +1100,38 @@ export const RepositoryEditModal: React.FC = ({
- {/* Status Alert */}
+ {/* Status Alert - Enhanced */}
{formData.tags.length === 0 && (
-
-
+
+
{editIntent.tags === 'clear' ? (
<>
- ⚠️
+ ⚠️
{t('标签已清空。保存后将不显示任何标签。', 'Tags cleared. No tags will be shown after saving.')}
>
) : editIntent.tags === 'reset-to-ai' ? (
<>
- ✓
+ ✓
{t('将显示AI标签。', 'AI tags will be shown.')}
>
) : editIntent.tags === 'reset-to-original' ? (
<>
- ✓
+ ✓
{t('将显示GitHub Topics。', 'GitHub Topics will be shown.')}
>
) : repository?.ai_tags && repository.ai_tags.length > 0 ? (
<>
- ⚠️
+ ⚠️
{t('当前无自定义标签。保存后将显示AI标签。', 'No custom tags. AI tags will be shown after saving.')}
>
) : repository?.topics && repository.topics.length > 0 ? (
<>
- ⚠️
+ ⚠️
{t('当前无自定义标签。保存后将显示GitHub Topics。', 'No custom tags. GitHub Topics will be shown after saving.')}
>
) : (
<>
- ⚠️
+ ⚠️
{t('无可用标签。', 'No tags available.')}
>
)}
@@ -1160,17 +1163,17 @@ export const RepositoryEditModal: React.FC = ({
- {/* Action Buttons */}
-
+ {/* Action Buttons - Enhanced */}
+
{
e.stopPropagation();
handleCloseWithConfirm();
}}
- className="flex items-center space-x-2 px-4 py-2 text-gray-900 dark:text-text-primary bg-light-surface dark:bg-white/[0.04] rounded-lg hover:bg-gray-200 dark:hover:bg-white/10 dark:border dark:border-white/[0.04] transition-colors"
+ className="flex items-center space-x-2 px-4 py-2.5 text-gray-700 dark:text-text-primary bg-white dark:bg-white/[0.04] rounded-xl hover:bg-gray-100 dark:hover:bg-white/10 border border-gray-200 dark:border-white/[0.04] transition-all duration-200 shadow-sm"
>
- {t('取消', 'Cancel')}
+ {t('取消', 'Cancel')}
{
@@ -1178,7 +1181,7 @@ export const RepositoryEditModal: React.FC = ({
void handleSave();
}}
disabled={!hasChanges}
- className="flex items-center space-x-2 px-4 py-2 bg-brand-indigo text-white rounded-lg hover:bg-brand-hover disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
+ className="flex items-center space-x-2 px-5 py-2.5 bg-brand-indigo text-white rounded-xl hover:bg-brand-hover disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 shadow-sm font-medium"
>
{t('保存', 'Save')}
diff --git a/src/components/SearchBar.tsx b/src/components/SearchBar.tsx
index 4711065d..21985539 100644
--- a/src/components/SearchBar.tsx
+++ b/src/components/SearchBar.tsx
@@ -50,7 +50,7 @@ const SortByDropdown: React.FC = ({ value, onChange, t }) =
{isOpen && (
-
+
{sortOptions.map((option) => (
{
return (
{/* Search Input */}
-
+
{
-
-
{t('关于AI搜索', 'About AI Search')}
-
- {activeAIConfig
- ? t(
- '已配置AI服务时,将调用AI进行语义搜索和智能重排序。未配置时使用本地算法根据仓库名称、描述、标签等多维度进行匹配和排序。',
- 'When AI service is configured, it will be called for semantic search and intelligent reranking. Otherwise, local algorithms are used to match and rank based on repository name, description, tags, and other dimensions.'
- )
- : t(
- '此功能使用本地算法进行智能排序。配置AI服务后可启用语义搜索功能,获得更精准的搜索结果。',
- 'This feature uses local algorithms for intelligent ranking. Configure an AI service to enable semantic search for more accurate results.'
- )}
+
+
+ {t('关于AI搜索', 'About AI Search')}
-
+
+ {activeAIConfig ? t(
+ 'AI语义搜索模式:使用配置的AI服务进行智能语义理解和重排序。AI将分析查询意图,理解上下文关系,并提供语义相关的搜索结果。支持自然语言查询和概念匹配。',
+ 'AI semantic search mode: Uses configured AI service for intelligent semantic understanding and reranking. AI analyzes query intent, understands context, and provides semantically relevant results. Supports natural language queries and concept matching.'
+ ) : t(
+ '回退模式:基础文本搜索与默认排序。当未配置AI服务时,系统将使用基础文本匹配进行搜索(支持名称、描述、标签、语言等字段),并应用标准的排序和过滤控制。此为轻量级搜索方案,无语义理解能力。',
+ 'Fallback mode: Basic text search with default sorting. When no AI service is configured, the system uses basic text matching for search (supports name, description, tags, language, etc.) and applies standard sort and filter controls. This is a lightweight search solution without semantic understanding capabilities.'
+ )}
+
+
@@ -975,7 +975,7 @@ export const SearchBar: React.FC = () => {
{/* Sort Controls */}
-
+
setSearchFilters({ sortBy: value as 'stars' | 'updated' | 'name' | 'starred' })}
diff --git a/src/index.css b/src/index.css
index e6e93b22..72f785bf 100644
--- a/src/index.css
+++ b/src/index.css
@@ -855,3 +855,106 @@
option {
@apply bg-white dark:bg-panel-dark text-gray-900 dark:text-text-primary;
}
+
+/* ========== Enhanced Text Area & Input Styles for Light Mode ========== */
+
+/* Optimized text selection colors for better readability */
+::selection {
+ background-color: rgba(94, 106, 210, 0.2);
+ color: inherit;
+}
+
+.dark ::selection {
+ background-color: rgba(113, 112, 255, 0.3);
+}
+
+/* Enhanced focus states for form elements */
+textarea:focus,
+input:focus,
+select:focus {
+ outline: none;
+ box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.1);
+}
+
+.dark textarea:focus,
+.dark input:focus,
+.dark select:focus {
+ box-shadow: 0 0 0 3px rgba(113, 112, 255, 0.15);
+}
+
+/* Smooth scrolling for text areas */
+textarea {
+ scroll-behavior: smooth;
+ -webkit-overflow-scrolling: touch;
+}
+
+/* Enhanced scrollbar styling for WebKit browsers */
+textarea::-webkit-scrollbar {
+ width: 8px;
+ height: 8px;
+}
+
+textarea::-webkit-scrollbar-track {
+ background: transparent;
+ border-radius: 4px;
+ margin: 4px 0;
+}
+
+textarea::-webkit-scrollbar-thumb {
+ background: rgba(156, 163, 175, 0.4);
+ border-radius: 4px;
+ border: 2px solid transparent;
+ background-clip: padding-box;
+ transition: background-color 0.2s ease;
+}
+
+textarea::-webkit-scrollbar-thumb:hover {
+ background: rgba(156, 163, 175, 0.6);
+}
+
+.dark textarea::-webkit-scrollbar-thumb {
+ background: rgba(75, 85, 99, 0.4);
+}
+
+.dark textarea::-webkit-scrollbar-thumb:hover {
+ background: rgba(75, 85, 99, 0.6);
+}
+
+/* Textarea resize handle styling */
+textarea::-webkit-resizer {
+ background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 1L1 9M9 5L5 9M9 9L9 9' stroke='%239CA3AF' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
+ background-repeat: no-repeat;
+ background-position: right bottom;
+ cursor: se-resize;
+}
+
+.dark textarea::-webkit-resizer {
+ background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M9 1L1 9M9 5L5 9M9 9L9 9' stroke='%234B5563' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
+}
+
+/* Enhanced placeholder styling */
+::placeholder {
+ color: #9ca3af;
+ opacity: 1;
+}
+
+.dark ::placeholder {
+ color: #8a8f98;
+}
+
+/* Responsive text sizing for better readability */
+@media (max-width: 768px) {
+ textarea,
+ input[type="text"] {
+ font-size: 16px; /* Prevent iOS zoom */
+ }
+}
+
+/* Print-friendly styles */
+@media print {
+ textarea,
+ input {
+ border: 1px solid #000;
+ box-shadow: none;
+ }
+}
diff --git a/src/store/useAppStore.ts b/src/store/useAppStore.ts
index 9912a231..e06afd63 100644
--- a/src/store/useAppStore.ts
+++ b/src/store/useAppStore.ts
@@ -145,6 +145,9 @@ interface AppActions {
setLanguage: (language: 'zh' | 'en') => void;
setSidebarCollapsed: (collapsed: boolean) => void;
setReadmeModalOpen: (open: boolean) => void;
+
+ // Hydration state
+ setHasHydrated: (hydrated: boolean) => void;
// Update actions
setUpdateNotification: (notification: UpdateNotification | null) => void;
@@ -643,6 +646,7 @@ export const useAppStore = create()(
collapsedSidebarCategoryCount: 20,
assetFilters: defaultPresetFilters,
theme: 'dark',
+ hasHydrated: false,
currentView: 'repositories',
selectedCategory: 'all',
language: 'zh',
@@ -1150,6 +1154,9 @@ export const useAppStore = create()(
setLanguage: (language) => set({ language }),
setSidebarCollapsed: (isSidebarCollapsed) => set({ isSidebarCollapsed }),
setReadmeModalOpen: (readmeModalOpen) => set({ readmeModalOpen }),
+
+ // Hydration state
+ setHasHydrated: (hasHydrated) => set({ hasHydrated }),
// Update actions
setUpdateNotification: (notification) => set({ updateNotification: notification }),
@@ -1488,6 +1495,14 @@ export const useAppStore = create()(
...normalized,
};
},
+ onRehydrateStorage: (state) => (_rehydratedState, error) => {
+ if (error) {
+ console.error('Store hydration failed', error);
+ } else {
+ console.log('Store hydration complete');
+ }
+ state.setHasHydrated(true);
+ },
}
)
);