Skip to content

Conversation

@KarlXerri
Copy link

@KarlXerri KarlXerri commented May 8, 2024

I've added the base functionality in PyWB to control the different permutations of toggles:

a single digit end_timestamp controls the timeline filters

  • - show one capture per day, and hide redirects
  • 1 - show one capture per day, and show redirects
  • 2 - show all captures, and hide redirects
  • 3 - show all captures, and show redirects

These utilise the current end_timestamp regex parameter of WbUrl's QUERY_REGEX: QUERY_REGEX = re.compile('^(?:([\w-:]+)/)?(\d*)(timeline|[-])(\d)/?(.+)$')

This means that URLs with the various filters applied will have a single digit numeric suffix to "timeline", such as:

http://0.0.0.0:8080/ukgwa/timeline/www.gov.uk
http://0.0.0.0:8080/ukgwa/timeline1/www.gov.uk
http://0.0.0.0:8080/ukgwa/timeline2/www.gov.uk
http://0.0.0.0:8080/ukgwa/timeline3/www.gov.uk

Description

Motivation and Context

Screenshots (if appropriate):

Types of changes

  • Replay fix (fixes a replay specific issue)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added or updated tests to cover my changes.
  • All new and existing tests passed.

I've added the base functionality in PyWB to control the different permutations of toggles:

# a single digit end_timestamp controls the timeline filters
# <empty> - show one capture per day, and hide redirects
# 1       - show one capture per day, and show redirects
# 2       - show all captures, and hide redirects
# 3       - show all captures, and show redirects

These utilise the current `end_timestamp` regex parameter of `WbUrl`'s `QUERY_REGEX`:
QUERY_REGEX = re.compile('^(?:([\w\-:]+)/)?(\d*)(timeline|[*-])(\d*)/?(.+)$')

This means that URLs with the various filters applied will have a single digit numeric suffix to "timeline", such as:

http://0.0.0.0:8080/ukgwa/timeline/www.gov.uk
http://0.0.0.0:8080/ukgwa/timeline1/www.gov.uk
http://0.0.0.0:8080/ukgwa/timeline2/www.gov.uk
http://0.0.0.0:8080/ukgwa/timeline3/www.gov.uk
@KarlXerri KarlXerri requested review from Leeeebs, mijho and omgoo May 8, 2024 10:52
Copy link

@mijho mijho left a comment

Choose a reason for hiding this comment

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

@KarlXerri this looks good to me but as we discussed the other day in person I imagine that TNA will want to change the terms we use to specify the different options. Let's get it out in front of them and get some feedback

@KarlXerri KarlXerri merged commit 082559c into tna May 8, 2024
@omgoo omgoo deleted the feat/timeline-filters branch June 24, 2024 13:40
@omgoo omgoo restored the feat/timeline-filters branch June 24, 2024 13:40
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.

3 participants