-
-
Notifications
You must be signed in to change notification settings - Fork 362
Fix renamer rule test #4012
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix renamer rule test #4012
Conversation
📝 WalkthroughWalkthroughAdds two boolean flags, Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
resources/js/views/RenamerRules.vue (2)
144-145: Consider using camelCase for reactive variables.Vue/TypeScript convention typically uses camelCase for local variables (
isPhoto,isAlbum). The snake_case here matches the service type, but you could destructure/rename when calling the service. This is a minor style nit.♻️ Optional refactor
-const is_photo = ref(true); -const is_album = ref(true); +const isPhoto = ref(true); +const isAlbum = ref(true);Then update the service call:
-RenamerService.test({ candidate: testInput.value, is_photo: is_photo.value, is_album: is_album.value }) +RenamerService.test({ candidate: testInput.value, is_photo: isPhoto.value, is_album: isAlbum.value })And template bindings accordingly.
176-188: Consider re-running test when toggles change.Currently, changing the
is_photooris_albumtoggles doesn't automatically re-run the test. Users must modify the input text to triggerdebouncedTest. For better UX, you might want to watch the toggles and re-run the test.♻️ Optional: Add watchers for toggles
+import { onMounted, ref, watch } from "vue";Then add watchers after the reactive declarations:
watch([is_photo, is_album], () => { if (testInput.value.trim() !== "") { debouncedTest(); } });This ensures the test re-runs automatically when toggle states change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
lang/fa/renamer.php (1)
107-108: LGTM!The new translation keys are correctly added. The English values are consistent with the existing pattern in this file where some strings remain untranslated.
,
Consider translating these to Persian when time permits, similar to the translations provided for other keys in this file:
'apply_photo_rules' => 'اعمال قوانین عکس''apply_album_rules' => 'اعمال قوانین آلبوم'
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.