Skip to content

Fix markup code block layout#36578

Merged
wxiaoguang merged 4 commits intogo-gitea:mainfrom
wxiaoguang:fix-codeblock-layout
Feb 11, 2026
Merged

Fix markup code block layout#36578
wxiaoguang merged 4 commits intogo-gitea:mainfrom
wxiaoguang:fix-codeblock-layout

Conversation

@wxiaoguang
Copy link
Copy Markdown
Contributor

No description provided.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 10, 2026
@wxiaoguang
Copy link
Copy Markdown
Contributor Author

image

@silverwind
Copy link
Copy Markdown
Member

Good call about those zoom icons, I was contemplating that change too.

@silverwind
Copy link
Copy Markdown
Member

image

Right side of buttons is not completely aligned. Easiest to validate with a minimum-height diagram.

@silverwind
Copy link
Copy Markdown
Member

silverwind commented Feb 10, 2026

One more suggestion: Add a cursor: grab style to places where the diagram can be dragged. Currently only a part of the area is grabbable and it's not obvious where it can be grabbed. Alternatively make the whole area grabbable, but validate that text selection still works with that.

@wxiaoguang
Copy link
Copy Markdown
Contributor Author

One more suggestion: Add a cursor: grab style to places where the diagram can be dragged. Currently only a part of the area is grabbable and it's not obvious where it can be grabbed. Alternatively make the whole area grabbable, but validate that text selection still works with that.

Don't want to spend time on it.

@silverwind
Copy link
Copy Markdown
Member

silverwind commented Feb 10, 2026

The current drag mechanism breaks the text selection, I will investigate later, imho it is unacceptable not being able to select text in diagrams.

@wxiaoguang
Copy link
Copy Markdown
Contributor Author

The current drag mechanism breaks the text selection, I will investigate later, imho it is unacceptable not being able to select text in diagrams.

No, it doesn't. I have considered about it. If any case is missing, it's easy to add.

image

This comment was marked as resolved.

@silverwind
Copy link
Copy Markdown
Member

silverwind commented Feb 10, 2026

Don't want to spend time on it.

Ask an AI agent to start such work. I recently solved many issues I was not motivated to fix by letting agent start the work, then driving it to completion myself.

@wxiaoguang
Copy link
Copy Markdown
Contributor Author

Don't want to spend time on it.

Ask an AI agent to start such work. I recently solved many issues I was not motivated to fix by letting agent start the work, then driving it to completion myself.

No, don't do that. You can do it in your PR. I don't want AI to pollute my PR

@wxiaoguang
Copy link
Copy Markdown
Contributor Author

I recently solved many issues I was not motivated to fix by letting agent start the work, then driving it to completion myself.

I just see for complicated problems that the author doesn't understand it, I need to spend more time for AI coding, for example: your " Fix syntax highlighting in expanded diff sections #36511 ".

@wxiaoguang
Copy link
Copy Markdown
Contributor Author

I recently solved many issues I was not motivated to fix by letting agent start the work, then driving it to completion myself.

I just see for complicated problems that the author doesn't understand it, I need to spend more time for AI coding, for example: your " Fix syntax highlighting in expanded diff sections #36511 ".

The same to this one. The correct solution is to move the "view controller" to the parent document, and share the "absolute postion" with the copy-button. But your AI only added more and more problematic code like "get keyframes", causes various problems, then all these code is removed now.

@silverwind
Copy link
Copy Markdown
Member

silverwind commented Feb 10, 2026

I just see for complicated problems that the author doesn't understand it

I don't let AI commit code I don't understand. Always review. Sometimes AI comes up with smarter solutions that I am able to. It's definitely useful and it enables me to work faster, especially for big refactors etc.

@wxiaoguang
Copy link
Copy Markdown
Contributor Author

Yep, AI is useful, I also heavily use AI

@wxiaoguang wxiaoguang added this to the 1.26.0 milestone Feb 10, 2026
@wxiaoguang wxiaoguang added the skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features. label Feb 10, 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 Feb 10, 2026
@wxiaoguang
Copy link
Copy Markdown
Contributor Author

The current drag mechanism breaks the text selection, I will investigate later, imho it is unacceptable not being able to select text in diagrams.

No, it doesn't. I have considered about it. If any case is missing, it's easy to add.

@silverwind This PR only improves and doesn't make anything worse. I see nothing else needs to be changed.

@silverwind
Copy link
Copy Markdown
Member

Yes, text selection can (and should) be fixed later.

Copy link
Copy Markdown
Member

@silverwind silverwind left a comment

Choose a reason for hiding this comment

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

Tested, looks good. I don't know why but text selection actually works fine on this branch and does not conflict with the dragging.

@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 Feb 11, 2026
@wxiaoguang
Copy link
Copy Markdown
Contributor Author

Tested, looks good. I don't know why but text selection actually works fine on this branch and does not conflict with the dragging.

I have told you #36578 (comment) , if you have read the code or the reply.

@wxiaoguang wxiaoguang enabled auto-merge (squash) February 11, 2026 03:20
@wxiaoguang wxiaoguang merged commit fd89cee into go-gitea:main Feb 11, 2026
24 checks passed
@wxiaoguang wxiaoguang deleted the fix-codeblock-layout branch February 11, 2026 03:23
silverwind added a commit to silverwind/gitea that referenced this pull request Feb 12, 2026
* origin/main: (34 commits)
  Fine tune diff highlighting (go-gitea#36592)
  Add code editor setting dropdowns (go-gitea#36534)
  Update to go 1.26.0 and golangci-lint 2.9.0 (go-gitea#36588)
  Improve diff highlighting (go-gitea#36583)
  Fix markup code block layout (go-gitea#36578)
  Remove striped tables in UI (go-gitea#36509)
  Fix vertical alignment of `.commit-sign-badge` children (go-gitea#36570)
  Fix mirror sync parser and fix mirror messages (go-gitea#36504)
  Update JS and PY deps (go-gitea#36576)
  Add viewer controller for mermaid (zoom, drag) (go-gitea#36557)
  Misc typescript tweaks (go-gitea#36523)
  Use full-file highlighting for diff sections (go-gitea#36561)
  fix(diff): reprocess htmx content after loading more files (go-gitea#36568)
  [skip ci] Updated translations via Crowdin
  Add wrap to runner label list (go-gitea#36565)
  fix: add dnf5 command for Fedora in RPM package instructions (go-gitea#36527)
  Enable pagination on GiteaDownloader.getIssueReactions() (go-gitea#36549)
  Refactor merge conan and container auth preserve actions taskID (go-gitea#36560)
  Fix assignee sidebar links and empty placeholder after go-gitea#32465 refactor (go-gitea#36559)
  Fix various version parsing problems (go-gitea#36553)
  ...
silverwind added a commit to silverwind/gitea that referenced this pull request Feb 12, 2026
* origin/main: (152 commits)
  Fine tune diff highlighting (go-gitea#36592)
  Add code editor setting dropdowns (go-gitea#36534)
  Update to go 1.26.0 and golangci-lint 2.9.0 (go-gitea#36588)
  Improve diff highlighting (go-gitea#36583)
  Fix markup code block layout (go-gitea#36578)
  Remove striped tables in UI (go-gitea#36509)
  Fix vertical alignment of `.commit-sign-badge` children (go-gitea#36570)
  Fix mirror sync parser and fix mirror messages (go-gitea#36504)
  Update JS and PY deps (go-gitea#36576)
  Add viewer controller for mermaid (zoom, drag) (go-gitea#36557)
  Misc typescript tweaks (go-gitea#36523)
  Use full-file highlighting for diff sections (go-gitea#36561)
  fix(diff): reprocess htmx content after loading more files (go-gitea#36568)
  [skip ci] Updated translations via Crowdin
  Add wrap to runner label list (go-gitea#36565)
  fix: add dnf5 command for Fedora in RPM package instructions (go-gitea#36527)
  Enable pagination on GiteaDownloader.getIssueReactions() (go-gitea#36549)
  Refactor merge conan and container auth preserve actions taskID (go-gitea#36560)
  Fix assignee sidebar links and empty placeholder after go-gitea#32465 refactor (go-gitea#36559)
  Fix various version parsing problems (go-gitea#36553)
  ...
silverwind added a commit to silverwind/gitea that referenced this pull request Feb 14, 2026
* origin/main: (2555 commits)
  automate updating nix flakes (go-gitea#35641)
  Update AGENTS.md instructions (go-gitea#36627)
  use user id in noreply emails (go-gitea#36550)
  feat(db): Improve BuildCaseInsensitiveLike with lowercase (go-gitea#36598)
  [skip ci] Updated translations via Crowdin
  BUG: Fix workflow run jobs API returning null steps (go-gitea#36603)
  Refactor highlight and diff (go-gitea#36599)
  Fix bug when do LFS GC (go-gitea#36500)
  feature to be able to filter project boards by milestones (go-gitea#36321)
  Update emoji data for Unicode 16 (go-gitea#36596)
  Adapt monaco error matching pattern to recent webpack config change (go-gitea#36533)
  Fix a bug user could change another user's primary email (go-gitea#36586)
  fix(repo-editor): disable Monaco `editContext` to avoid bugs with lost focus (go-gitea#36585)
  Fine tune diff highlighting (go-gitea#36592)
  Add code editor setting dropdowns (go-gitea#36534)
  Update to go 1.26.0 and golangci-lint 2.9.0 (go-gitea#36588)
  Improve diff highlighting (go-gitea#36583)
  Fix markup code block layout (go-gitea#36578)
  Remove striped tables in UI (go-gitea#36509)
  Fix vertical alignment of `.commit-sign-badge` children (go-gitea#36570)
  ...

# Conflicts:
#	custom/conf/app.example.ini
#	docs/content/administration/config-cheat-sheet.en-us.md
#	docs/content/administration/config-cheat-sheet.zh-cn.md
#	modules/setting/security.go
#	routers/common/errpage.go
#	services/context/api.go
#	services/context/context.go
Sirherobrine23 pushed a commit to Sirherobrine23/gitea that referenced this pull request Mar 4, 2026
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 skip-changelog This PR is irrelevant for the (next) changelog, for example bug fixes for unreleased features.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants