Skip to content

Redesign the interactive songbook home page (#46, #27)#62

Open
chrisglein wants to merge 3 commits into
brewingcode:masterfrom
chrisglein:updateHomePage
Open

Redesign the interactive songbook home page (#46, #27)#62
chrisglein wants to merge 3 commits into
brewingcode:masterfrom
chrisglein:updateHomePage

Conversation

@chrisglein

Copy link
Copy Markdown
Collaborator

#46
Fixes #27

Reworks the home page (src/index.pug) from a developer-facing ABC editor into a clean, themeable "songbook+" experience — pick a song and read lyrics, chords, and melody — while keeping every power-user feature one click away. Addresses #46 (lean UX for a new audience) and #27 (common ABC props exposed in the UI instead of hardcoded per song).

Highlights

  • Lean, docked toolbar. Prominent song picker (shows the current title), and the ABC textarea, parse warnings, commit hash, and repo links are no longer front-and-center.
  • Layer toggles as compact segmented controls: Staff, Color, Labels, Lyrics, Trumpet fingering, Guitar tab. Staff-off hides the notation and shows the song's extended (W:) verses as text.
  • Transpose is now a key dropdown — shows the current key and lets you pick the destination key, with the semitone offset displayed (e.g. Key: E♭ → G (+4)).
  • Two color themesSoft (default) and Nautical — switchable from the toolbar and remembered per browser (localStorage).
  • Monochrome line-art icons (inline SVG sprite; no emoji, no new deps).
  • Docked, collapsible bottom "Edit ABC" bar replaces the old inline editor (and an experimental floating button); the top bar is a sticky docked bar.
  • Songbook PDF + QR moved into a dialog; the build version/commit link lives in the ABC edit bar.
  • Ability to provide common ABC props #27: %%notecolors / %%notelabels are now UI toggles and %%vocalfont times 10 is applied to every song — all injected at render time and removed from the song sources, so the ABC files stay clean and rendering is consistent across all songs.
  • Bug fix: trumpet fingering never displayed due to a #show-trumpt typo; corrected. Also dropped the redundant "Guitar (EADGBE)" tab label (abcjs still shows the TAB clef; non-standard tuning isn't supported).

Screenshots

Soft theme (default)
pr-1-soft

Nautical theme
pr-2-nautical

Docked "Edit ABC" bar
pr-3-editbar

Staff off → extended verses as text
pr-4-staff-off-verses

Guitar tab
pr-5-guitar

Songbook dialog (PDF + QR)
pr-6-songbook

Mobile / responsive
pr-7-mobile

Implementation notes

  • All logic stays in the single src/index.pug (CoffeeScript in a :coffeescript filter); themes are driven entirely by CSS custom properties toggled via a body.theme-* class.
  • Directive injection happens in setSong (prepended before render), mirroring how the site already handles ABC. Song sources had %%notecolors/%%notelabels (26 files) and %%vocalfont times 10 (19 files) removed accordingly.
  • URL params preserved/extended: title= / file= select a song; advanced=true opens the edit bar.

Testing

Validated in-browser across both themes: song selection, all six toggles, key transpose, staff-off verses and clean re-show, the songbook dialog, the edit bar, and mobile wrapping. npm run build is clean.

Redesign the home page for a songbook+ audience: a tight top toolbar
now leads with a song picker (labeled with the current title), compact
icon toggles for lyrics/trumpet/tab, and a transpose control that's a
key dropdown showing the current key with each destination key's
semitone offset.

The ABC textarea, "No errors" indicator, ABC-notation link, GitHub
"add a song" link, PDF/QR block, and commit-hash link move into a
hidden #advanced panel, revealed by a gear toggle or ?advanced=true.

Also fix a latent bug where trumpet fingering never displayed (filter
checked #show-trumpt instead of #show-trumpet).
…rewingcode#46, brewingcode#27)

Refine the lean home UI:

- New Staff toggle: hides the whole notation image (abcjs couples
  staff/notes/lyrics/tab and can't reflow), surfacing the song's
  extended W: verses as text. Pure-CSS via body.no-staff, overriding
  abcjs's inline padding-bottom so width is kept and the staff
  re-renders crisply when shown again. Color/Labels auto-disable when
  the staff is hidden.

- Note color & note labels are now UI toggles (issue brewingcode#27): removed the
  hardcoded %%notecolors/%%notelabels from all 26 songs/*.txt and the
  default snippet; they're injected before rendering based on the
  Color/Labels toggles (default on, so the look is unchanged).

- Icons switched to emoji (song 🎶, staff 🎼, color 🎨, labels 🔤,
  lyrics 🗣️, trumpet 🎺, guitar 🎸, songbook 📄, edit 🖊️).

- Rename "Tab" -> "Guitar"; Key control now reads "Key: E♭ (+2)".

- Edit button is a pen (was a gear); the advanced panel is now
  ABC-only (links, textarea, warnings).

- Songbook PDF + QR moved into a modal launched by 📄, with the commit
  hash relocated to its footer as the version, separating it from the
  ABC-editing controls.
Rework the home-page graphic design based on a treatment sampler:

- Two selectable color themes — "Soft" (off-white/blue, default) and
  "Nautical" (navy/brass-gold) — driven by CSS variables and a body
  class. A theme switcher (contrast icon) persists the choice in
  localStorage and applies it pre-render to avoid a flash.

- Replace emoji with a monochrome line-art SVG icon sprite (+ an
  `icon` mixin); keep the GitHub logo as the only bitmapped glyph.

- Docked bars instead of floating: a sticky full-width top bar, and a
  docked, collapsible bottom "Edit ABC" bar (its header toggles the
  editor) — removing the floating action button and the iPad
  disable-textarea dance.

- Segmented toggle groups: a soft-grey track with pill segments —
  active pops (blue / gold), off segments take the standard button
  background, disabled ones fade. The edit bar shares the top bar's
  background.

- Inject `%%vocalfont times 10` into every render (like the note
  color/label directives, but unconditional) and remove the hardcoded
  copies from the 19 songs that had it, so all songs share the serif
  lyric font.

- Move the version/commit link out of the Songbook dialog into the
  ABC edit bar, and ignore the local `.temp/` scratch folder.
@chrisglein
chrisglein marked this pull request as ready for review July 17, 2026 00:50
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.

Ability to provide common ABC props

1 participant