Skip to content

Conversation

@ildyria
Copy link
Member

@ildyria ildyria commented Jan 23, 2026

Summary by CodeRabbit

  • New Features
    • Added two toggles in the Renamer test UI to independently apply photo and album rules; both default to enabled.
  • Localization
    • Added "Apply photo rules" and "Apply album rules" translations across supported locales.

✏️ Tip: You can customize this high-level summary in your review settings.

@ildyria ildyria requested a review from a team as a code owner January 23, 2026 11:17
@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

📝 Walkthrough

Walkthrough

Adds two boolean flags, is_photo and is_album, to the renamer test payload and UI; the service type is extended, the Vue component exposes two toggles (default true) and sends the flags to the test call; translation files gain two new keys.

Changes

Cohort / File(s) Summary
Service & UI
resources/js/services/renamer-service.ts, resources/js/views/RenamerRules.vue
Extend TestRenamerRequest with is_photo and is_album; add two ToggleSwitch controls bound to new reactive flags (default true); include flags in RenamerService.test payload.
Translations (multiple locales)
lang/*/renamer.php (e.g. lang/en/renamer.php, lang/fr/renamer.php, lang/ja/renamer.php, lang/ru/renamer.php, lang/zh_CN/renamer.php, ...)
Add translation keys apply_photo_rules and apply_album_rules across locale files.
Docs
.github/copilot-instructions.md
Add "Translations" section describing location/conventions for translation files.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 I nudged two switches with a gentle hop,
Photo and album both set to true on top.
A tiny payload change, a subtle cheer,
Rules now listen when the tester’s near.
Hop, renamer, hop — the names appear.

🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a 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_photo or is_album toggles doesn't automatically re-run the test. Users must modify the input text to trigger debouncedTest. 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.

Copy link

@coderabbitai coderabbitai bot left a 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' => 'اعمال قوانین آلبوم'

@ildyria ildyria merged commit 4de8828 into master Jan 23, 2026
44 checks passed
@ildyria ildyria deleted the testing-renaming branch January 23, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants