Skip to content

Commit

Permalink
No recommendation when launching from single env
Browse files Browse the repository at this point in the history
Signed-off-by: Wei-Chun, Chang <[email protected]>
  • Loading branch information
wcchang1115 committed Jan 14, 2025
1 parent 1274f57 commit de75179
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 7 additions & 2 deletions js/src/components/lineage/PresetCheckRecommendation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,20 @@ import { select, SelectInput } from "@/lib/api/select";
import { useLineageGraphContext } from "@/lib/hooks/LineageGraphContext";
import { submitRunFromCheck } from "@/lib/api/runs";
import { useRecceActionContext } from "@/lib/hooks/RecceActionContext";
import { sessionStorageKeys } from "@/lib/api/sessionStorageKeys";
import { useRecceServerFlag } from "@/lib/hooks/useRecceServerFlag";

export const PresetCheckRecommendation = () => {
const { lineageGraph } = useLineageGraphContext();
const { showRunId } = useRecceActionContext();
const { data: flags } = useRecceServerFlag();
const queryClient = useQueryClient();
const [recommendCheckId, setRecommendCheckId] = useState<string>("");
const [recommendCheckParam, setRecommendCheckParam] = useState<SelectInput>();
const [showRecommendation, setShowRecommendation] = useState<boolean>(false);
const [affectedModels, setAffectedModels] = useState<string>();
const { isOpen, onOpen, onClose } = useDisclosure();
const recommendationKey = "recommendationClosed";
const recommendationKey = sessionStorageKeys.recommendationIgnored;

const { data: checks, status } = useQuery({
queryKey: cacheKeys.checks(),
Expand Down Expand Up @@ -131,7 +134,7 @@ export const PresetCheckRecommendation = () => {
}

const ignored = sessionStorage.getItem(recommendationKey);
if (!ignored) {
if (!ignored && !flags?.single_env_onboarding) {
setShowRecommendation(true);
}
}, [
Expand All @@ -141,6 +144,8 @@ export const PresetCheckRecommendation = () => {
selectedModels,
numNodes,
lineageGraph,
recommendationKey,
flags,
]);

const performPresetCheck = useCallback(async () => {
Expand Down
5 changes: 5 additions & 0 deletions js/src/lib/api/sessionStorageKeys.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const prefix = "recce";

export const sessionStorageKeys = {
recommendationIgnored: `${prefix}-recommendation-ignored`,
};

0 comments on commit de75179

Please sign in to comment.