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

Paginate the commit history page with query params #1028

Merged
merged 3 commits into from
Aug 28, 2024

Conversation

ikhoon
Copy link
Contributor

@ikhoon ikhoon commented Aug 27, 2024

Motivation:

It could paginate the commit history page but a page index or a page size is not exposed in query parameters. Because these values were managed only as internal states of Javascript, sharing specific history as a URL was impossible.

Modifications:

  • Update Breadcrumbs to specify query parameters
  • Increase the width of CompareButton
  • Add an option to render a custom component when data is empty in DynamicDataTable
  • Add an option to hide a go-to button in PaginationBar.
  • Expose a browse button when if the path is a directory in HistoryList
  • Refactored HistoryListPage to use query parameters to specify revision ranges.
  • Use a form tag to submit the revision range with an enter key in ChangesViewPage
  • Link to a history page instead of a commit page in a FileEditor
    • Commits for a specific file must be retrieved sequentially from the HEAD revision, the Central Dogma server has a limit of 1000 if maxCommits is not specified. This means a commit for a specific file is not indexed and may not be found in the recent 1000 commits.
    • As we can't scan the entire history, it would be better to show the history and guide the user to find a commit rather than failing to find a commit for the file.

Result:

You can now share a specific range of commit history as a URL.

Motivation:

It was able to paginate the commit history page but a page index or
a page size is not exposed in query parameters. Because these values
were managed only as internal states of Javascript, it was not possible
to share specific history as a URL.

Modifications:

- Update `Bradcrumbs` to specify query parameters
- Increase the width of `CompareButton`
- Add an option to render a custom component when data is empty in
  `DynamicDataTable`
- Add an option to hide a go-to button in `PaginationBar`.
- Expose a browse button when if the path is a directory in
  `HistoryList`
- Refactored `HistoryListPage` to use query parameters to specify
  revision ranges.
- Use a form tag to submit the revision range with an enter key in
  `ChangesViewPage`
- Link to a history page instead of a commit page in a `FileEditor`
  - Commits for a specific file must be retrieved sequentially from the
    `HEAD` revision, the Central Dogma server has a limit of 1000
    if `maxCommits` is not specified. This means that a commit for a
    specific file is not indexed and may not be found in recent 1000
    commits.
  - As we can't scan the entire history, it would be better to show the
    history and guide the user to find a commit rather than failing to
    find a commit for the file.

Result:

You can now share a specific range of commit history as a URL.
@ikhoon ikhoon added this to the 0.70.0 milestone Aug 27, 2024
@ikhoon
Copy link
Contributor Author

ikhoon commented Aug 27, 2024

image

Copy link
Member

@minwoox minwoox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍 👍

@minwoox minwoox merged commit 534f6bf into line:main Aug 28, 2024
10 checks passed
@ikhoon ikhoon deleted the commit-range branch August 29, 2024 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants