Skip to content

Commit d154800

Browse files
Merge pull request #200 from microsoft/PSL-BUG-13797
fix: Retain Chat Session When Switching from Chat to Document Tab
2 parents ff247d9 + 7aae309 commit d154800

File tree

5 files changed

+13
-12
lines changed

5 files changed

+13
-12
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
name: Deploy Resources
2-
1+
name: Validate Deployment
32
on:
43
push:
54
branches:
65
- main # Adjust this to the branch you want to trigger the deployment on
76
- dev
87
- demo
98
schedule:
10-
- cron: '0 6,18 * * *' # Runs at 6:00 AM and 6:00 PM GMT
9+
- cron: '0 10,22 * * *' # Runs at 10:00 AM and 10:00 PM GMT
1110

1211

1312
jobs:

.github/workflows/pr-title-checker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "pr-title-checker"
1+
name: "PR Title Checker"
22

33
on:
44
pull_request_target:

.github/workflows/stale-bot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'Close stale issues and PRs'
1+
name: 'Stale Bot'
22
on:
33
schedule:
44
- cron: '30 1 * * *'

App/frontend-app/src/components/documentViewer/dialogTitleBar.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,20 @@ export function DialogTitleBar({
4545
}: IDialogTitleBarProps) {
4646
const { t } = useTranslation();
4747
const [activeTab, setActiveTab] = useState(selectedTab);
48+
const [isChatTabOpened, setIsChatTabOpened] = useState(false);
4849

4950
useEffect(() => {
5051
setActiveTab(selectedTab);
51-
}, [selectedTab]);
52+
}, [selectedTab,clearChatFlag]);
53+
54+
useEffect(()=>{
55+
if(activeTab == "Chat Room")
56+
setIsChatTabOpened(true)
57+
},[activeTab])
5258

5359
const handleTabSelect = (event: SelectTabEvent, data: SelectTabData) => {
54-
setActiveTab(data.value as string);
5560
onTabSelect(event, data);
5661

57-
if (data.value === "Chat Room") {
58-
setClearChatFlag(false);
59-
}
6062
};
6163

6264
return (
@@ -152,7 +154,7 @@ export function DialogTitleBar({
152154
searchResultDocuments={[]}
153155
selectedDocuments={[metadata]}
154156
chatWithDocument={[metadata]}
155-
clearChatFlag={clearChatFlag}
157+
clearChatFlag={isChatTabOpened ? !isChatTabOpened : clearChatFlag}
156158
/>
157159
</div>
158160
</div>

App/frontend-app/src/components/documentViewer/documentViewer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export function DocDialog(
7474
const [pageMetadata, setPageMetadata] = useState<Document[] | null>(null);
7575
const [iframeKey, setIframeKey] = useState(0);
7676
const [isExpanded, setIsExpanded] = useState(false);
77-
const [clearedChatFlag, setClearChatFlag] = useState(false);
77+
const [clearedChatFlag, setClearChatFlag] = useState(clearChatFlag);
7878
// const [aiKnowledgeMetadata, setAIKnowledgeMetadata] = useState<Document | null>(null);
7979

8080

0 commit comments

Comments
 (0)