11import { Hash , Users , GitPullRequest , Home , CheckSquare , Settings , ChevronDown , ChevronRight , GitBranch , Code2 , Database , BookOpen , Maximize2 , Minimize2 , UserPlus , Plus , Pencil , Trash2 , Check , X , type LucideIcon } from "lucide-react" ;
22import { ChatPanel } from "../components/ChatPanel" ;
33import { PRReviewPanel } from "../components/PRReviewPanel" ;
4+ import { IssuePanel } from "../components/IssuePanel" ;
45import { ThreadPanel } from "../components/ThreadPanel" ;
56import { ChannelPanel } from "../components/ChannelPanel" ;
67import { CoffeeLogo } from "../components/CoffeeLogo" ;
@@ -362,6 +363,7 @@ export function ChatPage() {
362363 const [ selectedChannel , setSelectedChannel ] = useState < string > ( 'general' ) ;
363364 const [ messages , setMessages ] = useState < Record < string , any [ ] > > ( initialMessages ) ;
364365 const [ selectedPR , setSelectedPR ] = useState < any > ( null ) ;
366+ const [ selectedIssue , setSelectedIssue ] = useState < any > ( null ) ;
365367 const [ selectedThread , setSelectedThread ] = useState < any > ( null ) ;
366368 const [ threadReplies , setThreadReplies ] = useState < Record < number , any [ ] > > ( initialThreadReplies ) ;
367369 const [ isMainExpanded , setIsMainExpanded ] = useState ( false ) ;
@@ -376,7 +378,7 @@ export function ChatPage() {
376378
377379 const currentMessages = messages [ selectedChannel ] || [ ] ;
378380 const isRepository = [ 'pull-requests' , 'ai-review' ] . includes ( selectedChannel ) ;
379- const gridTemplateColumns = selectedPR
381+ const gridTemplateColumns = selectedPR || selectedIssue
380382 ? 'minmax(0, 1fr)'
381383 : isMainExpanded
382384 ? selectedThread
@@ -671,6 +673,7 @@ export function ChatPage() {
671673 const handleReviewPR = ( prData : any ) => {
672674 setIsMainExpanded ( true ) ;
673675 setSelectedPR ( prData ) ;
676+ setSelectedIssue ( null ) ;
674677 setSelectedThread ( null ) ;
675678 } ;
676679
@@ -680,9 +683,23 @@ export function ChatPage() {
680683 setIsMainExpanded ( false ) ;
681684 } ;
682685
686+ const handleViewIssue = ( issueData : any ) => {
687+ setIsMainExpanded ( true ) ;
688+ setSelectedIssue ( issueData ) ;
689+ setSelectedPR ( null ) ;
690+ setSelectedThread ( null ) ;
691+ } ;
692+
693+ const handleCloseIssue = ( ) => {
694+ setSelectedIssue ( null ) ;
695+ setSelectedThread ( null ) ;
696+ setIsMainExpanded ( false ) ;
697+ } ;
698+
683699 const handleOpenThread = ( message : any ) => {
684700 setSelectedThread ( message ) ;
685- setSelectedPR ( null ) ; // 스레드 열 때 PR 리뷰 닫기
701+ setSelectedPR ( null ) ; // 스레드 열 때 PR 리뷰 닫기
702+ setSelectedIssue ( null ) ; // 스레드 열 때 이슈 패널 닫기
686703 } ;
687704
688705 const handleCloseThread = ( ) => {
@@ -728,7 +745,7 @@ export function ChatPage() {
728745 < div className = { chatGridClassName } style = { {
729746 gridTemplateColumns
730747 } } >
731- { ! selectedPR && (
748+ { ! selectedPR && ! selectedIssue && (
732749 < section className = "min-h-0 overflow-y-auto px-6 py-6 rounded-[30px] flex flex-col" style = { {
733750 background : 'rgba(11, 22, 40, 0.82)' ,
734751 border : '1px solid rgba(32, 227, 255, 0.16)' ,
@@ -1121,7 +1138,7 @@ export function ChatPage() {
11211138 </ section >
11221139 ) }
11231140
1124- { ! selectedPR && (
1141+ { ! selectedPR && ! selectedIssue && (
11251142 < section className = "relative h-full min-h-0 rounded-[30px] overflow-hidden" style = { {
11261143 background : 'rgba(11, 22, 40, 0.82)' ,
11271144 border : '1px solid rgba(32, 227, 255, 0.16)' ,
@@ -1183,6 +1200,7 @@ export function ChatPage() {
11831200 showAISummary = { false }
11841201 onMergePR = { handleMergePR }
11851202 onReviewPR = { handleReviewPR }
1203+ onViewIssue = { handleViewIssue }
11861204 onOpenThread = { handleOpenThread }
11871205 isRepository = { isRepository }
11881206 />
@@ -1200,7 +1218,16 @@ export function ChatPage() {
12001218 </ section >
12011219 ) }
12021220
1203- { selectedThread && ! selectedPR && (
1221+ { selectedIssue && (
1222+ < section className = "h-full min-h-0 rounded-[30px] overflow-hidden" >
1223+ < IssuePanel
1224+ issueData = { selectedIssue }
1225+ onClose = { handleCloseIssue }
1226+ />
1227+ </ section >
1228+ ) }
1229+
1230+ { selectedThread && ! selectedPR && ! selectedIssue && (
12041231 < section className = "min-h-0 rounded-[30px] overflow-hidden" >
12051232 < ThreadPanel
12061233 originalMessage = { selectedThread }
0 commit comments