Skip to content

Improve branches presentation#46

Merged
wjt merged 7 commits intomainfrom
push-vsoxtousxtow
Jul 15, 2025
Merged

Improve branches presentation#46
wjt merged 7 commits intomainfrom
push-vsoxtousxtow

Conversation

@wjt
Copy link
Member

@wjt wjt commented Jul 15, 2025

Demo build at https://wjt.github.io/github-pages-branches-test/branches/

This fixes #42 by addressing the following points remaining there:

  1. Add a header to the page, linking back to the repo
  2. Remove the organisation prefix from branches on the default repo

I also added a couple of other things:

  • Improved the <title>
  • Added a ▶️ emoji to each link, as well as a title= attribute (i.e. tooltip)
  • Changed the link text for the default branch
  • Added generation time to the footer
  • Linked to the source branch as well as the source commit

@wjt wjt requested a review from manuq July 15, 2025 10:04
wjt added 5 commits July 15, 2025 11:08
Previously, the link for each playable branch was always prefixed by the
organisation name, e.g. `endlessm/change-repel-animation` or
`wjt/my-beautiful-horse`.

In the common case where the branch is in the repo where the action is
running, rather than in a fork, this doesn't provide any extra
information, and clutters the branch listing.

Only show the organisation when the branch is on a fork.

Helps #42
This is mostly useful in the case where the branch does not have a PR.
This filter does two things:

- Convert an ISO 8601 string to a Python datetime object
- Format a Python datetime object as a human-readable string

Previously the template only needed to operate on ISO 8601 strings (as
returned by the GitHub API) but in a future commit I will supply it with
a Python datetime object.

Split the filter into two steps.
@wjt wjt force-pushed the push-vsoxtousxtow branch from a475db1 to a42b66d Compare July 15, 2025 10:08
Copy link
Contributor

@manuq manuq left a comment

Choose a reason for hiding this comment

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

The play emoji makes the difference.

import collections.abc
import dataclasses
import datetime
import datetime as dt
Copy link
Contributor

Choose a reason for hiding this comment

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

I see you find datetime.datetime repeating :)

branches.css Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

I would remove the max-width rule from the header, so if there is enough space, it takes it. Looking more like a header. What do you think?
Captura desde 2025-07-15 08-16-13
Captura desde 2025-07-15 08-16-25

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, remove max width but center it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I would just remove it, so the content will be centered by the margin: 0 auto rule if the page width is bigger than the width determined in the main element (768px). And the h1 element will be left aligned in small screens.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, I made that change!

@wjt wjt force-pushed the push-vsoxtousxtow branch from a42b66d to 7d68d49 Compare July 15, 2025 12:30
@wjt wjt merged commit 05a1f8c into main Jul 15, 2025
1 check passed
@wjt wjt deleted the push-vsoxtousxtow branch July 15, 2025 12:45
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.

Improve branches presentation

2 participants

Comments