Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(quick-start): Prevent 'complete' tasks from being displayed outside of the completed tasks list #80172

Merged
merged 6 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions static/app/components/onboardingWizard/newSidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function groupTasksByCompletion(tasks: OnboardingTask[]) {
};
}

interface TaskProps extends Pick<OnboardingTaskStatus, 'status'> {
interface TaskProps extends Partial<Pick<OnboardingTaskStatus, 'status'>> {
hidePanel: () => void;
task: OnboardingTask;
completed?: boolean;
Expand Down Expand Up @@ -304,7 +304,7 @@ function TaskGroup({
task={task}
hidePanel={hidePanel}
showWaitingIndicator={taskKeyForWaitingIndicator === task.task}
status={task.status}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when we pass the status here, if it’s 'complete' but not yet 'seen,' the task is displayed with the style of a complete task but does not appear in the completed list. To fix this issue, it’s better to omit the status in this context

Copy link
Member

@vgrozdanic vgrozdanic Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we instead fix the check in the group by completed/non completed tasks in groupTasksByCompletion?

function groupTasksByCompletion(tasks: OnboardingTask[]) {

We check there if the task is seen and completed.

status={task.status === 'pending' ? task.status : undefined}
/>
))}
{completedTasks.length > 0 && (
Expand Down
9 changes: 4 additions & 5 deletions static/app/components/sidebar/newOnboardingStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,11 @@ export function NewOnboardingStatus({
});

const label = walkthrough ? t('Guided Tours') : t('Onboarding');
const totalRemainingTasks = allTasks.length - doneTasks.length;
const pendingCompletionSeen = doneTasks.length !== completeTasks.length;
const allTasksCompleted = allTasks.length === completeTasks.length;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s better to check for completeTasks instead of doneTasks, as completeTasks are the ones that have already been seen by the user


const skipQuickStart =
!organization.features?.includes('onboarding') ||
(completeTasks.length === allTasks.length && !isActive);
!organization.features?.includes('onboarding') || (allTasksCompleted && !isActive);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this feature flag defined?
I can't find it in our flagpole config

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, i found it, it is only registered in our API


const unseenDoneTasks = useMemo(
() =>
Expand Down Expand Up @@ -111,7 +110,7 @@ export function NewOnboardingStatus({
}, [onShowPanel, isActive, walkthrough, markDoneTaskAsComplete, organization]);

useEffect(() => {
if (totalRemainingTasks !== 0 || skipQuickStart || quickStartCompleted) {
if (!allTasksCompleted || skipQuickStart || quickStartCompleted) {
return;
}

Expand All @@ -123,11 +122,11 @@ export function NewOnboardingStatus({

setQuickStartCompleted(true);
}, [
totalRemainingTasks,
organization,
skipQuickStart,
quickStartCompleted,
setQuickStartCompleted,
allTasksCompleted,
]);

useEffect(() => {
Expand Down
Loading