Skip to content

Commit 6d6afa7

Browse files
committed
Fix tab bar layout and add assets:compile rake task
Prevent the dark mode toggle from wrapping its emoji and label onto separate lines (white-space: nowrap), and anchor the group tabs to the bottom of the tab bar (align-self: flex-end) so they connect seamlessly with the content panel while the toggle aligns to the top. Add `rake assets:compile` task (migrated from simplecov-html) to build the compiled JS and CSS from html_frontend/ sources via esbuild, and add a CI workflow that runs the TypeScript type checker on every push.
1 parent 55b54d2 commit 6d6afa7

5 files changed

Lines changed: 377 additions & 1 deletion

File tree

.github/workflows/typecheck.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: typecheck
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
typecheck:
7+
runs-on: ubuntu-latest
8+
defaults:
9+
run:
10+
working-directory: html_frontend
11+
steps:
12+
- uses: actions/checkout@v6
13+
14+
- uses: oven-sh/setup-bun@v2
15+
16+
- run: bun install
17+
18+
- run: bun run typecheck

Rakefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,29 @@ end
3838

3939
task test: %i[spec cucumber test_html]
4040
task default: %i[rubocop spec cucumber test_html]
41+
42+
namespace :assets do
43+
desc "Compile frontend assets (JS + CSS) using esbuild"
44+
task :compile do
45+
frontend = File.expand_path("html_frontend", __dir__)
46+
outdir = File.expand_path("lib/simplecov/formatter/html_formatter/public", __dir__)
47+
48+
puts "Compiling assets..."
49+
50+
# JS: esbuild bundles TypeScript + highlight.js and minifies
51+
sh "cd #{frontend} && esbuild src/app.ts --bundle --minify --target=es2015 --outfile=#{outdir}/application.js"
52+
53+
# CSS: concatenate in order and minify
54+
css = %w[
55+
assets/stylesheets/reset.css
56+
assets/stylesheets/plugins/highlight.css
57+
assets/stylesheets/screen.css
58+
].map { |f| File.read(File.join(frontend, f)) }.join("\n")
59+
60+
IO.popen(%w[esbuild --minify --loader=css], "r+") do |io|
61+
io.write(css)
62+
io.close_write
63+
File.write("#{outdir}/application.css", io.read)
64+
end
65+
end
66+
end

html_frontend/assets/stylesheets/screen.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ abbr.timeago {
258258

259259
.group_tabs {
260260
display: flex;
261+
align-self: flex-end;
261262
gap: var(--sp-1);
262263
overflow-x: auto;
263264
}
@@ -874,6 +875,7 @@ table.file_list .totals-row td {
874875
font-size: 16px;
875876
font-family: var(--font-sans);
876877
cursor: pointer;
878+
white-space: nowrap;
877879
transition: color 0.15s, border-color 0.15s;
878880
}
879881

0 commit comments

Comments
 (0)