Skip to content

Make task list checkboxes clickable in the preview tab#37010

Merged
silverwind merged 6 commits intogo-gitea:mainfrom
silverwind:checkpreview
Mar 29, 2026
Merged

Make task list checkboxes clickable in the preview tab#37010
silverwind merged 6 commits intogo-gitea:mainfrom
silverwind:checkpreview

Conversation

@silverwind
Copy link
Copy Markdown
Member

@silverwind silverwind commented Mar 27, 2026

When a checkbox is toggled in the markup preview tab, the change is now synced back to the editor textarea. Extracted a toggleTasklistCheckbox helper to deduplicate the byte-offset toggle logic.

Make task list checkboxes clickable in markdown preview mode and sync
their state back to the editor textarea. Extract shared
toggleTasklistCheckbox helper to deduplicate byte-offset logic.

Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 27, 2026
Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
@silverwind silverwind changed the title Enable task list checkboxes in markdown preview Enable task list checkboxes in markup preview Mar 27, 2026
Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
@silverwind silverwind added the type/enhancement An improvement of existing functionality label Mar 27, 2026
@silverwind silverwind requested a review from Copilot March 27, 2026 10:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Enables interactive task list checkboxes in the ComboMarkdownEditor “Preview” tab and syncs checkbox toggles back into the underlying markdown source, reusing a shared byte-offset toggle helper.

Changes:

  • Extracted a shared toggleTasklistCheckbox helper for byte-position-based [ ] / [x] toggling.
  • Updated existing comment-markup tasklist handling to use the shared helper.
  • Enabled preview-pane tasklist checkboxes and wired them to update the editor content on toggle.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
web_src/js/markup/tasklist.ts Adds shared checkbox-toggle helper and refactors existing comment markup handler to use it.
web_src/js/features/comp/ComboMarkdownEditor.ts Enables checkboxes in markdown preview and syncs toggle back to editor content.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@silverwind silverwind changed the title Enable task list checkboxes in markup preview Make task list checkboxes clickable in the markdown preview tab Mar 28, 2026
silverwind and others added 2 commits March 28, 2026 14:37
* origin/main:
  Fix relative-time RangeError (go-gitea#37021)
  Restyle Workflow Graph (go-gitea#36912)
  Update message severity colors, fix navbar double border (go-gitea#37019)
  Clean up checkbox cursor styles (go-gitea#37016)
  add missing cron tasks to example ini (go-gitea#37012)
  Add e2e tests for server push events (go-gitea#36879)
- Trigger triggerEditorContentChanged after checkbox toggle in preview
- Clarify JSDoc for toggleTasklistCheckbox position parameter
- Add unit tests for toggleTasklistCheckbox

Co-Authored-By: Claude (Opus 4.6) <noreply@anthropic.com>
@silverwind silverwind changed the title Make task list checkboxes clickable in the markdown preview tab Make task list checkboxes clickable in the preview tab Mar 28, 2026
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Mar 28, 2026
Copy link
Copy Markdown
Contributor

@TheFox0x7 TheFox0x7 left a comment

Choose a reason for hiding this comment

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

tested, works well

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Mar 29, 2026
@silverwind silverwind enabled auto-merge (squash) March 29, 2026 18:47
@silverwind silverwind added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 29, 2026
@silverwind silverwind merged commit 50a1dc9 into go-gitea:main Mar 29, 2026
26 checks passed
@silverwind silverwind deleted the checkpreview branch March 29, 2026 18:48
@GiteaBot GiteaBot added this to the 1.26.0 milestone Mar 29, 2026
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Mar 29, 2026
zjjhot added a commit to zjjhot/gitea that referenced this pull request Mar 30, 2026
* main: (35 commits)
  Correct swagger annotations for enums, status codes, and notification state (go-gitea#37030)
  Update Nix flake (go-gitea#37024)
  Bump go and python versions in nix flake (go-gitea#37031)
  Make task list checkboxes clickable in the preview tab (go-gitea#37010)
  Add support for in_progress event in workflow_run webhook (go-gitea#36979)
  Fix various problems (go-gitea#37029)
  Update AI Contribution Policy (go-gitea#37022)
  Migrate from webpack to vite (go-gitea#37002)
  Upgrade yaml (go-gitea#37015)
  Fix issue label deletion with Actions tokens (go-gitea#37013)
  Hide delete branch or tag buttons in mirror or archived repositories. (go-gitea#37006)
  Update AGENTS.md with additional guidelines (go-gitea#37018)
  Optimize 'refreshAccesses' to perform update without removing then adding (go-gitea#35702)
  Fix relative-time RangeError (go-gitea#37021)
  Restyle Workflow Graph (go-gitea#36912)
  Update message severity colors, fix navbar double border (go-gitea#37019)
  Clean up checkbox cursor styles (go-gitea#37016)
  add missing cron tasks to example ini (go-gitea#37012)
  Add e2e tests for server push events (go-gitea#36879)
  Update JS dependencies (go-gitea#37001)
  ...
silverwind added a commit to silverwind/gitea that referenced this pull request Mar 30, 2026
* origin/main: (69 commits)
  Correct swagger annotations for enums, status codes, and notification state (go-gitea#37030)
  Update Nix flake (go-gitea#37024)
  Bump go and python versions in nix flake (go-gitea#37031)
  Make task list checkboxes clickable in the preview tab (go-gitea#37010)
  Add support for in_progress event in workflow_run webhook (go-gitea#36979)
  Fix various problems (go-gitea#37029)
  Update AI Contribution Policy (go-gitea#37022)
  Migrate from webpack to vite (go-gitea#37002)
  Upgrade yaml (go-gitea#37015)
  Fix issue label deletion with Actions tokens (go-gitea#37013)
  Hide delete branch or tag buttons in mirror or archived repositories. (go-gitea#37006)
  Update AGENTS.md with additional guidelines (go-gitea#37018)
  Optimize 'refreshAccesses' to perform update without removing then adding (go-gitea#35702)
  Fix relative-time RangeError (go-gitea#37021)
  Restyle Workflow Graph (go-gitea#36912)
  Update message severity colors, fix navbar double border (go-gitea#37019)
  Clean up checkbox cursor styles (go-gitea#37016)
  add missing cron tasks to example ini (go-gitea#37012)
  Add e2e tests for server push events (go-gitea#36879)
  Update JS dependencies (go-gitea#37001)
  ...

# Conflicts:
#	package.json
#	pnpm-lock.yaml
#	tests/e2e/utils.ts
#	web_src/css/themes/theme-gitea-dark.css
#	web_src/css/themes/theme-gitea-light.css
#	web_src/js/bootstrap.ts
#	web_src/js/features/codeeditor.ts
#	web_src/js/modules/errors.test.ts
#	webpack.config.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/frontend type/enhancement An improvement of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants