Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ output.txt
test-results/
playwright-report/
dist
*.log
*.log
.claude
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

All notable changes to this project will be documented here.

## [Unreleased]
## [0.31.1] - Oct 22nd, 2026
#### Changed
- Simplified ternary syntax into nullish coalescing in several locations
- Added `@eslint/config-helpers` so ESLint can load `.gitignore`
- Update CHANGELOG capitalization in PR template

## [0.31.0] - Oct 21st, 2026
#### Added
Expand Down
3 changes: 3 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import globals from "globals";
import eslint from "@eslint/js";
import stylistic from "@stylistic/eslint-plugin";
import tseslint from "typescript-eslint";
import { includeIgnoreFile } from "@eslint/config-helpers";
import { fileURLToPath } from "node:url";

export default [
includeIgnoreFile(fileURLToPath(new URL(".gitignore", import.meta.url)), "Imported .gitignore patterns"),
{
// Global ignores
// https://eslint.org/docs/latest/use/configure/configuration-files#configuration-objects
Expand Down
50 changes: 45 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ulabel",
"description": "An image annotation tool.",
"version": "0.31.0",
"version": "0.31.1",
"main": "dist/ulabel.min.js",
"module": "dist/ulabel.min.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -60,6 +60,7 @@
"homepage": "https://github.com/SenteraLLC/ulabel",
"unpkg": "dist/ulabel.min.js",
"devDependencies": {
"@eslint/config-helpers": "^0.7.0",
"@eslint/config-inspector": "^1.3.0",
"@eslint/js": "^9.11.1",
"@playwright/test": "^1.56.0",
Expand Down
2 changes: 1 addition & 1 deletion pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- [ ] Version number in `package.json` has been bumped since last release
- [ ] Version numbers match between package `package.json` and `src/version.js`
- [ ] Updated documentation if necessary (currently just in `api_spec.md`)
- [ ] Added changes to `changelog.md`
- [ ] Added changes to `CHANGELOG.md`

## Breaking API Changes

Expand Down
6 changes: 3 additions & 3 deletions src/annotation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@ export class ULabelAnnotation {
// Return the data, initializing the arrays if they are undefined
const ret: PolygonSpatialData = {
spatial_payload: annotation.spatial_payload,
containing_box: annotation.containing_box ? annotation.containing_box : null,
spatial_payload_holes: annotation.spatial_payload_holes ? annotation.spatial_payload_holes : [false],
spatial_payload_child_indices: annotation.spatial_payload_child_indices ? annotation.spatial_payload_child_indices : [[]],
containing_box: annotation.containing_box ?? null,
spatial_payload_holes: annotation.spatial_payload_holes ?? [false],
spatial_payload_child_indices: annotation.spatial_payload_child_indices ?? [[]],
};
if (deep_copy) {
return JSON.parse(JSON.stringify(ret));
Expand Down
2 changes: 1 addition & 1 deletion src/html_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@ export class SliderHandler {
value="${this.default_value}"
/>
<label for="${this.id}" id="${this.id}-value-label" class="ulabel-slider-value-label">
${this.default_value}${this.label_units ? this.label_units : ""}
${this.default_value}${this.label_units ?? ""}
</label>
<div class="ulabel-slider-button-container">
<button id=${this.id}-inc-button class="ulabel-slider-button circle" >
Expand Down
4 changes: 2 additions & 2 deletions src/toolbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1943,13 +1943,13 @@ export class FilterPointDistanceFromRow extends ToolboxItem {
// Check if localStorage has a value for showing the overlay
const show_overlay = get_local_storage_item("filterDistanceShowOverlay");
// Guard against null values
this.show_overlay = show_overlay !== null ? show_overlay : this.show_overlay;
this.show_overlay = show_overlay ?? this.show_overlay;
this.overlay.update_display_overlay(this.show_overlay);

// Check if localStorage has a value for filtering during polyline move
const filter_during_polyline_move = get_local_storage_item("filterDistanceFilterDuringPolylineMove");
// Guard against null values
this.filter_during_polyline_move = filter_during_polyline_move !== null ? filter_during_polyline_move : this.filter_during_polyline_move;
this.filter_during_polyline_move = filter_during_polyline_move ?? this.filter_during_polyline_move;

this.add_styles();

Expand Down
6 changes: 3 additions & 3 deletions src/toolbox_items/keybinds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ export class KeybindsToolboxItem extends ToolboxItem {
const is_customized = this.is_keybind_customized(keybind.config_key!);
const collision_class = has_collision ? " collision" : "";
const customized_class = is_customized ? " customized" : "";
const display_key = keybind.key !== null && keybind.key !== undefined ? keybind.key : "none";
const display_key = keybind.key ?? "none";
const reset_button = is_customized ? `<button class="keybind-reset-btn" data-config-key="${keybind.config_key}" title="Reset to default">↺</button>` : "";

keybinds_html += `
Expand Down Expand Up @@ -829,7 +829,7 @@ export class KeybindsToolboxItem extends ToolboxItem {
const is_customized = this.is_class_keybind_customized(keybind.class_id!);
const collision_class = has_collision ? " collision" : "";
const customized_class = is_customized ? " customized" : "";
const display_key = keybind.key != null ? keybind.key : "none";
const display_key = keybind.key ?? "none";
const reset_button = is_customized ? `<button class="keybind-reset-btn" data-class-id="${keybind.class_id}" title="Reset to default">↺</button>` : "";

keybinds_html += `
Expand Down Expand Up @@ -860,7 +860,7 @@ export class KeybindsToolboxItem extends ToolboxItem {
for (const keybind of other) {
const has_collision = this.has_collision(keybind.key, all_keybinds);
const collision_class = has_collision ? " collision" : "";
const display_key = keybind.key !== null && keybind.key !== undefined ? keybind.key : "none";
const display_key = keybind.key ?? "none";
keybinds_html += `
<div class="keybind-item" title="${keybind.description}">
<span class="keybind-description">${keybind.label}</span>
Expand Down
2 changes: 1 addition & 1 deletion src/toolbox_items/submit_buttons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export class SubmitButtons extends ToolboxItem {
const submit_buttons_by_row: ULabelSubmitButton[][] = [];
// First, get all the unique row numbers.
// If a button doesn't have a row number, it will be placed in row 0.
const row_numbers: Set<number> = new Set(this.submit_buttons.map((button) => button.row_number ? button.row_number : 0));
const row_numbers: Set<number> = new Set(this.submit_buttons.map((button) => button.row_number ?? 0));
// Sort the row numbers
const sorted_row_numbers: number[] = Array.from(row_numbers).sort((a, b) => a - b);
// Group the buttons by row number in ascending order
Expand Down
2 changes: 1 addition & 1 deletion src/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const ULABEL_VERSION = "0.31.0";
export const ULABEL_VERSION = "0.31.1";
Loading