Skip to content
Draft
Show file tree
Hide file tree
Changes from all 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
857 changes: 327 additions & 530 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions apps/amethyst/.eslintrc.js

This file was deleted.

46 changes: 31 additions & 15 deletions apps/amethyst/app/(tabs)/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,32 @@ export default function HomeScreen() {

useEffect(() => {
let mounted = true;
Promise.all([getLatestPlays(30), getSocialFeed(30, undefined, viewerDid)])
.then(([playRes, postRes]) => {
if (!mounted) return;
setPlays(playRes.plays);
setPlayCursor(playRes.cursor);
setSocialPosts(postRes.items);
setPostCursor(postRes.cursor);
})
.catch((e) => {
if (mounted) {
setError(e instanceof Error ? e.message : String(e));
setPlays([]);
}
});
Promise.allSettled([
getLatestPlays(30),
getSocialFeed(30, undefined, viewerDid),
]).then(([playResult, postResult]) => {
if (!mounted) return;

const errors: string[] = [];
if (playResult.status === "fulfilled") {
setPlays(playResult.value.plays);
setPlayCursor(playResult.value.cursor);
} else {
setPlays([]);
errors.push(
`Could not load listens: ${errorMessage(playResult.reason)}`,
);
}

if (postResult.status === "fulfilled") {
setSocialPosts(postResult.value.items);
setPostCursor(postResult.value.cursor);
} else {
errors.push(`Could not load posts: ${errorMessage(postResult.reason)}`);
}

setError(errors.length > 0 ? errors.join(" ") : null);
});
return () => {
mounted = false;
};
Expand Down Expand Up @@ -197,7 +209,7 @@ export default function HomeScreen() {
{error && (
<View className="mb-6 rounded-lg border border-destructive/30 bg-destructive/10 p-4">
<Text className="font-bold text-destructive">
Could not load the Teal play feed: {error}
{error}
</Text>
</View>
)}
Expand Down Expand Up @@ -239,3 +251,7 @@ export default function HomeScreen() {
</TealShell>
);
}

function errorMessage(error: unknown) {
return error instanceof Error ? error.message : String(error);
}
10 changes: 5 additions & 5 deletions apps/amethyst/app/_layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import { GlobalTextClassContext } from "../components/ui/text";

import "../global.css";

import { View } from "react-native";
import { SafeAreaView } from "react-native-safe-area-context";
import { BottomSheetModalProvider } from "@gorhom/bottom-sheet";

Expand Down Expand Up @@ -95,10 +94,11 @@ export default function RootLayout() {
function useTheme() {
const { colorScheme, setColorScheme } = useColorScheme();

// what??? how does this not break something
setColorScheme(colorScheme || "system");

console.log("Current scheme is", colorScheme);
useEffect(() => {
if (!colorScheme) {
setColorScheme("system");
}
}, [colorScheme, setColorScheme]);

return colorScheme === "dark" ? DARK_THEME : LIGHT_THEME;
}
Expand Down
2 changes: 2 additions & 0 deletions apps/amethyst/app/onboarding/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ export default function OnboardingPage() {
setSubmissionStep(4);

let record: ProfileRecord = {
$type: "fm.teal.alpha.actor.profile",
displayName: updatedProfile.displayName,
description: updatedProfile.description,
avatar: newAvatarBlob,
Expand Down Expand Up @@ -181,6 +182,7 @@ export default function OnboardingPage() {

// Update profile status to mark onboarding as completed
const profileStatusRecord: ProfileStatusRecord = {
$type: "fm.teal.alpha.actor.profileStatus",
completedOnboarding: "profileOnboarding",
createdAt: new Date().toISOString(),
updatedAt: new Date().toISOString(),
Expand Down
16 changes: 8 additions & 8 deletions apps/amethyst/components/__tests__/StyledText-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@ import { render, screen } from "@testing-library/react-native";
import { Text } from "../ui/text";

describe("Text Component", () => {
it("displays text content to users", () => {
render(<Text>Hello World</Text>);
it("displays text content to users", async () => {
await render(<Text>Hello World</Text>);
expect(screen.getByText("Hello World")).toBeTruthy();
});

it("renders with custom className", () => {
render(<Text className="text-lg font-bold">Styled text</Text>);
it("renders with custom className", async () => {
await render(<Text className="text-lg font-bold">Styled text</Text>);
const element = screen.getByText("Styled text");
expect(element).toBeTruthy();
expect(element.props.className).toContain("text-lg");
expect(element.props.className).toContain("font-bold");
});

it("renders empty text component", () => {
const { root } = render(<Text />);
it("renders empty text component", async () => {
const { root } = await render(<Text />);
expect(root).toBeTruthy();
});

it("renders multiple children correctly", () => {
render(
it("renders multiple children correctly", async () => {
await render(
<Text>
First part <Text>nested</Text> last part
</Text>,
Expand Down
1 change: 1 addition & 0 deletions apps/amethyst/components/actor/actorView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ export default function ActorView({ actorDid, pdsAgent }: ActorViewProps) {
}

let record: ProfileRecord = {
$type: "fm.teal.alpha.actor.profile",
displayName: updatedProfile.displayName,
description: updatedProfile.description,
avatar: newAvatarBlob,
Expand Down
1 change: 1 addition & 0 deletions apps/amethyst/components/teal/EditProfileModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ export default function EditProfileModal({
);
const record: ProfileRecord = {
...currentRecord,
$type: "fm.teal.alpha.actor.profile",
displayName: displayName.trim(),
description: description.trim(),
descriptionFacets: richText.facets,
Expand Down
22 changes: 12 additions & 10 deletions apps/amethyst/components/teal/RightRail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@ export default function RightRail() {

useEffect(() => {
let mounted = true;
Promise.all([getTopArtists(4), getTopReleases(6)])
.then(([artistRes, releaseRes]) => {
Promise.allSettled([getTopArtists(4), getTopReleases(6)]).then(
([artistResult, releaseResult]) => {
if (!mounted) return;
setArtists(artistRes.artists);
setReleases(releaseRes.releases);
})
.catch(() => {
if (!mounted) return;
setArtists([]);
setReleases([]);
});
setArtists(
artistResult.status === "fulfilled" ? artistResult.value.artists : [],
);
setReleases(
releaseResult.status === "fulfilled"
? releaseResult.value.releases
: [],
);
},
);
return () => {
mounted = false;
};
Expand Down
4 changes: 3 additions & 1 deletion apps/amethyst/components/teal/TealShell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@ function LeftRail() {
const agent = useStore((state) => state.pdsAgent);
const profiles = useStore((state) => state.profiles);
const profile = agent?.did ? profiles[agent.did] : undefined;
const tealHandle = normalizeHandle(profile?.teal?.handle as string | undefined);
const tealHandle = normalizeHandle(
(profile?.teal as { handle?: string } | null | undefined)?.handle,
);
const bskyHandle = normalizeHandle(profile?.bsky?.handle);
const displayName =
profile?.teal?.displayName ||
Expand Down
17 changes: 17 additions & 0 deletions apps/amethyst/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const expoConfig = require("eslint-config-expo/flat");
const reactCompiler = require("eslint-plugin-react-compiler");

module.exports = [
{
ignores: [".expo/**", "android/**", "build/**", "ios/**"],
},
...expoConfig,
{
plugins: {
"react-compiler": reactCompiler,
},
rules: {
"react-compiler/react-compiler": "error",
},
},
];
2 changes: 2 additions & 0 deletions apps/amethyst/hooks/useOnEscape.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import { useEffect } from "react";

export const useOnEscape = (callback: () => void) => {
useEffect(() => {
if (typeof document === "undefined") return;

const handleKeyDown = (event: KeyboardEvent) => {
if (event.key === "Escape") {
callback();
Expand Down
2 changes: 1 addition & 1 deletion apps/amethyst/jest-setup.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
import "@testing-library/react-native/build/matchers/extend-expect";
import "@testing-library/react-native/matchers";
89 changes: 45 additions & 44 deletions apps/amethyst/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,77 +26,78 @@
]
},
"dependencies": {
"@atproto/api": "^0.20.5",
"@atproto/lex-cli": "^0.10.0",
"@atproto/oauth-client": "^0.7.1",
"@atproto/oauth-client-expo": "^0.1.0",
"@babel/plugin-transform-export-namespace-from": "^7.27.1",
"@atproto/api": "^0.20.27",
"@atproto/lex-cli": "^0.10.5",
"@atproto/oauth-client": "^0.7.9",
"@atproto/oauth-client-expo": "^0.1.6",
"@babel/plugin-transform-export-namespace-from": "^7.29.7",
"@expo/dom-webview": "~57.0.0",
"@expo/vector-icons": "^15.1.1",
"@gorhom/bottom-sheet": "^5.2.14",
"@react-native-async-storage/async-storage": "2.2.0",
"@react-native-picker/picker": "^2.11.4",
"@react-navigation/native": "^7.2.4",
"@rn-primitives/avatar": "^1.4.0",
"@rn-primitives/hover-card": "^1.4.0",
"@rn-primitives/portal": "^1.4.0",
"@rn-primitives/progress": "^1.4.0",
"@rn-primitives/slot": "^1.4.0",
"@rn-primitives/tooltip": "^1.4.0",
"@rn-primitives/types": "^1.4.0",
"@react-navigation/native": "^7.3.8",
"@rn-primitives/avatar": "^1.5.2",
"@rn-primitives/hover-card": "^1.5.2",
"@rn-primitives/portal": "^1.5.2",
"@rn-primitives/progress": "^1.5.2",
"@rn-primitives/slot": "^1.5.2",
"@rn-primitives/tooltip": "^1.5.2",
"@rn-primitives/types": "^1.5.2",
"@teal/lexicons": "workspace:*",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"eslint-plugin-react-compiler": "19.1.0-rc.2",
"expo": "~56.0.4",
"expo-build-properties": "~56.0.14",
"expo-constants": "^56.0.15",
"expo-dev-client": "^56.0.15",
"expo-font": "~56.0.5",
"expo-image-picker": "^56.0.13",
"expo-linking": "~56.0.11",
"expo-router": "~56.2.6",
"expo-splash-screen": "~56.0.10",
"expo-sqlite": "^56.0.4",
"expo-status-bar": "~56.0.4",
"expo-system-ui": "~56.0.5",
"expo-web-browser": "~56.0.5",
"expo": "~57.0.4",
"expo-build-properties": "~57.0.3",
"expo-constants": "^57.0.3",
"expo-dev-client": "^57.0.5",
"expo-font": "~57.0.0",
"expo-image-picker": "^57.0.2",
"expo-linking": "~57.0.2",
"expo-router": "~57.0.4",
"expo-splash-screen": "~57.0.2",
"expo-sqlite": "^57.0.0",
"expo-status-bar": "~57.0.0",
"expo-system-ui": "~57.0.0",
"expo-web-browser": "~57.0.0",
"jest": "~29.7.0",
"lucide-react-native": "^1.16.0",
"nativewind": "^4.2.4",
"lucide-react-native": "^1.23.0",
"nativewind": "^4.2.6",
"react": "19.2.3",
"react-compiler-runtime": "^1.0.0",
"react-dom": "19.2.3",
"react-native": "0.85.3",
"react-native-css-interop": "^0.2.4",
"react-native-gesture-handler": "~2.31.2",
"react-native": "0.86.0",
"react-native-css-interop": "^0.2.6",
"react-native-gesture-handler": "~2.32.0",
"react-native-quick-crypto": "^1.1.5",
"react-native-reanimated": "~4.3.1",
"react-native-reanimated": "~4.5.0",
"react-native-safe-area-context": "5.7.0",
"react-native-screens": "~4.25.2",
"react-native-svg": "15.15.4",
"react-native-web": "~0.21.2",
"react-native-worklets": "^0.8.3",
"react-native-worklets": "^0.10.0",
"tailwind-merge": "^3.6.0",
"zustand": "^5.0.13"
"zustand": "^5.0.14"
},
"devDependencies": {
"@babel/core": "^7.29.0",
"@babel/runtime": "^7.29.2",
"@expo/metro-runtime": "~56.0.12",
"@babel/core": "^7.29.7",
"@babel/runtime": "^7.29.7",
"@expo/metro-runtime": "~57.0.3",
"@pmmmwh/react-refresh-webpack-plugin": "^0.6.2",
"@react-native/typescript-config": "^0.85.3",
"@testing-library/react-native": "^13.3.3",
"@react-native/typescript-config": "^0.86.0",
"@testing-library/react-native": "^14.0.1",
"@types/jest": "29.5.14",
"@types/node": "^25.9.1",
"@types/react": "~19.2.14",
"@types/node": "^26.1.1",
"@types/react": "~19.2.17",
"@types/react-dom": "~19.2.3",
"@types/react-test-renderer": "^19.1.0",
"babel-plugin-module-resolver": "^5.0.3",
"babel-plugin-react-compiler": "^1.0.0",
"eslint": "^9.39.4",
"eslint-config-expo": "~56.0.4",
"eslint-plugin-expo": "^1.0.0",
"jest-expo": "~56.0.4",
"eslint-config-expo": "~57.0.0",
"eslint-plugin-expo": "^1.1.0",
"jest-expo": "~57.0.1",
"react-refresh": "^0.18.0",
"tailwindcss": "^3.4.19",
"tailwindcss-animate": "^1.0.7",
Expand Down
5 changes: 1 addition & 4 deletions apps/aqua/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,5 @@
"test": "SQLX_OFFLINE=true cargo test -p aqua",
"test:rust": "SQLX_OFFLINE=true cargo test -p aqua"
},
"packageManager": "pnpm@11.5.2",
"dependencies": {
"jest-expo": "^54.0.12"
}
"packageManager": "pnpm@11.5.2"
}
6 changes: 0 additions & 6 deletions apps/aqua/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,6 @@ pub async fn get_car_import_job_status(
}
}

#[derive(Debug, Serialize, Deserialize)]
pub struct CarImportRequest {
pub import_id: Option<String>,
pub description: Option<String>,
}

#[derive(Debug, Serialize, Deserialize)]
pub struct CarImportResponse {
pub import_id: String,
Expand Down
2 changes: 1 addition & 1 deletion apps/aqua/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub async fn init_pool() -> anyhow::Result<PgPool, anyhow::Error> {
let pool = PgPoolOptions::new()
.max_connections(50)
.min_connections(1)
.max_lifetime(std::time::Duration::from_secs(10))
.max_lifetime(std::time::Duration::from_secs(30 * 60))
.connect(&env::var("DATABASE_URL")?)
.await?;
info!(target: "db", "Connected to the database!");
Expand Down
Loading
Loading