Skip to content
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

Redesign "Appears in" file list #279

Merged
merged 1 commit into from
Aug 5, 2023

Conversation

jonathanhefner
Copy link
Member

The "Appears in" file list is collapsed by default to avoid overwhelming the user with very long file lists. For example, the Rails module appears in 125 files. However the vast majority of modules appear in only in their own file. And, out of all 1370 modules, only ~50 appear in 10 or more files:

$ grep -c '[.]rb</a>' doc/public/classes/**/*.html | head
doc/rdoc/classes/AbstractController/ActionNotFound.html:1
doc/rdoc/classes/AbstractController/Base.html:1
doc/rdoc/classes/AbstractController/Caching/ClassMethods.html:1
doc/rdoc/classes/AbstractController/Caching/ConfigMethods.html:1
doc/rdoc/classes/AbstractController/Caching/Fragments/ClassMethods.html:1
doc/rdoc/classes/AbstractController/Caching/Fragments.html:1
doc/rdoc/classes/AbstractController/Caching.html:2
doc/rdoc/classes/AbstractController/Callbacks/ClassMethods.html:1
doc/rdoc/classes/AbstractController/Callbacks.html:1
doc/rdoc/classes/AbstractController/Collector.html:1

$ grep -c '[.]rb</a>' doc/public/classes/**/*.html | grep ':1$' | wc -l
1181

$ grep -c '[.]rb</a>' doc/public/classes/**/*.html | grep ':[1-5]$' | wc -l
1293

$ grep -c '[.]rb</a>' doc/public/classes/**/*.html | grep ':[1-9]$' | wc -l
1321

$ grep -c '[.]rb</a>' doc/public/classes/**/*.html | wc -l
1370

This commit redesigns the "Appears in" file list to show a small number of files by default. If a module appears in 9 or fewer files, then all the files will be shown by default. Otherwise, the first 5 files will shown, and a "More" button is shown to reveal the remaining files.

Before Before (expanded) After After (expanded)
before1a before1b after1
before2a before2b after2a after2b

The "Appears in" file list is collapsed by default to avoid overwhelming
the user with very long file lists.  For example, the `Rails` module
appears in 125 files.  However the vast majority of modules appear in
only in their own file.  And, out of all 1370 modules, only ~50 appear
in 10 or more files:

  ```console
  $ grep -c '[.]rb</a>' doc/public/classes/**/*.html | head
  doc/rdoc/classes/AbstractController/ActionNotFound.html:1
  doc/rdoc/classes/AbstractController/Base.html:1
  doc/rdoc/classes/AbstractController/Caching/ClassMethods.html:1
  doc/rdoc/classes/AbstractController/Caching/ConfigMethods.html:1
  doc/rdoc/classes/AbstractController/Caching/Fragments/ClassMethods.html:1
  doc/rdoc/classes/AbstractController/Caching/Fragments.html:1
  doc/rdoc/classes/AbstractController/Caching.html:2
  doc/rdoc/classes/AbstractController/Callbacks/ClassMethods.html:1
  doc/rdoc/classes/AbstractController/Callbacks.html:1
  doc/rdoc/classes/AbstractController/Collector.html:1

  $ grep -c '[.]rb</a>' doc/public/classes/**/*.html | grep ':1$' | wc -l
  1181

  $ grep -c '[.]rb</a>' doc/public/classes/**/*.html | grep ':[1-5]$' | wc -l
  1293

  $ grep -c '[.]rb</a>' doc/public/classes/**/*.html | grep ':[1-9]$' | wc -l
  1321

  $ grep -c '[.]rb</a>' doc/public/classes/**/*.html | wc -l
  1370
  ```

This commit redesigns the "Appears in" file list to show a small number
of files by default.  If a module appears in 9 or fewer files, then all
the files will be shown by default.  Otherwise, the first 5 files will
shown, and a "More" button is shown to reveal the remaining files.
@jonathanhefner jonathanhefner merged commit 2a0bbb7 into rails:main Aug 5, 2023
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.

1 participant