gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit93bdd26c93bdd26cpull state: wait for a claimed row, resync when it stays busy (#56)mre93bdd26c/theme/shell/user-menu.hl

3.2 KB

  1. // user-menu.hl — THE USER MENU: one icon at the header's right end; a tap opens a dropdown with the signed-in name and the
  2. // links the app puts in (last always Logout, before it Settings — creator, tracker#32) (docs/layouts/user-menu.md).
  3. // Signed out, the app puts its login (the ident selector) in the header INSTEAD of this component.
  4. //
  5. // AppHeader { … UserMenu { name = "az5b2" a { href = "/settings" "Settings" } a { href = "/logout" "Logout" } } }
  6. //
  7. // The dropdown is the browser's popover `#user-menu`: Esc and a tap outside close it, and so does a tap on one of its links.
  8. String name = ''
  9. String label = 'User menu'
  10. slot = null
  11. Style {
  12. userMenu {
  13. display = 'block'
  14. flex = 'none'
  15. '> button' {
  16. width = 'var(--layout-tap)'
  17. height = 'var(--layout-tap)'
  18. minHeight = '0'
  19. marginRight = '-.625rem'
  20. padding = '0'
  21. color = 'var(--color-text)'
  22. svg {
  23. width = '1.5rem'
  24. height = '1.5rem'
  25. }
  26. }
  27. '> nav:popover-open' {
  28. position = 'fixed'
  29. inset = 'var(--layout-header) max(var(--layout-gutter), calc((100% - var(--layout-column)) / 2)) auto auto'
  30. display = 'block'
  31. minWidth = '12rem'
  32. maxWidth = 'calc(100vw - 2 * var(--layout-gutter))'
  33. margin = '.25rem 0 0'
  34. padding = '.4rem'
  35. color = 'var(--color-text)'
  36. background = 'var(--color-surface)'
  37. border = '0'
  38. borderRadius = 'var(--radius-large)'
  39. boxShadow = '0 .75rem 2rem var(--color-background-sunken)'
  40. }
  41. 'p.who' {
  42. margin = '0'
  43. padding = '.4rem .6rem .5rem'
  44. fontSize = '.85rem'
  45. color = 'var(--color-text-muted)'
  46. overflow = 'hidden'
  47. textOverflow = 'ellipsis'
  48. whiteSpace = 'nowrap'
  49. empty { display = 'none' }
  50. }
  51. }
  52. // Keep the whole selector for selector list, :has condition.
  53. 'body:has(list-first) user-menu > nav:popover-open,
  54. body:has(three-pane) user-menu > nav:popover-open' { right = 'var(--layout-gutter)' }
  55. // Keep the whole selector for pseudo-element.
  56. 'user-menu > nav::backdrop' { background = 'transparent' }
  57. // Keep the whole selector for selector list.
  58. 'user-menu > nav a,
  59. user-menu > nav button' {
  60. display = 'flex'
  61. width = '100%'
  62. minHeight = 'var(--layout-tap)'
  63. alignItems = 'center'
  64. justifyContent = 'flex-start'
  65. padding = '.5rem .6rem'
  66. fontWeight = '600'
  67. color = 'var(--color-text)'
  68. borderRadius = 'var(--radius-small)'
  69. }
  70. // Keep the whole selector for selector list.
  71. 'user-menu > nav a:hover,
  72. user-menu > nav button:hover' {
  73. textDecoration = 'none'
  74. color = 'var(--color-text-strong)'
  75. background = 'var(--color-background)'
  76. }
  77. }
  78. View {
  79. userMenu {
  80. button { type = "button" class = "user-toggle" popovertarget = "user-menu" title = label 'aria-label' = label
  81. svg { viewBox = "0 0 24 24" fill = "none" stroke = "currentColor" 'stroke-width' = "1.8" 'stroke-linecap' = "round" 'aria-hidden' = "true"
  82. circle { cx = "12" cy = "12" r = "10" }
  83. circle { cx = "12" cy = "10" r = "3.2" }
  84. path { d = "M6.2 18.6c1.4-2.2 3.4-3.3 5.8-3.3s4.4 1.1 5.8 3.3" }
  85. }
  86. }
  87. nav { id = "user-menu" popover = "auto" 'aria-label' = label on click(e) { emit userMenuClick(e) }
  88. p { class = "who" name }
  89. slot
  90. }
  91. }
  92. }
  93. // a tap on one of its links closes the dropdown (a page change in place would leave it open)
  94. on userMenuClick(e) {
  95. if (e.target.closest('a') != null) { e.currentTarget.hidePopover() }
  96. }

Branches

Latest commits

  • 93bdd26cpull state: wait for a claimed row, resync when it stays busy (#56)mre
  • e53d284bpull state: stop on a failed branch scan, claim the row on writes (#56)mre
  • d8608224close and reopen: keep a manual close against sync (#56)mre
  • ffb60746|||PR close and reopen pull requests (#56)mre
  • fe209ffeMerge branch 'w56-owner-members' into mainGitoria
  • fa0754c8|||PR repository owner transfer and members API (#55)mre
  • 8862e537Merge branch 'w55-rename-org' into mainGitoria
  • 014d2b7fOne immutable readers snapshot per move for the left-organization event (#53)mre
  • 1859d506Decide who hears a repo left its organization by its readers before the move (#53)mre
  • 499f25f2Review fixes for the Settings organization move (#53)mre
  • ed3b922b|||PR move a repository into an organization in Settings (#53)mre
  • 74ec2af8Merge branch 'w54-repo-rename-pr' into mainGitoria
  • 9f7ce8d8Preserve rename compatibility and live page titlesmre
  • c3d95b6e|||PR separate names and addresses, rename repositories in Settings (#53)mre
  • ce08920dMerge branch 'w52c-header-phone' into mainGitoria
  • 0bab9e46|||PR header: ident status wraps on phones instead of clippingmre
  • e7af3eceMerge branch 'w52b-approval-followup' into mainGitoria
  • c01e66c6|||PR approvals follow-up: live Merge after status writes, helpers (#52)mre
  • 841da497Merge branch 'w53-pulls-speed-pr' into mainGitoria
  • 80307ae2|||PR pulls page cache: live PR numbers, complete scans onlymre