This is an automated email from the ASF dual-hosted git repository.

marat pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-karavan.git

commit cabd7e6dbe1254ee2c0390a7a94be4264c322d8b
Author: Marat Gubaidullin <[email protected]>
AuthorDate: Fri Feb 27 18:49:49 2026 -0500

    Front-end Project for 4.18.0
---
 .../features/project/files/FilesToolbar.tsx        | 23 +---------------------
 .../karavan/features/project/files/SourcesTab.tsx  | 11 +++--------
 2 files changed, 4 insertions(+), 30 deletions(-)

diff --git 
a/karavan-app/src/main/webui/src/karavan/features/project/files/FilesToolbar.tsx
 
b/karavan-app/src/main/webui/src/karavan/features/project/files/FilesToolbar.tsx
index 683eb4d0..8232e330 100644
--- 
a/karavan-app/src/main/webui/src/karavan/features/project/files/FilesToolbar.tsx
+++ 
b/karavan-app/src/main/webui/src/karavan/features/project/files/FilesToolbar.tsx
@@ -18,7 +18,6 @@ import React, {useEffect, useState} from 'react';
 import {
     Alert,
     Button,
-    capitalize,
     ClipboardCopy,
     Content,
     Form,
@@ -31,8 +30,6 @@ import {
     ModalHeader,
     ModalVariant,
     TextInput,
-    ToggleGroup,
-    ToggleGroupItem,
     Tooltip,
     TooltipPosition
 } from '@patternfly/react-core';
@@ -59,7 +56,7 @@ export function FilesToolbar() {
     const [commitMessage, setCommitMessage] = useState('');
     const isDev = config.environment === 'dev';
     const timeAgo = new TimeAgo('en-US');
-    const [diff, selectedFileNames, selector, setSelector] = useFilesStore((s) 
=> [s.diff, s.selectedFileNames, s.selector, s.setSelector], shallow);
+    const [diff, selectedFileNames] = useFilesStore((s) => [s.diff, 
s.selectedFileNames], shallow);
 
     const projectCommited = projectsCommited?.find(p => project.projectId);
 
@@ -171,23 +168,6 @@ export function FilesToolbar() {
         )
     }
 
-    const toggle =
-        <ToggleGroup aria-label="Source Toggle">
-            {['files', 'commits'].map(value => {
-                return (
-                    <ToggleGroupItem
-                        text={capitalize(value)}
-                        key={value}
-                        buttonId={value}
-                        isSelected={selector === value}
-                        onChange={(_, selected) => {
-                            if (selected) setSelector(value as 'files' | 
'commits');
-                        }}
-                    />
-                )
-            })}
-        </ToggleGroup>
-
 
     function onRefresh() {
             ProjectService.refreshProjectFiles(project.projectId);
@@ -199,7 +179,6 @@ export function FilesToolbar() {
     return (
         <div className="project-files-toolbar">
             <ProjectTitle/>
-            {toggle}
             <Button icon={<RefreshIcon/>}
                     variant={"link"}
                     onClick={() => onRefresh()}
diff --git 
a/karavan-app/src/main/webui/src/karavan/features/project/files/SourcesTab.tsx 
b/karavan-app/src/main/webui/src/karavan/features/project/files/SourcesTab.tsx
index a332e8ae..2b47a496 100644
--- 
a/karavan-app/src/main/webui/src/karavan/features/project/files/SourcesTab.tsx
+++ 
b/karavan-app/src/main/webui/src/karavan/features/project/files/SourcesTab.tsx
@@ -1,4 +1,4 @@
-import React, {useEffect} from 'react';
+import React from 'react';
 import {ProjectFile} from "@models/ProjectModels";
 import {FilesToolbar} from "@features/project/files/FilesToolbar";
 import {FilesSubTab} from "@features/project/files/FilesSubTab";
@@ -15,14 +15,9 @@ interface SourcesTabProps {
 
 export function SourcesTab(props: SourcesTabProps) {
 
-    const [selector, setSelector, showSideBar] = useFilesStore((s) => 
[s.selector, s.setSelector, s.showSideBar], shallow);
-
-    useEffect(() => {
-        return () => setSelector('files');
-    }, []);
+    const [showSideBar] = useFilesStore((s) => [s.showSideBar], shallow);
 
     return (
-
         <Drawer isExpanded={showSideBar !== null} position="end" onExpand={_ 
=> {
         }}>
             <DrawerContent panelContent={<SourcesDrawerPanel/>}>
@@ -30,7 +25,7 @@ export function SourcesTab(props: SourcesTabProps) {
                     <ErrorBoundaryWrapper onError={error => 
console.error(error)}>
                         <div style={{display: 'flex', flexDirection: 'column', 
height: '100%'}}>
                             <FilesToolbar/>
-                            {selector === 'files' && <FilesSubTab 
sortFiles={props.sortFiles}/>}
+                            <FilesSubTab sortFiles={props.sortFiles}/>
                         </div>
                     </ErrorBoundaryWrapper>
                 </DrawerContentBody>

Reply via email to