Skip to content

Shortcuts streamline & help page the second - #1612

Merged
jtojnar merged 5 commits into
fossar:masterfrom
Denperidge:keybindings
Sep 12, 2026
Merged

jtojnar merged 5 commits into
fossar:masterfrom
Denperidge:keybindings

Conversation

@Denperidge

Copy link
Copy Markdown
Contributor

Re-open because Github doesnt like force pushes. Alas. Cleaned up & finished version of #1609 !

@netlify

netlify Bot commented Aug 18, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for selfoss canceled.

Name Link
🔨 Latest commit 7459407
🔍 Latest deploy log https://app.netlify.com/projects/selfoss/deploys/6aa5967a992285000881f649

Comment thread client/styles/main.scss Outdated
Comment thread client/js/shortcuts.ts Outdated

@jtojnar jtojnar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This looks very good already, just few details.

Comment thread client/js/shortcuts.ts Outdated
Comment thread client/js/shortcuts.ts Outdated
Comment thread client/styles/main.scss Outdated
Comment thread client/js/templates/App.tsx Outdated
Comment thread client/js/templates/HelpShortcuts.tsx Outdated
Comment thread client/js/templates/HelpShortcuts.tsx Outdated
Comment thread client/js/shortcuts.ts Outdated
Comment thread client/js/templates/HelpShortcuts.tsx Outdated
Comment thread client/js/shortcuts.ts
Comment thread client/js/templates/App.tsx Outdated
@Denperidge

Copy link
Copy Markdown
Contributor Author

@jtojnar Thanks for the review! Do I amend the changes into the original commits, or apply them as individual commits?

@jtojnar

jtojnar commented Aug 19, 2026

Copy link
Copy Markdown
Member

Please amend/use fixup commits and then git rebase -i --autosquash so that the history remains clear and each commit has working selfoss with passing CI. The i18n changes can go to a separate commit since without any translations the UI will be in English anyway.

@Denperidge
Denperidge force-pushed the keybindings branch 4 times, most recently from 1731898 to c604290 Compare August 21, 2026 22:36
Comment thread client/js/templates/HelpShortcuts.tsx Outdated
readableKeycombo = <kbd>{keybinding.readableName}</kbd>;
} else if (keycombo.includes('+')) {
const keys = keycombo
.split('+') // key={key} required for TS

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// key={key} required for TS

This is general react thing: https://react.dev/learn/rendering-lists

It should not really be necessary here as the keybindings will never change but the compiler unfortunately is not smart enough.

I am surprised it does not complain about the fragment containing dt + dd.

Comment thread client/js/templates/HelpShortcuts.tsx Outdated
Comment thread client/js/shortcuts.ts
Comment thread client/js/shortcuts.ts Outdated
Comment thread client/js/shortcuts.ts
description: 'show help',
action: () => {},
},
'[Shift]+?': {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also add it to the static docs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! Although, perhaps finishing up the auto-generated docs table might be better to make sure nothing falls through the cracks properly? Shift+R is also undocumented in the docs as of now

@Denperidge
Denperidge force-pushed the keybindings branch 2 times, most recently from dd420ff to d918445 Compare August 23, 2026 16:54
@Denperidge
Denperidge requested a review from jtojnar August 23, 2026 16:55
@Denperidge

Copy link
Copy Markdown
Contributor Author

With the exception of your fragment comment, everything has been implemented! Some notes:

  • Created a general Dialog component with a close button & scroll freeze for future proofing
  • I resolved your review comments as i implemented things (as an easy to-do list), but feel free to open a new one/re-open an old one if it's not resolved to your standards

Comment thread client/js/templates/Dialog.tsx Outdated
Comment thread client/js/templates/Dialog.tsx Outdated
Comment thread client/js/shortcuts.ts Outdated
@Denperidge
Denperidge force-pushed the keybindings branch 2 times, most recently from b04039f to e342a0f Compare August 24, 2026 10:14
@Denperidge
Denperidge requested a review from jtojnar August 24, 2026 10:14

@jtojnar jtojnar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks almost perfect, just two last nits.

Comment thread client/styles/main.scss Outdated
Comment thread client/js/templates/Dialog.tsx Outdated
@Denperidge
Denperidge force-pushed the keybindings branch 5 times, most recently from 288c375 to 1597b69 Compare September 9, 2026 10:49
@Denperidge

Denperidge commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor Author

I am having an incredibly weird issue locally.

npm run fix

[nix-shell:~/Documents/Programming/selfoss]$ npm run fix

> fix
> npm run fix:client && npm run fix:server


> fix:client
> npm run --prefix client/ fix


> fix
> npm run fix:js && npm run fix:styles


> fix:js
> npm run fix:js:prettify && npm run fix:js:lint


> fix:js:prettify
> npm run check:js:prettify -- --write


> check:js:prettify
> prettier '**.{tsx,ts,js}' --check --write

Checking formatting...
All matched files use Prettier code style!

> fix:js:lint
> npm run check:js:lint -- --fix


> check:js:lint
> eslint --fix


/home/cat/Documents/Programming/selfoss/client/js/helpers/authorizations.ts
  12:53  warning  React Hook useMemo has an unnecessary dependency: 'loggedIn'. Either exclude it or remove the dependency array  react-hooks/exhaustive-deps
  18:55  warning  React Hook useMemo has an unnecessary dependency: 'loggedIn'. Either exclude it or remove the dependency array  react-hooks/exhaustive-deps
  24:54  warning  React Hook useMemo has an unnecessary dependency: 'loggedIn'. Either exclude it or remove the dependency array  react-hooks/exhaustive-deps

/home/cat/Documents/Programming/selfoss/client/js/templates/EntriesPage.tsx
  317:8  warning  React Hook useMemo has a missing dependency: 'params.id'. Either include it or remove the dependency array           react-hooks/exhaustive-deps
  323:8  warning  React Hook useMemo has a missing dependency: 'navSourcesExpanded'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/home/cat/Documents/Programming/selfoss/client/js/templates/LoginForm.tsx
  110:9  warning  React Hook useCallback has a missing dependency: 'submitAction'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

✖ 6 problems (0 errors, 6 warnings)


> fix:styles
> npm run fix:styles:lint && npm run fix:styles:prettify


> fix:styles:lint
> npm run check:styles:lint -- --fix


> check:styles:lint
> stylelint styles/*.scss --fix


> fix:styles:prettify
> npm run check:styles:prettify -- --write


> check:styles:prettify
> prettier styles/*.scss --check --write

Checking formatting...
All matched files use Prettier code style!

> fix:server
> composer run-script fix

> php-cs-fixer fix --verbose --diff
You are running PHP CS Fixer on PHP 8.4.22, but the minimum PHP version supported by your project in composer.json is PHP 8.2. Executing PHP CS Fixer on newer PHP versions may introduce syntax or features not yet available in PHP 8.2, which could cause issues under that version. It is recommended to run PHP CS Fixer on PHP 8.2, to fit your project specifics.
If you need help while solving warnings, ask at https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/, we will help you!

PHP CS Fixer 3.95.18 (d1fc711) Adalbertus by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.4.22
Loaded config default from "/home/cat/Documents/Programming/selfoss/.php-cs-fixer.php".
Running analysis on 7 cores with 10 files per process.
Using cache file ".php-cs-fixer.cache".
 118/118 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%


Fixed 0 of 118 files in 0.376 seconds, 18.00 MB memory used

The file is changed

[nix-shell:~/Documents/Programming/selfoss]$ git status
On branch keybindings
Your branch is up to date with 'origin/keybindings'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   client/styles/main.scss

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	cat.md
	data/cache/selfoss/
	nohup.out

no changes added to commit (use "git add" and/or "git commit -a")

Commit change

[nix-shell:~/Documents/Programming/selfoss]$ git add client/styles/main.scss

[nix-shell:~/Documents/Programming/selfoss]$ git commit -m "dialog fix"
[keybindings 55b778a1] dialog fix
 1 file changed, 1 deletion(-)

[nix-shell:~/Documents/Programming/selfoss]$ git rebase -i HEAD~5
Successfully rebased and updated refs/heads/keybindings.

Push

[nix-shell:~/Documents/Programming/selfoss]$ git push origin +keybindings
Enumerating objects: 35, done.
Counting objects: 100% (35/35), done.
Delta compression using up to 8 threads
Compressing objects: 100% (23/23), done.
Writing objects: 100% (23/23), 3.86 KiB | 3.86 MiB/s, done.
Total 23 (delta 18), reused 0 (delta 0), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (18/18), completed with 11 local objects.
To https://github.com/Denperidge/contrib-selfoss.git
 + 288c3753...1597b69b keybindings -> keybindings (forced update)

Problem returns

[nix-shell:~/Documents/Programming/selfoss]$ npm run fix

> fix
> npm run fix:client && npm run fix:server


> fix:client
> npm run --prefix client/ fix


> fix
> npm run fix:js && npm run fix:styles


> fix:js
> npm run fix:js:prettify && npm run fix:js:lint


> fix:js:prettify
> npm run check:js:prettify -- --write


> check:js:prettify
> prettier '**.{tsx,ts,js}' --check --write

Checking formatting...
All matched files use Prettier code style!

> fix:js:lint
> npm run check:js:lint -- --fix


> check:js:lint
> eslint --fix


/home/cat/Documents/Programming/selfoss/client/js/helpers/authorizations.ts
  12:53  warning  React Hook useMemo has an unnecessary dependency: 'loggedIn'. Either exclude it or remove the dependency array  react-hooks/exhaustive-deps
  18:55  warning  React Hook useMemo has an unnecessary dependency: 'loggedIn'. Either exclude it or remove the dependency array  react-hooks/exhaustive-deps
  24:54  warning  React Hook useMemo has an unnecessary dependency: 'loggedIn'. Either exclude it or remove the dependency array  react-hooks/exhaustive-deps

/home/cat/Documents/Programming/selfoss/client/js/templates/EntriesPage.tsx
  317:8  warning  React Hook useMemo has a missing dependency: 'params.id'. Either include it or remove the dependency array           react-hooks/exhaustive-deps
  323:8  warning  React Hook useMemo has a missing dependency: 'navSourcesExpanded'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

/home/cat/Documents/Programming/selfoss/client/js/templates/LoginForm.tsx
  110:9  warning  React Hook useCallback has a missing dependency: 'submitAction'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

✖ 6 problems (0 errors, 6 warnings)


> fix:styles
> npm run fix:styles:lint && npm run fix:styles:prettify


> fix:styles:lint
> npm run check:styles:lint -- --fix


> check:styles:lint
> stylelint styles/*.scss --fix


> fix:styles:prettify
> npm run check:styles:prettify -- --write


> check:styles:prettify
> prettier styles/*.scss --check --write

Checking formatting...
[warn] styles/main.scss
[warn] Code style issues fixed in the above file.

> fix:server
> composer run-script fix

> php-cs-fixer fix --verbose --diff
You are running PHP CS Fixer on PHP 8.4.22, but the minimum PHP version supported by your project in composer.json is PHP 8.2. Executing PHP CS Fixer on newer PHP versions may introduce syntax or features not yet available in PHP 8.2, which could cause issues under that version. It is recommended to run PHP CS Fixer on PHP 8.2, to fit your project specifics.
If you need help while solving warnings, ask at https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/discussions/, we will help you!

PHP CS Fixer 3.95.18 (d1fc711) Adalbertus by Fabien Potencier, Dariusz Ruminski and contributors.
PHP runtime: 8.4.22
Loaded config default from "/home/cat/Documents/Programming/selfoss/.php-cs-fixer.php".
Running analysis on 7 cores with 10 files per process.
Using cache file ".php-cs-fixer.cache".
 118/118 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%


Fixed 0 of 118 files in 0.325 seconds, 18.00 MB memory used

[nix-shell:~/Documents/Programming/selfoss]$

Rebasing from upstream didn't help. The issue seems to occur after git pushing. I'm presuming there's something wrong on my end

…from the docs

- Adapted arrow left & arrow right to the symbol used in docs
- Exception: "item" is replaced by "entry" for consistency
- Exception: Renamed throws to throw to previous / throw to next

Link to docs as of development of this commit:
https://github.com/fossar/selfoss/blob/81187a39a1b1db0e2d48fb0fccad949ca771a635/docs/content/docs/usage/shortcuts.md
@jtojnar

jtojnar commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Did you try npm install after rebase? There might be a newer version of prettier on master.

@Denperidge

Denperidge commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor Author

Did you try npm install after rebase? There might be a newer version of prettier on master.

No change I'm afraid!

EDIT: Of course. The newline was accidentally added to the last commit, so fixing up the second to last commit had no effect. Fixed it now

@jtojnar jtojnar left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, though looks like it is no longer styled.

Comment thread client/js/shortcuts.ts
Comment thread client/js/templates/Dialog.tsx Outdated
Comment thread client/styles/main.scss
Denperidge and others added 2 commits September 12, 2026 20:10
Thanks to Jan for getting it to display using <dialog>!
And dealing with a bunch of my questions.

Co-authored-by: Jan Tojnar <jtojnar@gmail.com>
@Denperidge

Copy link
Copy Markdown
Contributor Author

Thanks, though looks like it is no longer styled.

Thanks for the callout! Fixed my rebasing with all the suggested changes

@Denperidge
Denperidge requested a review from jtojnar September 12, 2026 18:15
@jtojnar
jtojnar merged commit 7459407 into fossar:master Sep 12, 2026
10 checks passed
@jtojnar

jtojnar commented Sep 12, 2026

Copy link
Copy Markdown
Member

Perfect. Thanks.

@jtojnar jtojnar added this to the 2.20 milestone Sep 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants