Skip to content

Your app looks AI-generated. Vincent Van Gogh noticed. An agent skill that finds and fixes AI-looking UI and UX in mobile apps, web apps, and websites.

fix(drawer-nav): detect Vuetify v-navigation-drawer and VNavigationDrawer (#320)

Shreeyassh6204295f87b8
diff --git a/skills/unslop-anything/scripts/detect.js b/skills/unslop-anything/scripts/detect.js
index b4b9258..a0cfb42 100644
--- a/skills/unslop-anything/scripts/detect.js
+++ b/skills/unslop-anything/scripts/detect.js
@@ -1192,7 +1192,7 @@ const rules = [
message: "Hamburger menu or navigation drawer. It hides the top destinations behind a tap.",
fix: "Ask first. Use tabs for three to five peer destinations; keep a drawer only for many destinations or a large-screen rail.",
find({ code }) {
- const re = /["']line\.(?:3\.horizontal|horizontal\.3)["']|\bIcons\.(?:Default\.|Filled\.|Outlined\.|Rounded\.|Sharp\.)?Menu\b|\bIcons\.menu(?:_rounded|_outlined|_sharp)?\b|\b(?:name|icon)=["']menu(?:-outline|-sharp)?["']|\bcreateDrawerNavigator\b|from\s+["']expo-router\/drawer["']|\bModalNavigationDrawer\b|\bdrawer:\s*(?:const\s+)?\w*Drawer\b|<ion-menu\b|<IonMenu(?:Button|Toggle)?\b|<(?:q-drawer|QDrawer)(?![\w-])|<(?:mat-sidenav|mat-drawer)(?![\w-])|\bBars3(?:BottomLeft|BottomRight|CenterLeft)?Icon\b|\bIconMenu2\b/;
+ const re = /["']line\.(?:3\.horizontal|horizontal\.3)["']|\bIcons\.(?:Default\.|Filled\.|Outlined\.|Rounded\.|Sharp\.)?Menu\b|\bIcons\.menu(?:_rounded|_outlined|_sharp)?\b|\b(?:name|icon)=["']menu(?:-outline|-sharp)?["']|\bcreateDrawerNavigator\b|from\s+["']expo-router\/drawer["']|\bModalNavigationDrawer\b|\bdrawer:\s*(?:const\s+)?\w*Drawer\b|<ion-menu\b|<IonMenu(?:Button|Toggle)?\b|<(?:q-drawer|QDrawer)(?![\w-])|<(?:mat-sidenav|mat-drawer)(?![\w-])|<(?:v-navigation-drawer|VNavigationDrawer)(?![\w-])|\bBars3(?:BottomLeft|BottomRight|CenterLeft)?Icon\b|\bIconMenu2\b/;
const first = matches(re, code).next();
return first.done ? [] : [first.value.index];
},
diff --git a/test/detect.test.js b/test/detect.test.js
index 74b9d75..72e3240 100644
--- a/test/detect.test.js
+++ b/test/detect.test.js
@@ -3129,3 +3129,25 @@ test("drawer-nav catches Angular Material mat-sidenav and mat-drawer (issue #300
assert.deepStrictEqual(drawerLines("<mat-sidenav-container>\n <mat-sidenav-content>Main</mat-sidenav-content>\n</mat-sidenav-container>\n"), []);
assert.deepStrictEqual(drawerLines("<mat-drawer-container>\n <mat-drawer-content>Main</mat-drawer-content>\n</mat-drawer-container>\n"), []);
});
+
+test("drawer-nav catches Vuetify v-navigation-drawer and VNavigationDrawer (issue #301)", () => {
+ const drawerLines = (src, file = "App.vue") =>
+ scanSource(src, file, { platform: "mobile" }).filter((f) => f.rule === "drawer-nav").map((f) => f.line);
+
+ const kebab = [
+ "<template>",
+ " <v-app>",
+ ' <v-navigation-drawer v-model="drawer">',
+ " <v-list>Menu</v-list>",
+ " </v-navigation-drawer>",
+ " </v-app>",
+ "</template>",
+ ].join("\n");
+ assert.deepStrictEqual(drawerLines(kebab), [3]);
+
+ const pascal = "<template><VNavigationDrawer /></template>\n";
+ assert.deepStrictEqual(drawerLines(pascal), [1]);
+
+ const quiet = "<template><v-bottom-navigation><v-tabs /></v-bottom-navigation></template>\n";
+ assert.deepStrictEqual(drawerLines(quiet), []);
+});