enh
This commit is contained in:
parent
8e9c41bfa4
commit
a3680a3259
5 changed files with 16 additions and 9 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
# Taste
|
# Taste
|
||||||
- Prefers that the agent not run typechecks; instead, read the project's AGENTS.md for instructions on what to do/not do before finalizing work. Confidence: 0.9
|
- Prefers that the agent not run typechecks; instead, read the project's AGENTS.md for instructions on what to do/not do before finalizing work. Confidence: 0.9
|
||||||
- Judges completion by seeing the feature live in the running app ("I still don't see it on the /home route page"), so for data-driven features the agent must verify the app's actual runtime data source (API base URL, cache/backend) has the required data — not just that code builds and typechecks. Confirmed when the user signaled success only after the fix (pointing web-ui at the local backend with the tags data) made the section visible in the running app, and reconfirmed with the admin-ui product selector showing no products because it points at the production worker. Confidence: 0.9
|
- Judges completion by seeing the feature live in the running app ("I still don't see it on the /home route page"), so for data-driven features the agent must verify the app's actual runtime data source (API base URL, cache/backend) has the required data — not just that code builds and typechecks. Confirmed when the user signaled success only after the fix (pointing web-ui at the local backend with the tags data) made the section visible in the running app, and reconfirmed with the admin-ui product selector showing no products because it points at the production worker. Confidence: 0.9
|
||||||
- Prefers detailed analysis and explicit error/mistake checking before executing git operations (e.g., merges), rather than just performing the action. Confidence: 0.6
|
- Prefers detailed analysis and explicit error/mistake checking before executing destructive operations, rather than just performing the action — e.g., before a git merge, or before deleting a row directly from the DB (asked "Can I simply delete the row from db. Will it cause any problems" about an unclaimed reserved coupon, expecting the agent to trace all referencing tables/FKs — couponUsages, couponApplicableUsers/Products — before answering). Confidence: 0.7
|
||||||
- Do not run `git stash` or other destructive git operations that would discard or modify working-tree changes without explicit permission. Confidence: 0.9
|
- Do not run `git stash` or other destructive git operations that would discard or modify working-tree changes without explicit permission. Confidence: 0.9
|
||||||
- When removing unused code (e.g., an unused tRPC procedure), prefers a complete cleanup: also remove internal helper methods used only by it, associated types, re-exports, orphaned hook/API files and their shared types, and even commented-out imports, leaving zero remaining references. Confidence: 0.9
|
- When removing unused code (e.g., an unused tRPC procedure), prefers a complete cleanup: also remove internal helper methods used only by it, associated types, re-exports, orphaned hook/API files and their shared types, and even commented-out imports, leaving zero remaining references. Confidence: 0.9
|
||||||
- Before removing or deciding on code, likes to first verify where it is actually used across the codebase (asks questions like "where is X used"), rather than removing based on assumption. Confidence: 0.4
|
- Before removing or deciding on code, likes to first verify where it is actually used across the codebase (asks questions like "where is X used"), rather than removing based on assumption. Confidence: 0.4
|
||||||
|
|
@ -88,6 +88,8 @@ er-ui/app/(drawer)/(tabs)/home/index.tsx, I want similar here") and expects the
|
||||||
- Expects back navigation in the mobile app to return to the screen he navigated from, not to an unrelated tab root — when a link from the cart page to the coupons page (which lives in another tab's stack) made pressing back land on the "Me" page instead of the cart, he reported it as a bug ("when I try to press back I don't come to the cart page again. I come to me page. why is that"); cross-tab navigation flows must preserve a way back to the origin screen. Confidence: 0.6
|
- Expects back navigation in the mobile app to return to the screen he navigated from, not to an unrelated tab root — when a link from the cart page to the coupons page (which lives in another tab's stack) made pressing back land on the "Me" page instead of the cart, he reported it as a bug ("when I try to press back I don't come to the cart page again. I come to me page. why is that"); cross-tab navigation flows must preserve a way back to the origin screen. Confidence: 0.6
|
||||||
- When the same screen can be reached from multiple entry points, wants its UI to adapt based on the entry point — e.g., the coupons page opened from the cart page (via a `?from=cart` param) should hide the bottom tab bar while focused and restore it on leaving, while the same page opened from its own tab keeps the tab bar visible ("if coupons page is accessed from cart page, I want to hide the bottom nav bar"). Confidence: 0.7
|
- When the same screen can be reached from multiple entry points, wants its UI to adapt based on the entry point — e.g., the coupons page opened from the cart page (via a `?from=cart` param) should hide the bottom tab bar while focused and restore it on leaving, while the same page opened from its own tab keeps the tab bar visible ("if coupons page is accessed from cart page, I want to hide the bottom nav bar"). Confidence: 0.7
|
||||||
- For bulk/sequential generation from a code pattern (e.g., ABC12 → ABC13...), expects numbering to continue from the HIGHEST existing value so regeneration never re-emits already-entered codes — after entering ABC12, the next batch must start at ABC13, not restart at 12 (the first matching code). Confidence: 0.6
|
- For bulk/sequential generation from a code pattern (e.g., ABC12 → ABC13...), expects numbering to continue from the HIGHEST existing value so regeneration never re-emits already-entered codes — after entering ABC12, the next batch must start at ABC13, not restart at 12 (the first matching code). Confidence: 0.6
|
||||||
|
- Dislikes UI that renders transient loading states as definitive business states — e.g., the home page showed every item as "out of stock" until slot data loaded, because the out-of-stock check treated "no slot yet" (data not loaded) as genuinely out of stock. Expects a "data loaded" guard so the UI never flashes a wrong definitive status (out of stock) before data arrives, while still applying real out-of-stock detection once loaded. Confidence: 0.7
|
||||||
|
- When deleting a record, prefers the existing soft-delete/invalidate path over hard-deleting rows: the supported delete already sets `isInvalidated: true` (keeping history/audit and avoiding broken FK joins), and a raw hard delete should only be considered when confirmed nothing references the row (no usage records), with related rows (couponApplicableUsers/Products) removed transactionally to avoid orphans. Confidence: 0.75
|
||||||
e changes. Confidence: 0.95
|
e changes. Confidence: 0.95
|
||||||
er-ui/app/(drawer)/(tabs)/home/index.tsx, I want similar here") and expects the agent to mirror that pattern exactly, including details like item counts and container styling. Confidence: 0.9
|
er-ui/app/(drawer)/(tabs)/home/index.tsx, I want similar here") and expects the agent to mirror that pattern exactly, including details like item counts and container styling. Confidence: 0.9
|
||||||
als) rather than introducing new brand palettes; approval of a redesign's layout/composition does not imply approval of color or theme changes. Confidence: 0.95
|
als) rather than introducing new brand palettes; approval of a redesign's layout/composition does not imply approval of color or theme changes. Confidence: 0.95
|
||||||
|
|
|
||||||
|
|
@ -513,6 +513,7 @@ export default function Dashboard() {
|
||||||
const [hasMore, setHasMore] = useState(true);
|
const [hasMore, setHasMore] = useState(true);
|
||||||
const { getQuickestSlot } = useProductSlotIdentifier();
|
const { getQuickestSlot } = useProductSlotIdentifier();
|
||||||
const productSlotsMap = useCentralSlotStore((state) => state.productSlotsMap);
|
const productSlotsMap = useCentralSlotStore((state) => state.productSlotsMap);
|
||||||
|
const isSlotsLoaded = useCentralSlotStore((state) => state.isSlotsLoaded);
|
||||||
const refetchProducts = useCentralProductStore((state) => state.refetchProducts);
|
const refetchProducts = useCentralProductStore((state) => state.refetchProducts);
|
||||||
const refetchSlotsFromStore = useCentralSlotStore((state) => state.refetchSlots);
|
const refetchSlotsFromStore = useCentralSlotStore((state) => state.refetchSlots);
|
||||||
const [isRefreshing, setIsRefreshing] = useState(false);
|
const [isRefreshing, setIsRefreshing] = useState(false);
|
||||||
|
|
@ -552,8 +553,8 @@ export default function Dashboard() {
|
||||||
const slotA = getQuickestSlot(a.id)
|
const slotA = getQuickestSlot(a.id)
|
||||||
const slotB = getQuickestSlot(b.id)
|
const slotB = getQuickestSlot(b.id)
|
||||||
|
|
||||||
const aOutOfStock = Boolean(productSlotsMap[a.id]?.isOutOfStock) || !slotA
|
const aOutOfStock = Boolean(productSlotsMap[a.id]?.isOutOfStock) || (isSlotsLoaded && !slotA)
|
||||||
const bOutOfStock = Boolean(productSlotsMap[b.id]?.isOutOfStock) || !slotB
|
const bOutOfStock = Boolean(productSlotsMap[b.id]?.isOutOfStock) || (isSlotsLoaded && !slotB)
|
||||||
|
|
||||||
if (aOutOfStock && !bOutOfStock) return 1
|
if (aOutOfStock && !bOutOfStock) return 1
|
||||||
if (!aOutOfStock && bOutOfStock) return -1
|
if (!aOutOfStock && bOutOfStock) return -1
|
||||||
|
|
@ -605,14 +606,14 @@ export default function Dashboard() {
|
||||||
for (const product of ordered) {
|
for (const product of ordered) {
|
||||||
const isOut =
|
const isOut =
|
||||||
Boolean(productSlotsMap[product.id]?.isOutOfStock) ||
|
Boolean(productSlotsMap[product.id]?.isOutOfStock) ||
|
||||||
!getQuickestSlot(product.id);
|
(isSlotsLoaded && !getQuickestSlot(product.id));
|
||||||
if (isOut) outOfStock.push(product);
|
if (isOut) outOfStock.push(product);
|
||||||
else inStock.push(product);
|
else inStock.push(product);
|
||||||
}
|
}
|
||||||
map[tag.id] = [...inStock, ...outOfStock];
|
map[tag.id] = [...inStock, ...outOfStock];
|
||||||
}
|
}
|
||||||
return map;
|
return map;
|
||||||
}, [dashboardTags, products, productSlotsMap, getQuickestSlot]);
|
}, [dashboardTags, products, productSlotsMap, getQuickestSlot, isSlotsLoaded]);
|
||||||
|
|
||||||
const handleRefresh = useCallback(async () => {
|
const handleRefresh = useCallback(async () => {
|
||||||
setIsRefreshing(true);
|
setIsRefreshing(true);
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,9 @@ const ProductCard: React.FC<ProductCardProps> = ({
|
||||||
// Use isOutOfStock from productSlotsMap (all products now included)
|
// Use isOutOfStock from productSlotsMap (all products now included)
|
||||||
const productSlotInfo = productSlotsMap[item.id];
|
const productSlotInfo = productSlotsMap[item.id];
|
||||||
const isOutOfStockFromSlots = productSlotInfo?.isOutOfStock;
|
const isOutOfStockFromSlots = productSlotInfo?.isOutOfStock;
|
||||||
const displayIsOutOfStock = isOutOfStockFromSlots || !slotId;
|
const isSlotsLoaded = useCentralSlotStore((state) => state.isSlotsLoaded);
|
||||||
|
// Don't treat "no slot yet" as out of stock while slot data is still loading
|
||||||
|
const displayIsOutOfStock = isOutOfStockFromSlots || (isSlotsLoaded && !slotId);
|
||||||
|
|
||||||
// if(item.name.startsWith('Mutton Curry Cut')) {
|
// if(item.name.startsWith('Mutton Curry Cut')) {
|
||||||
// console.log({slotId, displayIsOutOfStock})
|
// console.log({slotId, displayIsOutOfStock})
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ interface ProductSlotInfo {
|
||||||
interface CentralSlotState {
|
interface CentralSlotState {
|
||||||
slots: Slot[];
|
slots: Slot[];
|
||||||
productSlotsMap: Record<number, ProductSlotInfo>;
|
productSlotsMap: Record<number, ProductSlotInfo>;
|
||||||
|
isSlotsLoaded: boolean;
|
||||||
refetchSlots: (() => Promise<void>) | null;
|
refetchSlots: (() => Promise<void>) | null;
|
||||||
setSlotsData: (slots: Slot[], productAvailability: ProductAvailability[], availability: AvailabilityEntry[]) => void;
|
setSlotsData: (slots: Slot[], productAvailability: ProductAvailability[], availability: AvailabilityEntry[]) => void;
|
||||||
clearSlotsData: () => void;
|
clearSlotsData: () => void;
|
||||||
|
|
@ -26,6 +27,7 @@ interface CentralSlotState {
|
||||||
export const useCentralSlotStore = create<CentralSlotState>((set) => ({
|
export const useCentralSlotStore = create<CentralSlotState>((set) => ({
|
||||||
slots: [],
|
slots: [],
|
||||||
productSlotsMap: {},
|
productSlotsMap: {},
|
||||||
|
isSlotsLoaded: false,
|
||||||
refetchSlots: null,
|
refetchSlots: null,
|
||||||
setSlotsData: (slots, productAvailability, availability) => {
|
setSlotsData: (slots, productAvailability, availability) => {
|
||||||
const productSlotsMap: Record<number, ProductSlotInfo> = {};
|
const productSlotsMap: Record<number, ProductSlotInfo> = {};
|
||||||
|
|
@ -53,9 +55,9 @@ export const useCentralSlotStore = create<CentralSlotState>((set) => ({
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
set({ slots, productSlotsMap });
|
set({ slots, productSlotsMap, isSlotsLoaded: true });
|
||||||
},
|
},
|
||||||
clearSlotsData: () => set({ slots: [], productSlotsMap: {} }),
|
clearSlotsData: () => set({ slots: [], productSlotsMap: {}, isSlotsLoaded: false }),
|
||||||
setRefetchSlots: (refetchSlots) => set({ refetchSlots }),
|
setRefetchSlots: (refetchSlots) => set({ refetchSlots }),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ const isDevMode = Constants.executionEnvironment !== "standalone";
|
||||||
// const BASE_API_URL = 'http://192.168.100.109:8787';
|
// const BASE_API_URL = 'http://192.168.100.109:8787';
|
||||||
// let BASE_API_URL = "https://raw.freshyo.in";
|
// let BASE_API_URL = "https://raw.freshyo.in";
|
||||||
let BASE_API_URL = "https://worker.freshyo.in";
|
let BASE_API_URL = "https://worker.freshyo.in";
|
||||||
// let BASE_API_URL = "https://freshyo.technocracy.ovh";
|
// let BASE_API_URL = "https://devapi.freshyo.in";
|
||||||
// let BASE_API_URL = 'http://192.168.100.120:8787';
|
// let BASE_API_URL = 'http://192.168.100.120:8787';
|
||||||
// let BASE_API_URL = 'http://192.168.29.176:4000';
|
// let BASE_API_URL = 'http://192.168.29.176:4000';
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue