Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
55620b3
fix(gotjunk): Fix icon visibility on map with dark backgrounds
Foundup Nov 8, 2025
9ab1254
fix(gotjunk): Fix classification bug and add duplicate item debugging
Foundup Nov 8, 2025
3a7d635
fix(gotjunk): Add body scroll lock to PigeonMapView
Foundup Nov 8, 2025
488727d
feat(gotjunk): Adaptive sidebar icon visibility on map view
Foundup Nov 8, 2025
60bdd41
fix(gotjunk): Ensure sidebar floats above map with pointer events
Foundup Nov 8, 2025
07bd28d
Resolve merge conflict: keep getButtonStyle() helper for adaptive sty…
Foundup Nov 8, 2025
7161ed4
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 8, 2025
a943e66
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 8, 2025
c533506
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 8, 2025
3cc696a
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 8, 2025
250f696
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 8, 2025
3f48095
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 8, 2025
0cc7992
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 8, 2025
e31d586
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 8, 2025
bc720e4
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 9, 2025
1429b14
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 9, 2025
78c1584
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 9, 2025
8ad26d2
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 9, 2025
435c44a
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 9, 2025
01832ae
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 9, 2025
01fc8e4
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 9, 2025
d7cfb92
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 9, 2025
5cc0b06
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 9, 2025
8a75787
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 9, 2025
0c666cf
Merge branches 'main' and 'main' of https://github.com/Foundup/Foundu…
Foundup Nov 9, 2025
5d8d1d1
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 9, 2025
7edb89d
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 9, 2025
ba94ea4
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 9, 2025
bfe7dfd
docs(gotjunk): Update ModLog with 2025-11-09 session changes
Foundup Nov 9, 2025
cb510aa
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 9, 2025
23d6562
fix(gotjunk): Prevent duplicate item creation race condition
Foundup Nov 9, 2025
302e9b2
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 9, 2025
5c94a40
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Foundup Nov 10, 2025
8ae4628
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Nov 10, 2025
4ae8ffd
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Nov 10, 2025
7cf19d6
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Nov 10, 2025
617e615
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Nov 10, 2025
5fec960
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Nov 10, 2025
59299bd
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Nov 10, 2025
f1958f9
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Nov 10, 2025
9dbdd88
Merge branches 'main' and 'main' of https://github.com/Foundup/Foundu…
Nov 10, 2025
56f5a6d
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Nov 11, 2025
2a02521
fix(gotjunk): Revert classification modal vibecoding - restore quick-…
Nov 11, 2025
107db26
fix(gotjunk): Hide camera orb on Browse tab - Occam's Razor UX improv…
Nov 11, 2025
709bc01
feat(gotjunk): Refactor photo flow - Items populate Browse feed + Map…
Nov 11, 2025
a4affe8
Merge PR #89: Resolve conflict - keep correct photo flow (myDrafts)
Nov 11, 2025
aa203d5
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Nov 11, 2025
74af451
Merge branch 'main' of https://github.com/Foundup/Foundups-Agent
Nov 11, 2025
c22355e
fix(gotjunk): Add safety verification for classification modal
Nov 11, 2025
485c849
feat(gotjunk): Add auto-classify toggle for rapid capture
Nov 11, 2025
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
76 changes: 73 additions & 3 deletions modules/foundups/gotjunk/frontend/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,36 @@ const App: React.FC = () => {
const [pendingClassificationItem, setPendingClassificationItem] = useState<{blob: Blob, url: string, location?: {latitude: number, longitude: number}} | null>(null);
const [isProcessingClassification, setIsProcessingClassification] = useState(false);

// Safety backup: Store last captured item that needs classification
const pendingClassificationBackupRef = useRef<{blob: Blob, url: string, location?: {latitude: number, longitude: number}} | null>(null);
const classificationCompletedRef = useRef(false);

// === AUTO-CLASSIFY STATE ===
const [autoClassifyEnabled, setAutoClassifyEnabled] = useState(false);
const [lastClassification, setLastClassification] = useState<{
type: ItemClassification,
discountPercent?: number,
bidDurationHours?: number
} | null>(null);

// Safety verification: Ensure classification modal appears and waits for user selection
useEffect(() => {
if (!pendingClassificationItem && pendingClassificationBackupRef.current && !classificationCompletedRef.current) {
// Classification modal disappeared without user completing it!
const backup = pendingClassificationBackupRef.current;

console.warn('[GotJunk] SAFETY CHECK: Classification modal closed without selection! Restoring...');

// Restore the pending item after a short delay to ensure clean state
setTimeout(() => {
if (!classificationCompletedRef.current) {
console.log('[GotJunk] SAFETY RESTORE: Re-opening classification modal');
setPendingClassificationItem(backup);
}
}, 100);
}
}, [pendingClassificationItem]);

// === FULLSCREEN REVIEW STATE (My Items tab) ===
const [reviewingItem, setReviewingItem] = useState<CapturedItem | null>(null);
const [reviewQueue, setReviewQueue] = useState<CapturedItem[]>([]);
Expand Down Expand Up @@ -254,12 +284,36 @@ const App: React.FC = () => {
console.error("Could not get location for capture:", error);
}

// Show classification modal instead of immediately saving
setPendingClassificationItem({
const capturedItem = {
blob,
url: URL.createObjectURL(blob),
location
});
};

// Check if auto-classify is enabled
if (autoClassifyEnabled && lastClassification) {
console.log('[GotJunk] Auto-classify enabled - using last classification:', lastClassification);

// Mark as completed immediately to skip safety verification
classificationCompletedRef.current = true;
pendingClassificationBackupRef.current = null;

// Directly process with last classification (skip modal)
setPendingClassificationItem(capturedItem);
await handleClassify(lastClassification.type, lastClassification.discountPercent, lastClassification.bidDurationHours);
return;
}

// Manual mode: Show classification modal
// Reset classification completion flag for new capture
classificationCompletedRef.current = false;

// Store backup for safety verification
pendingClassificationBackupRef.current = capturedItem;

// Show classification modal
console.log('[GotJunk] Photo captured - opening classification modal');
setPendingClassificationItem(capturedItem);
};

const handleClassify = async (classification: ItemClassification, discountPercent?: number, bidDurationHours?: number) => {
Expand All @@ -273,6 +327,19 @@ const App: React.FC = () => {

// Immediately capture the item data and clear pending state to prevent race conditions
const { blob, url, location } = pendingClassificationItem;

// Mark classification as completed to prevent safety restore
classificationCompletedRef.current = true;
pendingClassificationBackupRef.current = null;

// Store this classification for future auto-classify
setLastClassification({
type: classification,
discountPercent,
bidDurationHours
});
console.log('[GotJunk] Stored classification for auto-classify:', { classification, discountPercent, bidDurationHours });

setPendingClassificationItem(null);
setIsProcessingClassification(true);

Expand Down Expand Up @@ -739,6 +806,9 @@ const App: React.FC = () => {
// TODO: Open search modal
}}
showCameraOrb={showCameraOrb}
autoClassifyEnabled={autoClassifyEnabled}
onToggleAutoClassify={() => setAutoClassifyEnabled(!autoClassifyEnabled)}
lastClassification={lastClassification}
/>

{/* Re-classification Modal (tap badge) */}
Expand Down
36 changes: 35 additions & 1 deletion modules/foundups/gotjunk/frontend/components/BottomNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ interface BottomNavBarProps {
hasReviewItems: boolean;
onSearchClick?: () => void; // Search functionality
showCameraOrb?: boolean;
autoClassifyEnabled?: boolean;
onToggleAutoClassify?: () => void;
lastClassification?: { type: string, discountPercent?: number, bidDurationHours?: number } | null;
}

const buttonVariants = {
Expand All @@ -37,6 +40,9 @@ export const BottomNavBar: React.FC<BottomNavBarProps> = ({
hasReviewItems,
onSearchClick = () => console.log('🔍 Search clicked'),
showCameraOrb = true,
autoClassifyEnabled = false,
onToggleAutoClassify = () => console.log('🔄 Auto-classify toggled'),
lastClassification = null,
}) => {
const cameraRef = useRef<CameraHandle>(null);
const pressTimerRef = useRef<number | null>(null);
Expand Down Expand Up @@ -136,7 +142,7 @@ export const BottomNavBar: React.FC<BottomNavBarProps> = ({
{/* Camera Orb - Floating above nav bar */}
{showCameraOrb && (
<div
className="absolute left-1/2 -translate-x-1/2 bottom-32 flex flex-col items-center"
className="absolute left-1/2 -translate-x-1/2 bottom-32 flex flex-col items-center gap-3"
style={{ zIndex: Z_LAYERS.cameraOrb }}
>
{/* Main capture button with live preview - Intelligent scaling: iPhone 11=143px, iPhone 16=149px */}
Expand All @@ -153,6 +159,34 @@ export const BottomNavBar: React.FC<BottomNavBarProps> = ({
>
<Camera ref={cameraRef} onCapture={onCapture} captureMode={captureMode} />
</div>

{/* Auto-Classify Toggle Button */}
<motion.button
onClick={onToggleAutoClassify}
className={`px-4 py-2 rounded-full shadow-lg font-semibold text-sm transition-all ${
autoClassifyEnabled
? 'bg-green-600 text-white'
: 'bg-red-600/80 text-white'
}`}
variants={buttonVariants}
whileHover="hover"
whileTap="tap"
aria-label={autoClassifyEnabled ? 'Disable auto-classify' : 'Enable auto-classify'}
>
<div className="flex items-center gap-2">
<div className={`w-2 h-2 rounded-full ${autoClassifyEnabled ? 'bg-white' : 'bg-white/70'}`} />
<span>
Auto: {autoClassifyEnabled ? 'ON' : 'OFF'}
</span>
</div>
{autoClassifyEnabled && lastClassification && (
<div className="text-xs opacity-90 mt-0.5">
{lastClassification.type === 'discount' && `${lastClassification.discountPercent || 75}% OFF`}
{lastClassification.type === 'bid' && `${lastClassification.bidDurationHours || 48}h`}
{lastClassification.type === 'free' && 'FREE'}
</div>
)}
</motion.button>
</div>
)}

Expand Down