opinionated comment cleanup

This commit is contained in:
Michael Genson 2025-07-31 17:52:45 +00:00
commit 798f5a36cc
4 changed files with 3 additions and 18 deletions

View file

@ -11,18 +11,12 @@ export function useShoppingListCopy() {
function copyListItems(itemsByLabel: { [key: string]: ShoppingListItemOut[] }, copyType: CopyTypes) {
const text: string[] = [];
// Copy text into subsections based on label
Object.entries(itemsByLabel).forEach(([label, items], idx) => {
// for every group except the first, add a blank line
if (idx) {
text.push("");
}
// add an appropriate heading for the label depending on the copy format
text.push(formatCopiedLabelHeading(copyType, label));
// now add the appropriately formatted list items with the given label
items.forEach(item => text.push(formatCopiedListItem(copyType, item)));
});

View file

@ -77,7 +77,6 @@ export function useShoppingListCrud(
refresh();
}
// Individual item operations
function saveListItem(item: ShoppingListItemOut) {
if (!shoppingList.value) {
return;

View file

@ -52,7 +52,7 @@ export function useShoppingListPage(listId: string) {
const refresh = () => baseRefresh(updateListItemOrder);
// Initialize labels
// Initialize shopping list labels
const labels = useShoppingListLabels(shoppingList);
// Initialize copy functionality
@ -164,8 +164,6 @@ export function useShoppingListPage(listId: string) {
});
return {
// State - flatten the dialog state for easier access
...state.state,
shoppingList,
loadingCounter,
recipeReferenceLoading,
@ -179,13 +177,10 @@ export function useShoppingListPage(listId: string) {
itemsByLabel,
isOffline,
// Labels
// Sub-composables
...state.state,
...labels,
// CRUD operations
...crud,
// Recipe management
...recipes,
// Specialized functions

View file

@ -398,10 +398,7 @@ export default defineNuxtComponent({
const groupSlug = computed(() => route.params.groupSlug as string || $auth.user.value?.groupSlug || "");
const id = route.params.id as string;
// Use the main shopping list page composable
const shoppingListPage = useShoppingListPage(id);
// Get stores for labels, units, and foods
const { store: allLabels } = useLabelStore();
const { store: allUnits } = useUnitStore();
const { store: allFoods } = useFoodStore();