repometry 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repometry",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Track repository metrics without SaaS",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -334,11 +334,12 @@
334
334
  .fx-resizing { cursor: col-resize; user-select: none; }
335
335
  .fx-main { display: grid; gap: 1rem; min-width: 0; }
336
336
  /* The aside needs no frame: the splitter and the framed list beside it already set it apart. */
337
- .fx-aside { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: auto; margin: 0; padding: .125rem .125rem 1rem 0; }
337
+ /* The side column scrolls down only: what it holds wraps or ellipsizes, never pushes it sideways. */
338
+ .fx-aside { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow: hidden auto; margin: 0; padding: .125rem .125rem 1rem 0; }
338
339
  .fx-aside-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: .75rem; }
339
340
  .fx-view .fx-aside-heading h2 { font-size: 1rem; line-height: 1.35; overflow-wrap: anywhere; }
340
341
  .fx-aside-path { grid-column: 1; margin: .125rem 0 0; font-family: var(--mono); font-size: .75rem; color: var(--muted); overflow-wrap: anywhere; }
341
- .fx-aside .fx-close { grid-row: 1; grid-column: 2; justify-content: center; width: 1.75rem; min-height: 1.75rem; margin-right: -.375rem; color: var(--secondary); text-decoration: none; border-radius: 6px; }
342
+ .fx-aside .fx-close { grid-row: 1; grid-column: 2; justify-content: center; width: 1.75rem; min-height: 1.75rem; margin-right: -.125rem; color: var(--secondary); text-decoration: none; border-radius: 6px; }
342
343
  .fx-aside .fx-close::before { content: ""; width: .75rem; height: .75rem; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1.5 1.5l9 9m0-9l-9 9' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1.5 1.5l9 9m0-9l-9 9' stroke='black' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat; }
343
344
  .fx-aside .fx-close:hover { color: var(--ink); background: var(--surface-2); }
344
345
  .fx-kv { margin: .75rem 0 0; font-variant-numeric: tabular-nums; }
@@ -102,8 +102,9 @@ export type TokenKind = '' | 'c' | 's' | 'n' | 'k';
102
102
  */
103
103
  export declare function tokenizer(path: string): (line: string) => [TokenKind, string][];
104
104
  /**
105
- * The tint a gap of blank and comment lines takes so a run of one state stays one strip: the state of the measured
106
- * lines on both sides, where they agree. A gap between different states, or at the file's start or end, stays plain.
105
+ * The tint a gap of blank and comment lines takes so the strip has no breaks: the state of the measured line above it,
106
+ * which the gap closes, or for a gap at the file's start, of the line below. A gap beside a line that was not measured
107
+ * takes its other neighbour, and one with no measured neighbour stays plain.
107
108
  */
108
109
  export declare function bridgeStates(states: ReadonlyMap<number, LineState>, codeless: readonly boolean[]): Map<number, LineState>;
109
110
  /** A line with no code: blank, or nothing but comment. */
@@ -372,8 +372,9 @@ export function tokenizer(path) {
372
372
  };
373
373
  }
374
374
  /**
375
- * The tint a gap of blank and comment lines takes so a run of one state stays one strip: the state of the measured
376
- * lines on both sides, where they agree. A gap between different states, or at the file's start or end, stays plain.
375
+ * The tint a gap of blank and comment lines takes so the strip has no breaks: the state of the measured line above it,
376
+ * which the gap closes, or for a gap at the file's start, of the line below. A gap beside a line that was not measured
377
+ * takes its other neighbour, and one with no measured neighbour stays plain.
377
378
  */
378
379
  export function bridgeStates(states, codeless) {
379
380
  const bridged = new Map();
@@ -386,10 +387,10 @@ export function bridgeStates(states, codeless) {
386
387
  let end = line;
387
388
  while (end < codeless.length && !states.has(end + 1) && codeless[end])
388
389
  end += 1;
389
- const before = states.get(line - 1);
390
- if (before && before === states.get(end + 1))
390
+ const state = states.get(line - 1) ?? states.get(end + 1);
391
+ if (state)
391
392
  for (let at = line; at <= end; at++)
392
- bridged.set(at, before);
393
+ bridged.set(at, state);
393
394
  line = end + 1;
394
395
  }
395
396
  return bridged;