Allow the size of a "large commit" to be customized

9add9c49179b2f79703e05156a2d117fd388d88b

Tucker McKnight <tmcknight@instructure.com> | Sat Aug 15 2026

Allow the size of a "large commit" to be customized

Changes that are more than 100 lines (or now, more than the
lineCountForLargeCommit value) will take up the full length
of the bar graph on the commits page.
getConfig.ts:38
Before
37
38
39


40
41
    path: '/repos',
    defaultTemplate: {
      enabled: true,
⁣
⁣
      allRepositoriesPageTitle: "All Repositories",
      colors: {
        languageGraph: [
After
37
38
39
40
41
42
43
    path: '/repos',
    defaultTemplate: {
      enabled: true,
      homepageButtons: [],
      lineCountForLageCommit: 100,
      allRepositoriesPageTitle: "All Repositories",
      colors: {
        languageGraph: [
js_templates/commits.ts:11
Before
10
11
12
13




14
  const pagesJustForRef = eleventyConfig.getFilter("pagesJustForRef")
  const slugify = eleventyConfig.getFilter("slugify")
  const date = eleventyConfig.getFilter("date")

⁣
⁣
⁣
⁣
  const nav = NavHelper({
    reposConfig,
After
10
11
12
13
14
15
16
17
18
  const pagesJustForRef = eleventyConfig.getFilter("pagesJustForRef")
  const slugify = eleventyConfig.getFilter("slugify")
  const date = eleventyConfig.getFilter("date")
  const lineCountForLargeCommit = reposConfig
                                    .repos[data.patchPage.repoName]
                                    .defaultTemplate
                                    .lineCountForLargeCommit

  const nav = NavHelper({
    reposConfig,
js_templates/commits.ts:130
Before
129
130
131
132
133
134
                }, topLanguagePercentages.map((topLangPercent) => {
                  const langDiffs = languageCounts.get(topLangPercent.extension)
                  // TODO: make the average commit size adjustable
                  const adjustedLength = Math.min(langDiffs[0] + langDiffs[1], 100)
                  const languageInfo = colors[topLangPercent.extension] || colors['other']
                  return m('div', {
                    class: 'language-col',
After
129
130
131
132
133
134
                }, topLanguagePercentages.map((topLangPercent) => {
                  const langDiffs = languageCounts.get(topLangPercent.extension)
                  // TODO: make the average commit size adjustable
                  const adjustedLength = Math.min((langDiffs[0] + langDiffs[1]) / lineCountForLargeCommit * 100, 100)
                  const languageInfo = colors[topLangPercent.extension] || colors['other']
                  return m('div', {
                    class: 'language-col',
js_templates/commits.ts:139
Before
138
139
140
141
142
143
                }).concat(otherLanguageDiffs[0] > 0 || otherLanguageDiffs[1] > 0
                  ? m('div', {
                      class: 'language-col',
                      style: `height: 1rem; width: ${Math.min(otherLanguageDiffs[0] + otherLanguageDiffs[1], 100)}%; background: #666;`
                    })
                  : null
                ))
After
138
139
140
141
142
143
                }).concat(otherLanguageDiffs[0] > 0 || otherLanguageDiffs[1] > 0
                  ? m('div', {
                      class: 'language-col',
                      style: `height: 1rem; width: ${Math.min((otherLanguageDiffs[0] + otherLanguageDiffs[1]) / lineCountForLargeCommit * 100, 100)}%; background: #666;`
                    })
                  : null
                ))
schemas/ReposConfiguration.json:90
Before
89
90
91
92
93
94
95

96
97
98
                "type": "object"
              },
              "type": "array"
            }
          },
          "required": [
            "homepageButtons"
⁣
          ],
          "type": "object"
        },
        "description": {
After
89
90
91

92
93
94
95
96
97
98
                "type": "object"
              },
              "type": "array"
⁣
            },
            "lineCountForLargeCommit": {
              "type": "number"
            }
          },
          "type": "object"
        },
        "description": {
src/configTypes.ts:20
Before
19
20
21
22

23
24
  tags: Array<any>,
  languageExtensions: Object,
  defaultTemplate: {
    homepageButtons: Array<any>
⁣
  }
}
After
19
20
21
22
23
24
25
  tags: Array<any>,
  languageExtensions: Object,
  defaultTemplate: {
    homepageButtons: Array<any>,
    lineCountForLargeCommit: number,
  }
}
src/configTypes.ts:151
Before
150
151
152
153
154
155
156
157









158
    copyTo: string,
  }[],
  defaultTemplate?: {
    homepageButtons: Array<{
      url: string,
      text: string,
      newTab?: boolean,
    }>
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
⁣
  },
}
After
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
    copyTo: string,
  }[],
  defaultTemplate?: {
    homepageButtons?: Array<{
      url: string,
      text: string,
      newTab?: boolean,
    }>,
    /**
     * The number of lines for a diff to take up the full width of the bar graph
     * on the commits page. Commits smaller than this will take up a proportional
     * fraction of the graph. E.g. if this value is 100, a 50 line change will be
     * half of the width of the bar graph.
     * 
     * @default 100
     */
     lineCountForLargeCommit?: number,
  },
}