@@ -704,25 +704,13 @@ struct ChatPanelInputArea: View {
704
704
}
705
705
}
706
706
707
- private var shouldEnableCCR : Bool {
708
- guard let quotaInfo = status. quotaInfo else { return false }
709
-
710
- if quotaInfo. isFreeUser { return false }
711
-
712
- if !isCCRFFEnabled { return false }
713
-
714
- return true
707
+ private var isFreeUser : Bool {
708
+ guard let quotaInfo = status. quotaInfo else { return true }
709
+
710
+ return quotaInfo. isFreeUser
715
711
}
716
712
717
713
private var ccrDisabledTooltip : String {
718
- guard let quotaInfo = status. quotaInfo else {
719
- return " GitHub Copilot Code Review is not available. "
720
- }
721
-
722
- if quotaInfo. isFreeUser {
723
- return " GitHub Copilot Code Review requires a paid subscription. "
724
- }
725
-
726
714
if !isCCRFFEnabled {
727
715
return " GitHub Copilot Code Review is disabled by org policy. Contact your admin. "
728
716
}
@@ -737,11 +725,9 @@ struct ChatPanelInputArea: View {
737
725
738
726
private var codeReviewButton : some View {
739
727
Group {
740
- if !shouldEnableCCR {
741
- codeReviewIcon
742
- . foregroundColor ( Color ( nsColor: . tertiaryLabelColor) )
743
- . help ( ccrDisabledTooltip)
744
- } else {
728
+ if isFreeUser {
729
+ // Show nothing
730
+ } else if isCCRFFEnabled {
745
731
ZStack {
746
732
stopButton
747
733
. opacity ( isRequestingCodeReview ? 1 : 0 )
@@ -766,6 +752,10 @@ struct ChatPanelInputArea: View {
766
752
. help ( " Code Review " )
767
753
}
768
754
. buttonStyle ( HoverButtonStyle ( padding: 0 ) )
755
+ } else {
756
+ codeReviewIcon
757
+ . foregroundColor ( Color ( nsColor: . tertiaryLabelColor) )
758
+ . help ( ccrDisabledTooltip)
769
759
}
770
760
}
771
761
}
0 commit comments