i18n: system-prompt desc, search-filter/model/files labels, hide notif badge for users
- System prompt description ('Remove the base system prompt...') wrapped in BOTH
places: AgentEditorPage (create) and AgentViewerModal (summary).
- Search filter (ActionsPopover/SwitchList): Enable All / Disable All now use the
existing chat.actions keys (added useTranslation hook).
- Model selector: 'Search models...' placeholder -> model_selector.search_placeholder.
- File picker: 'Recent Files' / 'All Recent Files' -> files.* keys.
- Notification BADGE on the sidebar account button now also gated by
canSeeNotifications — non-admins see no bell, no panel, and no count badge; admins
keep the full unfiltered notification centre.
Patch 66 files, applies clean to v4.5.2; apply green; missing-hook + duplicate-hook
scans CLEAN. Build verification next.
This commit is contained in:
parent
6ea23b97e7
commit
0050b0a285
3 changed files with 116 additions and 10 deletions
|
|
@ -12253,6 +12253,35 @@ index ec3163e2..e2b8dc10 100644
|
|||
}
|
||||
/>
|
||||
)}
|
||||
diff --git a/web/src/refresh-components/popovers/ActionsPopover/SwitchList.tsx b/web/src/refresh-components/popovers/ActionsPopover/SwitchList.tsx
|
||||
index dbccb093..f22401e2 100644
|
||||
--- a/web/src/refresh-components/popovers/ActionsPopover/SwitchList.tsx
|
||||
+++ b/web/src/refresh-components/popovers/ActionsPopover/SwitchList.tsx
|
||||
@@ -1,6 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import React, { useMemo, useState } from "react";
|
||||
+import { useTranslation } from "react-i18next";
|
||||
import {
|
||||
Button,
|
||||
InputTypeIn,
|
||||
@@ -44,6 +45,7 @@ export default function SwitchList({
|
||||
onBack,
|
||||
footer,
|
||||
}: SwitchListProps) {
|
||||
+ const { t } = useTranslation();
|
||||
const [searchTerm, setSearchTerm] = useState("");
|
||||
const filteredItems = useMemo(() => {
|
||||
if (!searchTerm) return items;
|
||||
@@ -85,7 +87,7 @@ export default function SwitchList({
|
||||
icon={allDisabled ? SvgPlug : SvgUnplug}
|
||||
onClick={allDisabled ? onEnableAll : onDisableAll}
|
||||
>
|
||||
- {allDisabled ? "Enable All" : "Disable All"}
|
||||
+ {allDisabled ? t("chat.actions.enable_all", "Enable All") : t("chat.actions.disable_all", "Disable All")}
|
||||
</LineItem>,
|
||||
|
||||
...filteredItems.map((item) => {
|
||||
diff --git a/web/src/refresh-components/popovers/ActionsPopover/index.tsx b/web/src/refresh-components/popovers/ActionsPopover/index.tsx
|
||||
index fbfec909..b0ecc713 100644
|
||||
--- a/web/src/refresh-components/popovers/ActionsPopover/index.tsx
|
||||
|
|
@ -12523,7 +12552,7 @@ index fbfec909..b0ecc713 100644
|
|||
</div>
|
||||
</Popover.Trigger>
|
||||
diff --git a/web/src/refresh-components/popovers/FilePickerPopover.tsx b/web/src/refresh-components/popovers/FilePickerPopover.tsx
|
||||
index ab8a8b33..2f588d05 100644
|
||||
index ab8a8b33..d56d4728 100644
|
||||
--- a/web/src/refresh-components/popovers/FilePickerPopover.tsx
|
||||
+++ b/web/src/refresh-components/popovers/FilePickerPopover.tsx
|
||||
@@ -1,6 +1,7 @@
|
||||
|
|
@ -12557,6 +12586,24 @@ index ab8a8b33..2f588d05 100644
|
|||
</LineItem>,
|
||||
|
||||
// Separator
|
||||
@@ -137,7 +139,7 @@ function FilePickerPopoverContents({
|
||||
hasFiles && (
|
||||
<div key="recent-files" className="pt-1">
|
||||
<Text as="p" text02 secondaryBody className="py-1 px-3">
|
||||
- Recent Files
|
||||
+ {t("files.recent_files", "Recent Files")}
|
||||
</Text>
|
||||
</div>
|
||||
),
|
||||
@@ -159,7 +161,7 @@ function FilePickerPopoverContents({
|
||||
icon={SvgMoreHorizontal}
|
||||
onClick={openRecentFilesModal}
|
||||
>
|
||||
- All Recent Files
|
||||
+ {t("files.all_recent_files", "All Recent Files")}
|
||||
</LineItem>
|
||||
),
|
||||
]}
|
||||
diff --git a/web/src/sections/agents/AgentsFilters.tsx b/web/src/sections/agents/AgentsFilters.tsx
|
||||
index a508c392..11ab9ea1 100644
|
||||
--- a/web/src/sections/agents/AgentsFilters.tsx
|
||||
|
|
@ -13097,7 +13144,7 @@ index 87a4ee38..93bd54fc 100644
|
|||
</Modal.Footer>
|
||||
</Form>
|
||||
diff --git a/web/src/sections/modals/AgentViewerModal.tsx b/web/src/sections/modals/AgentViewerModal.tsx
|
||||
index cab609ce..a073b0b0 100644
|
||||
index cab609ce..e8c8c994 100644
|
||||
--- a/web/src/sections/modals/AgentViewerModal.tsx
|
||||
+++ b/web/src/sections/modals/AgentViewerModal.tsx
|
||||
@@ -1,5 +1,7 @@
|
||||
|
|
@ -13174,15 +13221,17 @@ index cab609ce..a073b0b0 100644
|
|||
description={agent.system_prompt}
|
||||
sizePreset="main-ui"
|
||||
variant="section"
|
||||
@@ -366,7 +369,7 @@ export default function AgentViewerModal({ agent }: AgentViewerModalProps) {
|
||||
@@ -366,8 +369,8 @@ export default function AgentViewerModal({ agent }: AgentViewerModalProps) {
|
||||
</InputHorizontal>
|
||||
)}
|
||||
<InputHorizontal
|
||||
- title="Overwrite System Prompts"
|
||||
- description='Remove the base system prompt which includes useful instructions (e.g. "You can use Markdown tables"). This may affect response quality.'
|
||||
+ title={t("agent_editor.overwrite_system_prompt", "Overwrite System Prompts")}
|
||||
description='Remove the base system prompt which includes useful instructions (e.g. "You can use Markdown tables"). This may affect response quality.'
|
||||
+ description={t('agent_editor.overwrite_system_prompt_desc', 'Remove the base system prompt which includes useful instructions (e.g. "You can use Markdown tables"). This may affect response quality.')}
|
||||
>
|
||||
<Switch disabled checked={agent.replace_base_system_prompt} />
|
||||
</InputHorizontal>
|
||||
diff --git a/web/src/sections/modals/CreateProjectModal.tsx b/web/src/sections/modals/CreateProjectModal.tsx
|
||||
index 257eafc9..af7fddfc 100644
|
||||
--- a/web/src/sections/modals/CreateProjectModal.tsx
|
||||
|
|
@ -13364,6 +13413,35 @@ index 66a7a6b1..bc7f79d6 100644
|
|||
</Button>
|
||||
)}
|
||||
<Button
|
||||
diff --git a/web/src/sections/model-selector/ModelSelectorContent.tsx b/web/src/sections/model-selector/ModelSelectorContent.tsx
|
||||
index 81b3fda2..63a2d52e 100644
|
||||
--- a/web/src/sections/model-selector/ModelSelectorContent.tsx
|
||||
+++ b/web/src/sections/model-selector/ModelSelectorContent.tsx
|
||||
@@ -1,6 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useMemo, useRef, useEffect } from "react";
|
||||
+import { useTranslation } from "react-i18next";
|
||||
import * as SliderPrimitive from "@radix-ui/react-slider";
|
||||
import {
|
||||
Button,
|
||||
@@ -484,6 +485,7 @@ export default function ModelSelectorContent({
|
||||
includeGlobalDefault = false,
|
||||
modelDetail,
|
||||
}: ModelSelectorContentProps) {
|
||||
+ const { t } = useTranslation();
|
||||
const [detailOption, setDetailOption] = useState<LLMOption | null>(null);
|
||||
const { llmProviders, isLoading, defaultText } =
|
||||
useCurrentAgentLLMProviders();
|
||||
@@ -617,7 +619,7 @@ export default function ModelSelectorContent({
|
||||
variant="internal"
|
||||
value={searchQuery}
|
||||
onChange={(e) => setSearchQuery(e.target.value)}
|
||||
- placeholder="Search models..."
|
||||
+ placeholder={t("model_selector.search_placeholder", "Search models...")}
|
||||
/>
|
||||
|
||||
<PopoverMenu scrollContainerRef={scrollContainerRef}>
|
||||
diff --git a/web/src/sections/model-selector/MultiModelSelector.tsx b/web/src/sections/model-selector/MultiModelSelector.tsx
|
||||
index e287ff79..5912e39a 100644
|
||||
--- a/web/src/sections/model-selector/MultiModelSelector.tsx
|
||||
|
|
@ -13965,7 +14043,7 @@ index b33fcf06..6ec891a0 100644
|
|||
onClick={() => {
|
||||
setTargetMemoryId(null);
|
||||
diff --git a/web/src/sections/sidebar/AccountPopover.tsx b/web/src/sections/sidebar/AccountPopover.tsx
|
||||
index 317781d7..e66ee79a 100644
|
||||
index 317781d7..8bfdcfb9 100644
|
||||
--- a/web/src/sections/sidebar/AccountPopover.tsx
|
||||
+++ b/web/src/sections/sidebar/AccountPopover.tsx
|
||||
@@ -1,6 +1,7 @@
|
||||
|
|
@ -14096,6 +14174,15 @@ index 317781d7..e66ee79a 100644
|
|||
onClick={handleLogout}
|
||||
/>
|
||||
),
|
||||
@@ -231,7 +246,7 @@ export default function AccountPopover({
|
||||
</div>
|
||||
)}
|
||||
rightChildren={
|
||||
- undismissedCount ? (
|
||||
+ canSeeNotifications(user?.role) && undismissedCount ? (
|
||||
<Section padding={0.5}>
|
||||
<SvgNotificationBubble count={undismissedCount} />
|
||||
</Section>
|
||||
@@ -260,7 +275,7 @@ export default function AccountPopover({
|
||||
undismissedCount={undismissedCount}
|
||||
/>
|
||||
|
|
@ -14510,7 +14597,7 @@ index 0a8b2597..24140167 100644
|
|||
)}
|
||||
|
||||
diff --git a/web/src/views/AgentEditorPage.tsx b/web/src/views/AgentEditorPage.tsx
|
||||
index 9325a2e0..7c44e4a0 100644
|
||||
index 9325a2e0..9cf28ad8 100644
|
||||
--- a/web/src/views/AgentEditorPage.tsx
|
||||
+++ b/web/src/views/AgentEditorPage.tsx
|
||||
@@ -1,6 +1,7 @@
|
||||
|
|
@ -14901,15 +14988,18 @@ index 9325a2e0..7c44e4a0 100644
|
|||
>
|
||||
<InputDatePickerField
|
||||
name="knowledge_cutoff_date"
|
||||
@@ -1771,7 +1806,7 @@ export default function AgentEditorPage({
|
||||
@@ -1771,9 +1806,9 @@ export default function AgentEditorPage({
|
||||
</InputHorizontal>
|
||||
<InputHorizontal
|
||||
withLabel="replace_base_system_prompt"
|
||||
- title="Overwrite System Prompt"
|
||||
+ title={t("agent_editor.overwrite_system_prompt", "Overwrite System Prompt")}
|
||||
suffix="(Not Recommended)"
|
||||
description='Remove the base system prompt which includes useful instructions (e.g. "You can use Markdown tables"). This may affect response quality.'
|
||||
- description='Remove the base system prompt which includes useful instructions (e.g. "You can use Markdown tables"). This may affect response quality.'
|
||||
+ description={t('agent_editor.overwrite_system_prompt_desc', 'Remove the base system prompt which includes useful instructions (e.g. "You can use Markdown tables"). This may affect response quality.')}
|
||||
>
|
||||
<SwitchField name="replace_base_system_prompt" />
|
||||
</InputHorizontal>
|
||||
@@ -1783,23 +1818,19 @@ export default function AgentEditorPage({
|
||||
<GeneralLayouts.Section gap={0.25}>
|
||||
<InputVertical
|
||||
|
|
|
|||
|
|
@ -2193,7 +2193,8 @@
|
|||
"starter_example_0": "Gib mir einen Überblick über einige Dokumente.",
|
||||
"starter_example_1": "Finde den neuesten Verkaufsbericht.",
|
||||
"starter_example_2": "Erstelle eine Liste unserer technischen Ziele für dieses Quartal.",
|
||||
"starter_example_3": "Fasse meine Ziele für heute zusammen."
|
||||
"starter_example_3": "Fasse meine Ziele für heute zusammen.",
|
||||
"overwrite_system_prompt_desc": "Entfernt den Basis-System-Prompt mit nützlichen Anweisungen (z. B. „Sie können Markdown-Tabellen verwenden\"). Dies kann die Antwortqualität beeinträchtigen."
|
||||
},
|
||||
"tools": {
|
||||
"internal_search": "Interne Suche",
|
||||
|
|
@ -2209,5 +2210,12 @@
|
|||
"actions_tools": "Aktionen & Werkzeuge",
|
||||
"no_actions": "Keine Aktionen",
|
||||
"more_info": "Weitere Infos"
|
||||
},
|
||||
"files": {
|
||||
"recent_files": "Kürzliche Dateien",
|
||||
"all_recent_files": "Alle kürzlichen Dateien"
|
||||
},
|
||||
"model_selector": {
|
||||
"search_placeholder": "Modelle suchen..."
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2193,7 +2193,8 @@
|
|||
"starter_example_0": "Give me an overview of some documents.",
|
||||
"starter_example_1": "Find the latest sales report.",
|
||||
"starter_example_2": "Compile a list of our engineering goals for this quarter.",
|
||||
"starter_example_3": "Summarize my goals for today."
|
||||
"starter_example_3": "Summarize my goals for today.",
|
||||
"overwrite_system_prompt_desc": "Remove the base system prompt which includes useful instructions (e.g. \"You can use Markdown tables\"). This may affect response quality."
|
||||
},
|
||||
"tools": {
|
||||
"internal_search": "Internal Search",
|
||||
|
|
@ -2209,5 +2210,12 @@
|
|||
"actions_tools": "Actions & Tools",
|
||||
"no_actions": "No Actions",
|
||||
"more_info": "More Info"
|
||||
},
|
||||
"files": {
|
||||
"recent_files": "Recent Files",
|
||||
"all_recent_files": "All Recent Files"
|
||||
},
|
||||
"model_selector": {
|
||||
"search_placeholder": "Search models..."
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue