Skip to content

Commit

Permalink
chore: 2.46.0 release (open-sauced#3750)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickytonline authored Jul 18, 2024
2 parents 467a061 + b0ce0a5 commit e2c0e8e
Show file tree
Hide file tree
Showing 28 changed files with 497 additions and 163 deletions.
43 changes: 43 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,49 @@

> All notable changes to this project will be documented in this file

## [2.46.0-beta.6](https://github.com/open-sauced/app/compare/v2.46.0-beta.5...v2.46.0-beta.6) (2024-07-18)


### 🍕 Features

* added posthog analytics for StarSearch for Workspaces ([#3748](https://github.com/open-sauced/app/issues/3748)) ([72d7c23](https://github.com/open-sauced/app/commit/72d7c2335867b8cafb2ac79189ad312ef2f7569b))

## [2.46.0-beta.5](https://github.com/open-sauced/app/compare/v2.46.0-beta.4...v2.46.0-beta.5) (2024-07-18)


### 🐛 Bug Fixes

* now StarSearch for workspaces only works for editors ([#3733](https://github.com/open-sauced/app/issues/3733)) ([4aeb220](https://github.com/open-sauced/app/commit/4aeb220dec334e37629537b61d5959e5b1cb73f2))

## [2.46.0-beta.4](https://github.com/open-sauced/app/compare/v2.46.0-beta.3...v2.46.0-beta.4) (2024-07-18)


### 🍕 Features

* Tracking Repo Pages (YOLO Chart) ([#3736](https://github.com/open-sauced/app/issues/3736)) ([5edfe8a](https://github.com/open-sauced/app/commit/5edfe8ac5cbefd04ca36e0fbbda85bdc330c5f1d))

## [2.46.0-beta.3](https://github.com/open-sauced/app/compare/v2.46.0-beta.2...v2.46.0-beta.3) (2024-07-18)


### 🍕 Features

* Tracking Repo Pages (Miscellaneous) ([#3739](https://github.com/open-sauced/app/issues/3739)) ([5530beb](https://github.com/open-sauced/app/commit/5530beb1868d925c67a9390e8b924289d36d6e58))

## [2.46.0-beta.2](https://github.com/open-sauced/app/compare/v2.46.0-beta.1...v2.46.0-beta.2) (2024-07-17)


### 🍕 Features

* removed StarSearch feature flagging ([#3730](https://github.com/open-sauced/app/issues/3730)) ([701a95a](https://github.com/open-sauced/app/commit/701a95a3294c81ef878b4ed6dee6db380bdf9c47))
* Tracking Repo Pages (Lottery Factor Chart) ([#3734](https://github.com/open-sauced/app/issues/3734)) ([be5c72e](https://github.com/open-sauced/app/commit/be5c72e203c9406128fe30b90d355584e5de1354))

## [2.46.0-beta.1](https://github.com/open-sauced/app/compare/v2.45.0...v2.46.0-beta.1) (2024-07-17)


### 🍕 Features

* Track Repo Pages (Header) ([#3728](https://github.com/open-sauced/app/issues/3728)) ([2dede76](https://github.com/open-sauced/app/commit/2dede76509a7a489c63829e644a8c9cb219be36a))

## [2.45.0](https://github.com/open-sauced/app/compare/v2.44.0...v2.45.0) (2024-07-16)


Expand Down
27 changes: 24 additions & 3 deletions components/Graphs/ForksChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,19 @@ type ForksChartProps = {
syncId: number;
range: DayRange;
isLoading: boolean;
onCategoryClick?: (category: string) => void;
className?: string;
};

export default function ForksChart({ stats, total, syncId, range = 30, isLoading, className }: ForksChartProps) {
export default function ForksChart({
stats,
total,
syncId,
range = 30,
isLoading,
onCategoryClick,
className,
}: ForksChartProps) {
const [category, setCategory] = useState<"daily" | "history">("daily");
const dailyData = useMemo(() => getDailyForksHistogramToDays({ stats, range }), [stats, range]);
const historyData = useMemo(() => getHistoryForksHistogramToDays({ stats, total, range }), [stats, total, range]);
Expand Down Expand Up @@ -108,10 +117,22 @@ export default function ForksChart({ stats, total, syncId, range = 30, isLoading
</aside>
</div>
<div className="flex gap-2 items-center w-fit lg:self-start">
<Button variant={category === "daily" ? "outline" : "default"} onClick={() => setCategory("daily")}>
<Button
variant={category === "daily" ? "outline" : "default"}
onClick={() => {
setCategory("daily");
onCategoryClick && onCategoryClick("daily");
}}
>
Daily
</Button>
<Button variant={category === "history" ? "outline" : "default"} onClick={() => setCategory("history")}>
<Button
variant={category === "history" ? "outline" : "default"}
onClick={() => {
setCategory("history");
onCategoryClick && onCategoryClick("history");
}}
>
History
</Button>
</div>
Expand Down
27 changes: 24 additions & 3 deletions components/Graphs/StarsChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,19 @@ type StarsChartProps = {
syncId: number;
range: DayRange;
isLoading: boolean;
onCategoryClick?: (category: string) => void;
className?: string;
};

export default function StarsChart({ stats, total, syncId, range = 30, isLoading, className }: StarsChartProps) {
export default function StarsChart({
stats,
total,
syncId,
range = 30,
isLoading,
onCategoryClick,
className,
}: StarsChartProps) {
const [category, setCategory] = useState<"daily" | "history">("daily");
const dailyData = useMemo(() => getDailyStarsHistogramToDays({ stats, range }), [stats, range]);
const historyData = useMemo(() => getHistoryStarsHistogramToDays({ stats, total, range }), [stats, total, range]);
Expand Down Expand Up @@ -108,10 +117,22 @@ export default function StarsChart({ stats, total, syncId, range = 30, isLoading
</aside>
</div>
<div className="flex gap-2 items-center lg:self-start">
<Button variant={category === "daily" ? "outline" : "default"} onClick={() => setCategory("daily")}>
<Button
variant={category === "daily" ? "outline" : "default"}
onClick={() => {
setCategory("daily");
onCategoryClick && onCategoryClick("daily");
}}
>
Daily
</Button>
<Button variant={category === "history" ? "outline" : "default"} onClick={() => setCategory("history")}>
<Button
variant={category === "history" ? "outline" : "default"}
onClick={() => {
setCategory("history");
onCategoryClick && onCategoryClick("history");
}}
>
History
</Button>
</div>
Expand Down
6 changes: 6 additions & 0 deletions components/Repositories/AddToWorkspaceDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { MdWorkspaces } from "react-icons/md";
import { useEffect, useState } from "react";
import { useRouter } from "next/router";
import { BsGithub } from "react-icons/bs";
import { usePostHog } from "posthog-js/react";
import Button from "components/shared/Button/button";
import { Drawer } from "components/shared/Drawer";
import { useToast } from "lib/hooks/useToast";
Expand All @@ -13,6 +14,7 @@ import Text from "components/atoms/Typography/text";

export default function AddToWorkspaceDrawer({ repository }: { repository: string }) {
const router = useRouter();
const posthog = usePostHog();
const { toast } = useToast();
const { signIn, user, sessionToken } = useSupabaseAuth();
const [workspaceId, setWorkspaceId] = useState("new");
Expand All @@ -26,6 +28,10 @@ export default function AddToWorkspaceDrawer({ repository }: { repository: strin
}, []);

const addRepositoryToWorkspace = async () => {
posthog.capture(`Repo Pages: added to ${workspaceId === "new" ? "a new" : "existing"} workspace`, {
repository,
workspaceId,
});
if (workspaceId === "new") {
router.push(`/workspaces/new?repos=${JSON.stringify([repository])}`);
return;
Expand Down
6 changes: 6 additions & 0 deletions components/Repositories/AddToWorkspaceModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useEffect, useState } from "react";
import { useRouter } from "next/router";
import { BsGithub } from "react-icons/bs";
import { usePostHog } from "posthog-js/react";
import Card from "components/atoms/Card/card";
import SingleSelect from "components/atoms/Select/single-select";
import { Dialog, DialogContent } from "components/molecules/Dialog/dialog";
Expand All @@ -20,6 +21,7 @@ type AddToWorkspaceModalProps = {
export default function AddToWorkspaceModal({ repository, isOpen, onCloseModal }: AddToWorkspaceModalProps) {
const { toast } = useToast();
const router = useRouter();
const posthog = usePostHog();
const { signIn, user, sessionToken } = useSupabaseAuth();
const [workspaceId, setWorkspaceId] = useState("new");
const { data: workspaces, isLoading: workspacesLoading, mutate } = useWorkspaces({ load: !!user, limit: 100 });
Expand All @@ -32,6 +34,10 @@ export default function AddToWorkspaceModal({ repository, isOpen, onCloseModal }
}, []);

const addRepositoryToWorkspace = async () => {
posthog.capture(`Repo Pages: added to ${workspaceId === "new" ? "a new" : "existing"} workspace`, {
repository,
workspaceId,
});
if (workspaceId === "new") {
router.push(`/workspaces/new?repos=${JSON.stringify([repository])}`);
return;
Expand Down
3 changes: 3 additions & 0 deletions components/Repositories/ContributorConfidenceChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ type ContributorConfidenceChartProps = {
contributorConfidence: number | undefined;
isLoading: boolean;
isError: boolean;
onLearnMoreClick?: () => void;
className?: string;
};

export default function ContributorConfidenceChart({
contributorConfidence,
isLoading,
isError,
onLearnMoreClick,
className,
}: ContributorConfidenceChartProps) {
const percentage = Math.floor((contributorConfidence ?? 0) * 100);
Expand Down Expand Up @@ -58,6 +60,7 @@ export default function ContributorConfidenceChart({
</div>
<a
href="https://opensauced.pizza/docs/features/repo-pages/#insights-into-contributor-confidence"
onClick={onLearnMoreClick}
className="text-xs font-semibold text-sauced-orange xl:text-sm hover:underline"
>
Learn More
Expand Down
14 changes: 9 additions & 5 deletions components/Repositories/LotteryFactorChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ type LotteryFactorChartProps = {
isLoading: boolean;
error: Error | undefined;
range: DayRange;
showHoverCards?: boolean;
uniqueYoloCoders?: Set<string>;
yoloBannerOnClick?: () => void;
showHoverCards?: boolean;
onProfileClick?: () => void;
onYoloIconClick?: () => void;
className?: string;
};

Expand All @@ -33,9 +35,11 @@ export default function LotteryFactorChart({
isLoading,
error,
range,
showHoverCards,
uniqueYoloCoders = new Set<string>(),
yoloBannerOnClick,
showHoverCards,
onProfileClick,
onYoloIconClick,
className,
}: LotteryFactorChartProps) {
const [hovered, setHovered] = useState<string | undefined>(undefined);
Expand Down Expand Up @@ -245,7 +249,7 @@ export default function LotteryFactorChart({
<div className="flex items-center gap-2 text-light-slate-11">
{showHoverCards ? (
<HoverCard.Root>
<Link href={`/u/${name}`} className="rounded-full">
<Link href={`/u/${name}`} className="rounded-full" onClick={onProfileClick}>
<HoverCard.Trigger>
<Avatar
size={24}
Expand All @@ -263,7 +267,7 @@ export default function LotteryFactorChart({
</HoverCard.Portal>
</HoverCard.Root>
) : (
<Link href={`/u/${name}`} className="rounded-full">
<Link href={`/u/${name}`} className="rounded-full" onClick={onProfileClick}>
<Avatar
size={24}
className="xl:w-9 xl:h-9"
Expand All @@ -276,7 +280,7 @@ export default function LotteryFactorChart({
<div className="flex gap-1 items-center">
<h1 className="truncate text-light-slate-12">{name}</h1>
{uniqueYoloCoders.has(name) && (
<button onClick={yoloBannerOnClick}>
<button onClick={onYoloIconClick}>
<InfoTooltip icon={<FaRegHandPeace />} information="YOLO Coder" />
</button>
)}
Expand Down
18 changes: 14 additions & 4 deletions components/Repositories/RossChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ type RossChartProps = {
isLoading: boolean;
error: Error | undefined;
range: number;
onFilterClick?: (category: string, value: boolean) => void;
className?: string;
};

export default function RossChart({ stats, isLoading, error, range, className }: RossChartProps) {
export default function RossChart({ stats, isLoading, error, range, onFilterClick, className }: RossChartProps) {
const [filterOutside, setFilterOutside] = useState(true);
const [filterRecurring, setFilterRecurring] = useState(true);
const [filterInternal, setFilterInternal] = useState(true);
Expand Down Expand Up @@ -148,7 +149,10 @@ export default function RossChart({ stats, isLoading, error, range, className }:

<fieldset className="flex flex-row gap-4 w-fit text-sm mx-auto p-0">
<button
onClick={() => setFilterOutside(!filterOutside)}
onClick={() => {
setFilterOutside(!filterOutside);
onFilterClick && onFilterClick("outside", filterOutside);
}}
className={`flex gap-2 h-full items-center text-slate-700 ${
!filterOutside && "opacity-60"
} transition-all duration-300 hover:bg-slate-100 rounded-lg px-2 py-1`}
Expand All @@ -158,7 +162,10 @@ export default function RossChart({ stats, isLoading, error, range, className }:
</button>

<button
onClick={() => setFilterRecurring(!filterRecurring)}
onClick={() => {
setFilterRecurring(!filterRecurring);
onFilterClick && onFilterClick("recurring", filterRecurring);
}}
className={`flex gap-2 h-full items-center text-slate-700 ${
!filterRecurring && "opacity-60"
} transition-all duration-300 hover:bg-slate-100 rounded-lg px-2 py-1`}
Expand All @@ -168,7 +175,10 @@ export default function RossChart({ stats, isLoading, error, range, className }:
</button>

<button
onClick={() => setFilterInternal(!filterInternal)}
onClick={() => {
setFilterInternal(!filterInternal);
onFilterClick && onFilterClick("internal", filterInternal);
}}
className={`flex gap-2 h-full items-center text-slate-700 ${
!filterInternal && "opacity-60"
} transition-all duration-300 hover:bg-slate-100 rounded-lg px-2 py-1`}
Expand Down
19 changes: 15 additions & 4 deletions components/Repositories/YoloChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ type YoloChartProps = {
yoloHideBots: boolean;
setYoloHideBots: (yoloHideBots: boolean) => void;
backButtonOnClick?: () => void;
onShaClick?: () => void;
onProfileClick?: () => void;
onHideBotsToggle?: (checked: boolean) => void;
showHoverCards?: boolean;
className?: string;
};
Expand All @@ -32,6 +35,9 @@ export default function YoloChart({
yoloHideBots,
setYoloHideBots,
backButtonOnClick,
onShaClick,
onProfileClick,
onHideBotsToggle,
showHoverCards,
className,
}: YoloChartProps) {
Expand All @@ -57,7 +63,10 @@ export default function YoloChart({
name="Hide Bots"
size="sm"
checked={yoloHideBots}
handleToggle={() => setYoloHideBots(!yoloHideBots)}
handleToggle={() => {
setYoloHideBots(!yoloHideBots);
onHideBotsToggle && onHideBotsToggle(yoloHideBots);
}}
ariaLabel="YOLO Coders Hide Bots Toggle"
/>
</aside>
Expand Down Expand Up @@ -117,7 +126,7 @@ export default function YoloChart({
<div className="flex items-center gap-2 text-light-slate-11">
{showHoverCards ? (
<HoverCard.Root>
<Link href={`/u/${actor_login}`} className="rounded-full">
<Link href={`/u/${actor_login}`} className="rounded-full" onClick={onProfileClick}>
<HoverCard.Trigger>
<Avatar
size={24}
Expand All @@ -135,7 +144,7 @@ export default function YoloChart({
</HoverCard.Portal>
</HoverCard.Root>
) : (
<Link href={`/u/${actor_login}`} className="rounded-full">
<Link href={`/u/${actor_login}`} className="rounded-full" onClick={onProfileClick}>
<Avatar
size={24}
className="xl:w-9 xl:h-9"
Expand All @@ -151,7 +160,9 @@ export default function YoloChart({
</div>
</td>
<td className="text-end w-fit underline">
<a href={`https://github.com/${repository}/commit/${sha}`}>{sha.substring(0, 7)}</a>
<a href={`https://github.com/${repository}/commit/${sha}`} onClick={onShaClick}>
{sha.substring(0, 7)}
</a>
</td>
<td className="text-end pt-1 pb-2 pr-2">
{push_num_commits} commit{push_num_commits > 1 && "s"}
Expand Down
2 changes: 1 addition & 1 deletion components/StarSearch/ChatAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ type Author = "You" | "StarSearch" | "Guest";

interface ChatAvatarProps {
author: Author;
userId?: number;
userId?: number | null;
}

export function ChatAvatar({ author, userId }: ChatAvatarProps) {
Expand Down
Loading

0 comments on commit e2c0e8e

Please sign in to comment.