Skip to content

Reorder dashboard cards by user's browser languages#180

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/add-javascript-to-index
Draft

Reorder dashboard cards by user's browser languages#180
Copilot wants to merge 6 commits intomainfrom
copilot/add-javascript-to-index

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 23, 2026

  • Add position: relative to .card and new .pin-btn CSS rules in src/style.css
  • Replace existing reorder IIFE in templates/index.html.jinja with new logic that:
    • Captures original column order before any DOM changes
    • Detects matching user-language cards
    • Injects a pin button (filled icon = pinned, outline icon = unpinned) into each matching card
    • Reads/writes pin state from localStorage (default: pinned)
    • reorder() helper puts pinned cards first (in navigator.languages priority), unpinned cards stay in original sort order
    • Click handler toggles state, persists to localStorage, re-runs reorder()
  • Add null guard for col.querySelector('[id]') before accessing .id

📊 Dashboard preview 📊: https://python-docs-translations.github.io/dashboard/180/merge/

Copilot AI requested a review from m-aciek April 23, 2026 23:39
@m-aciek m-aciek marked this pull request as ready for review April 24, 2026 00:02
@m-aciek m-aciek requested a review from StanFromIreland April 24, 2026 00:02
Copy link
Copy Markdown
Member

@StanFromIreland StanFromIreland left a comment

Choose a reason for hiding this comment

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

-1 on this without a way to also optionally sort them by % completion/alphabetically. While this may be more convenient for some it will also not allow them to view the dashboard how it currently displays languages.

Comment thread .gitignore Outdated
clones
venv
__pycache__/
*.pyc
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is covered by the above, I suggest we just add a template from https://github.com/github/gitignore to cover everything (like the .idea/ directories some IDEs create).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I've pushed a simplification; to be honest I feel like the template you linked would be an overkill for our modest project; we can discuss it independently in a separate PR

@m-aciek
Copy link
Copy Markdown
Collaborator

m-aciek commented Apr 24, 2026

-1 on this without a way to also optionally sort them by % completion/alphabetically. While this may be more convenient for some it will also not allow them to view the dashboard how it currently displays languages.

I think engaging people to contribute is a higher priority purpose than providing a dry information. By bringing the user language(s) to front it is harder to miss them, on a page that already force you to scroll to see through all languages (we have now 25 of them). In my opinion moving one or two languages in front is a small disruption to the order.

To satisfy use case of "universal" view we could add an opt-out toggle to "unpin" users language(s). Would a thumbtack icon as first on right in top navbar be understandable/discoverable? We could/should make it disabled (grayed out) if none of user's languages is listed on the dashboard.

@StanFromIreland
Copy link
Copy Markdown
Member

To satisfy use case of "universal" view we could add an opt-out toggle to "unpin" users language(s). Would a thumbtack icon as first on right in top navbar be understandable/discoverable? We could/should make it disabled (grayed out) if none of user's languages is listed on the dashboard.

Something like this would be good. But, maybe have the thumbtack in the corner of the cards?

@m-aciek m-aciek marked this pull request as draft April 25, 2026 14:05
@m-aciek m-aciek marked this pull request as ready for review April 25, 2026 15:12
@m-aciek m-aciek marked this pull request as draft April 25, 2026 15:38
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