Page MenuHomePhabricator

Codebase: Improve filenames consistency
Closed, ResolvedPublic

Assigned To
Authored By
Yug
Sep 28 2024, 11:21 PM
Referenced Files
Restricted File
Jan 5 2025, 12:11 AM
F58125666: image.png
Jan 5 2025, 12:04 AM
Subscribers

Description

  • WordList.vue -> List or ItemList.vue , because it can be sentences or poems now.
  • Generators dialogs -> review filename consistency, rename such as Generator{Role}Dialog.vue

Event Timeline

Yug renamed this task from Improve filenames consistency to Step 6: Improve filenames consistency.Nov 15 2024, 11:06 AM
Yug triaged this task as High priority.Nov 15 2024, 11:11 AM
Yug renamed this task from Step 6: Improve filenames consistency to Codebase: Improve filenames consistency.Dec 17 2024, 10:51 AM

Filename inconsistency has been handled

WordList.vue -> List.vue
WordListStep.vue -> ListStep.vue
ShareWordList.vue -> ShareList.vue

All the list generators dialog files has also been renames with format: Generator[Role]Dialog.vue

Subsequent import for all file changes have been handled, and app has been tested after making all the changes

Hello @Pushkar7077 ,
Thank you for these consistency pushes.
Reading your changes I though of the following items and associated rational :

  • WordList.vue -> List.vue-> ListItems.vue : Keep more distinctive variable name, so future volunteer devs would bump into trouble with the List/list variable.
  • GeneratorWikimediaCategDialog.vue -> avoid abbreviation in filename, follow minimal surprise principle -> GeneratorWikimediaCategoryDialog.vue
  • In /components, for naming clarity, consistency, and to prepare T375962 (repository split) :
    • TheApp -> Site : ex TheSiteBar.vue -> SiteBar.vue
    • The -> Site : ex TheFooter.vue -> SiteFooter.vue
  • Menu pages, consistency with other pagenames :

image.png (302×342 px, 20 KB)
{F58125762}

[Edit] I found further inconsistencies. For src/components folder we also a few files relevant to the website, then most files are related to RecordWizard, yet we have an additional subfolder RecordWizard. In it, there is src/components/RecordWizard/SearchLocation.vue, which has the same component role as src/components/SoundMeter.vue.

  • All Site files should be clearly identifiable (addressed in a filename change point above with prefix Site).
  • All App component files should be together with meaningful name, then no sub folder needed.

[EDIT:] ShareList.vue is not a view, it's a component. Should go into /src/components/

ShareList.vue is not a view, it's a component. Should go into /src/components/

ShareList is actually a view, its the actual link which user shares to share their word list

@Pushkar7077 , is there a reason to keep the WM categories generator isolated here ?
[EDIT]: It seems the file is present twice, once in each folder.

  • /front-end/src/components/Generators/WikimediaCategoryDialog.vue
  • /front-end/src/components/RecordWizard/GeneratorWikimediaCategDialog.vue

ShareList.vue : is it the action of sharing (-> ShareList.vue) or a list of previously shared lists (-> SharedLists.vue).

@Pushkar7077 , is there a reason to keep the WM categories generator isolated here ?

Fixed by @Pushkar7077 in 30202ca

I suspect this issue is nearly resolved. I will spend a bit more time browsing the concerned folder tho.

word-list name is depreciated. Generally speaking, word should always be replaced by item since we now allow words, sentences and phrases.

@Pushkar7077 hello, I cautch up another rename, see here :

  • front-end/src/components/TheLoginButton.vue -> front-end/src/components/LoginButton.vue
  • front-end/src/views/RecordWizardView.vue : fix inside to follow file rename above.

Considered solved for now. The realignment was done, increasing code readability for new comers.

Naturally, keeping well named and well structured directories and filenames must continue.