Commit 5e7a9de8f012959c1ebd6ef81896bac4c0c94957

Authored by Bob Lail
1 parent adbac57c
Exists in master and in 1 other branch production

beautify the backtrace:

 - line numbers make no sense apart from file names
 - put visual emphasis on most important information
app/views/notices/_backtrace.html.haml
1 1 .window
2 2 %table.backtrace
3   - %tr
4   - %th
5   - %ul.line-numbers
6   - - lines.each do |line|
7   - %li= (@app.github_url? && Notice.in_app_backtrace_line?(line)) ? link_to_github(@app, line, line['number']) : line['number']
8   -
9   - %td
10   - %ul.lines
11   - - lines.each do |line|
12   - - in_app = line['file'].to_s.gsub!('[PROJECT_ROOT]','') && !line['file'].to_s.match(/^\/vendor\//)
13   - %li{:class => (in_app ? 'in-app' : nil)}
14   - = line['file']
15   - →
16   - %strong= line['method']
17   -
  3 + - lines.each do |line|
  4 + - in_app = line['file'].gsub!('[PROJECT_ROOT]','') && !line['file'].match(/^\/vendor\//)
  5 + - path = File.dirname(line['file']) + '/'
  6 + - file = File.basename(line['file'])
  7 + %tr{:class => (in_app ? 'in-app' : nil)}
  8 + %td.line
  9 + %span.path>= path
  10 + %span.file= "#{file}:#{line['number']}"
  11 + →
  12 + %span.method= line['method']
... ...
public/stylesheets/application.css
... ... @@ -661,27 +661,18 @@ table.deploys td.when {
661 661 .window table {
662 662 margin: 0;
663 663 }
664   -
665   -table.backtrace td {
666   - width: 100%;
667   - padding: 0;
668   - margin: 0;
669   - color: #A2A2A2;
  664 +table.backtrace td.line {
  665 + color: #777; /* 47% */
670 666 background-color: #222 !important;
  667 + border: none;
  668 + padding: 1px 8px;
671 669 }
672   -table.backtrace ul.line-numbers li {
673   - text-align: right;
674   -}
675   -table.backtrace ul.lines {
676   - padding: 10px 8px;
677   - overflow: auto;
678   -}
679   -table.backtrace li {
680   - white-space: nowrap;
  670 +table.backtrace td.line .file {
  671 + color:#d2d2d2; /* 82% */
681 672 }
682   -table.backtrace li.in-app {
683   - color: #2adb2e;
684   - background-color: #2f2f2f;
  673 +table.backtrace td.line .method {
  674 + color:#ececec; /* 93% */
  675 + font-weight:bold;
685 676 }
686 677  
687 678 span.click_span {
... ... @@ -717,3 +708,6 @@ table.comment tbody td {
717 708 margin-top: 15px;
718 709 }
719 710  
  711 +table.backtrace tr.in-app td.line { color:#156E16; /* 43% */}
  712 +table.backtrace tr.in-app td.line .file { color:#25C227; /* 76% */}
  713 +table.backtrace tr.in-app td.line .method { color:#2adb2e; /* 86% */}
... ...