Refactor web app client source code #105

Merged
luca0N merged 11 commits from dev_client_refactor_consistency into dev 2026-09-02 00:35:49 +00:00
Owner

Make the web app client source code consistent.

  • Follow the string literal policy
  • Follow the import policy
  • Trailing commas
  • Proper header documentation
  • Tab consistency

Policies

The policies below define the coding convention for the Lanbassador web app client project.

String literals

All string literals must be enclosed with quotation mark characters ". Apostrophe characters (') for enclosing string literals are allowed for string literals with quotation marks in them, so as to avoid having to escape the quotation mark character.

Importing

When importing multiple identifiers from other sources, use a trailing comma (after the last identifier that is being imported):

import { MY_CONST, MyClass, } from "./Sample";
//                        ^

Indentation

All web app client source files should use the tab character (\t) to indent lines, with the exception of the npm vendored files (package.json and package-lock.json), as these are auto-generated.

Visibility

All class methods and fields must explicitly declare their visibility (e.g., private, protected, public), unless they are overridden and lack a visibility modifier on the parent class.

Make the web app client source code consistent. - [x] Follow the string literal policy - [x] Follow the import policy - [x] Trailing commas - [x] Proper header documentation - [x] Tab consistency ### Policies The policies below define the coding convention for the Lanbassador web app client project. #### String literals All string literals must be enclosed with quotation mark characters `"`. Apostrophe characters (`'`) for enclosing string literals are allowed for string literals with quotation marks in them, so as to avoid having to escape the quotation mark character. #### Importing When importing multiple identifiers from other sources, use a trailing comma (after the last identifier that is being imported): ```ts import { MY_CONST, MyClass, } from "./Sample"; // ^ ``` #### Indentation All web app client source files should use the tab character (`\t`) to indent lines, with the exception of the npm vendored files (`package.json` and `package-lock.json`), as these are auto-generated. #### Visibility All class methods and fields must explicitly declare their visibility (e.g., `private`, `protected`, `public`), unless they are overridden and lack a visibility modifier on the parent class.
luca0N self-assigned this 2026-08-23 23:30:17 +00:00
Use quotes on all web app string literals
All checks were successful
/ Test client i18n (push) Successful in 42s
/ Test client (push) Successful in 35s
b8aee86075
Perform minor code refactoring in the web app client by replacing all
apostrophe characters with quotation mark characters.  Prior to this
commit, string literals were inconsistent, so this commit aims to change
that and improve the code quality by keeping everything consistent.

As such, all string literals, from this point forward, should use
quotation mark characters for string literals; unless if used to avoid
escaping strings with quotation marks in them.
luca0N force-pushed dev_client_refactor_consistency from b8aee86075
All checks were successful
/ Test client i18n (push) Successful in 42s
/ Test client (push) Successful in 35s
to 86f6e006bb
All checks were successful
/ Test client i18n (push) Successful in 42s
/ Test client (push) Successful in 35s
2026-08-24 22:17:47 +00:00
Compare
Refactor Vitest base config file
All checks were successful
/ Test client i18n (push) Successful in 41s
/ Test client (push) Successful in 36s
b38b614f5a
Add missing license header to the Vitest base config source file, and
omit line breaks in empty object.
Author
Owner

Previous force-push operation from b8aee86075 to 86f6e006bb was made to include the same change on another file that was missing from the commit.

Previous force-push operation from b8aee86075 to 86f6e006bb was made to include the same change on another file that was missing from the commit.
luca0N force-pushed dev_client_refactor_consistency from b38b614f5a
All checks were successful
/ Test client i18n (push) Successful in 41s
/ Test client (push) Successful in 36s
to 2fbab9ac6b
All checks were successful
/ Test client i18n (push) Successful in 40s
/ Test client (push) Successful in 36s
2026-08-24 22:27:58 +00:00
Compare
Author
Owner

Previous force-push operation from b38b614f5a to 2fbab9ac6b was made to fix the license header in a file.

Previous force-push operation from b38b614f5a to 2fbab9ac6b was made to fix the license header in a file.
Use trailing comma on import identifier list
Some checks failed
/ Test client i18n (push) Failing after 40s
/ Test client (push) Successful in 35s
5c0222b892
Use trailing comma when importing multiple identifiers in the web app
source code, and break identifiers in long lines on separate lines.
luca0N force-pushed dev_client_refactor_consistency from 5c0222b892
Some checks failed
/ Test client i18n (push) Failing after 40s
/ Test client (push) Successful in 35s
to 72415481f3
All checks were successful
/ Test client i18n (push) Successful in 42s
/ Test client (push) Successful in 36s
2026-08-25 22:39:19 +00:00
Compare
Author
Owner

Previous force-push operation from 5c0222b892 to 72415481f3 was made to add missing changes to the i18n web app messages files.

Previous force-push operation from 5c0222b892 to 72415481f3 was made to add missing changes to the i18n web app messages files.
Add comment headers to important identifiers that lacked one.
Add trailing comma after the last pair in web app
All checks were successful
/ Test client i18n (push) Successful in 41s
/ Test client (push) Successful in 34s
c8d017f804
Add missing trailing comma after the last key-value pair in all web app
objects, so as to follow the de facto code conventions of the project.
luca0N force-pushed dev_client_refactor_consistency from c8d017f804
All checks were successful
/ Test client i18n (push) Successful in 41s
/ Test client (push) Successful in 34s
to 9cc7124e4f
All checks were successful
/ Test client i18n (push) Successful in 40s
/ Test client (push) Successful in 34s
2026-08-26 23:06:31 +00:00
Compare
luca0N force-pushed dev_client_refactor_consistency from 9cc7124e4f
All checks were successful
/ Test client i18n (push) Successful in 40s
/ Test client (push) Successful in 34s
to 3b63b7b206
All checks were successful
/ Test client i18n (push) Successful in 39s
/ Test client (push) Successful in 33s
2026-08-26 23:08:20 +00:00
Compare
Author
Owner

Previous force-push operation from c8d017f804 to 9cc7124e4f was made to bump the year range in the source file header. Some other files that have an outdated year range may not have been modified, as the changes that were introduced in them are very trivial.

Previous force-push operation from from 9cc7124e4f to 3b63b7b206 was made to correct a commit which used tab characters instead of spaces, unlike the rest of the web app client source tree.

Previous force-push operation from c8d017f804 to 9cc7124e4f was made to bump the year range in the source file header. Some other files that have an outdated year range may not have been modified, as the changes that were introduced in them are very trivial. Previous force-push operation from from 9cc7124e4f to 3b63b7b206 was made to correct a commit which used tab characters instead of spaces, unlike the rest of the web app client source tree.
Author
Owner

Speaking of tabs, I think all indentation in the web app source code should be changed to tabs instead of spaces, since both the server and liblanbassador source trees are using tab characters.

To be honest, I was just using whatever the default was in my text editor, so that is why it's different for the web app client source code. It would be a great idea to take advantage of this pull request and fix this issue now.

I could either write a workflow for checking the presence of space indentation (instead of tabs) or write a Git hook to fix this. I will probably do the latter, though it won't be possible for others to use it, unless I enforce it via server hooks.

Speaking of tabs, I think all indentation in the web app source code should be changed to tabs instead of spaces, since both the server and liblanbassador source trees are using tab characters. To be honest, I was just using whatever the default was in my text editor, so that is why it's different for the web app client source code. It would be a great idea to take advantage of this pull request and fix this issue now. I could either write a workflow for checking the presence of space indentation (instead of tabs) or write a Git hook to fix this. I will probably do the latter, though it won't be possible for others to use it, unless I enforce it via server hooks.
Add missing trailing semicolon in PaginatorIntl
All checks were successful
/ Test client i18n (push) Successful in 39s
/ Test client (push) Successful in 36s
97f15740f9
In the `PaginatorIntl.ts` source file, add missing semicolons at the end
of class fields.
Use tab characters for indentation in web app
All checks were successful
/ Test client i18n (push) Successful in 42s
/ Test client (push) Successful in 38s
594231de86
In the web app client source code, replace all indentation using space
characters with the tab character, to keep it consistent with the other
library and server source code.

As an exception, the auto-generated files from npm (`package.json` and
`package-lock.json`) have not been modified, as any changes made
manually to them would be eventually lost.
Remove trailing spaces from source files
All checks were successful
/ Test client i18n (push) Successful in 41s
/ Test client (push) Successful in 36s
69145455b0
Remote trailing spaces on the web app client source files.
luca0N changed title from WIP: Refactor web app client source code to Refactor web app client source code 2026-08-27 22:39:47 +00:00
luca0N force-pushed dev_client_refactor_consistency from 69145455b0
All checks were successful
/ Test client i18n (push) Successful in 41s
/ Test client (push) Successful in 36s
to d53afed6b0
All checks were successful
/ Test client i18n (push) Successful in 42s
/ Test client (push) Successful in 37s
2026-08-28 11:27:44 +00:00
Compare
Author
Owner

Previous force-push operation from 69145455b0 to d53afed6b0 was made to fix incorrect indentation in ServerComms.ts.

Previous force-push operation from 69145455b0 to d53afed6b0 was made to fix incorrect indentation in `ServerComms.ts`.
@ -83,0 +79,4 @@
.subscribe({
next: r => {
if (!r.ok || r.body == null)
reject("An unknown error occurred while attempting to authenticate.");
Author
Owner

Incorrect indentation.

Incorrect indentation.
luca0N marked this conversation as resolved
@ -86,1 +84,3 @@
reject("An unknown error occurred while attempting to authenticate.")
const response: any = r.body;
if (response.response_code !== 0)
reject("An unknown error occurred while attempting to authenticate.");
Author
Owner

Incorrect indentation.

Incorrect indentation.
luca0N marked this conversation as resolved
luca0N force-pushed dev_client_refactor_consistency from d53afed6b0
All checks were successful
/ Test client i18n (push) Successful in 42s
/ Test client (push) Successful in 37s
to 47d24d5f34
All checks were successful
/ Test client i18n (push) Successful in 40s
/ Test client (push) Successful in 36s
2026-08-30 23:53:45 +00:00
Compare
Author
Owner

Previous force-push operation from d53afed6b0 to 47d24d5f34 was made to fix comments 2168 and 2169.

Previous force-push operation from d53afed6b0 to 47d24d5f34 was made to fix comments [2168](https://git.luca0n.com/luca0N/lanbassador/pulls/105#issuecomment-2168) and [2169](https://git.luca0n.com/luca0N/lanbassador/pulls/105#issuecomment-2169).
luca0N referenced this pull request from a commit 2026-08-31 22:54:03 +00:00
Format web app client prepare script
All checks were successful
/ Test client i18n (push) Successful in 40s
/ Test client (push) Successful in 36s
4bc779dce5
Format the web app clietn `prepare` script by fixing its indentation and
following established coding conventions[^1].

[^1]: Coding conventions defined on !105.
Use explicit function privacy modifiers
Some checks failed
/ Test client i18n (push) Failing after 39s
/ Test client (push) Failing after 34s
14547ad915
Explicitly declare function visibility on all web app client functions.
luca0N referenced this pull request from a commit 2026-09-02 00:01:52 +00:00
luca0N force-pushed dev_client_refactor_consistency from 14547ad915
Some checks failed
/ Test client i18n (push) Failing after 39s
/ Test client (push) Failing after 34s
to ff6e61e669
Some checks failed
/ Test client i18n (push) Failing after 41s
/ Test client (push) Failing after 32s
2026-09-02 00:01:53 +00:00
Compare
Author
Owner

Previous force-push operation from 14547ad915 to ff6e61e669 was made to include missing changes that were left out of the commit.

Previous force-push operation from 14547ad915 to ff6e61e669 was made to include missing changes that were left out of the commit.
luca0N force-pushed dev_client_refactor_consistency from ff6e61e669
Some checks failed
/ Test client i18n (push) Failing after 41s
/ Test client (push) Failing after 32s
to 2dc51cd719
All checks were successful
/ Test client i18n (push) Successful in 45s
/ Test client (push) Successful in 38s
2026-09-02 00:04:18 +00:00
Compare
Author
Owner

Previous force-push operation from ff6e61e669 to 2dc51cd719 was made to fix a build error, stemmed from an incorrect function access modifier.

Previous force-push operation from ff6e61e669 to 2dc51cd719 was made to fix a build error, stemmed from an incorrect function access modifier.
luca0N referenced this pull request from a commit 2026-09-02 00:21:31 +00:00
luca0N force-pushed dev_client_refactor_consistency from 2dc51cd719
All checks were successful
/ Test client i18n (push) Successful in 45s
/ Test client (push) Successful in 38s
to a49dd7e049
All checks were successful
/ Test client i18n (push) Successful in 45s
/ Test client (push) Successful in 38s
2026-09-02 00:21:31 +00:00
Compare
Author
Owner

Previous force-push operation from 2dc51cd719 to a49dd7e049 was made to fix indentation on some lines that were left over.

Previous force-push operation from 2dc51cd719 to a49dd7e049 was made to fix indentation on some lines that were left over.
luca0N referenced this pull request from a commit 2026-09-02 00:31:09 +00:00
luca0N force-pushed dev_client_refactor_consistency from a49dd7e049
All checks were successful
/ Test client i18n (push) Successful in 45s
/ Test client (push) Successful in 38s
to 596d8c4d10
All checks were successful
/ Test client i18n (push) Successful in 43s
/ Test client (push) Successful in 37s
2026-09-02 00:31:09 +00:00
Compare
Use visibility modifiers on class fields
All checks were successful
/ Test client i18n (push) Successful in 43s
/ Test client (push) Successful in 38s
86eccb39ee
Use explicit visibility modifiers on all class fields.
Author
Owner

Previous force-push operation from a49dd7e049 to 596d8c4d10 was made to include missing documentation for the ServerComms class.

Previous force-push operation from a49dd7e049 to 596d8c4d10 was made to include missing documentation for the `ServerComms` class.
luca0N deleted branch dev_client_refactor_consistency 2026-09-02 00:35:49 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
luca0N/lanbassador!105
No description provided.