Bug: newly added empty files still show a `-0` diff count
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start with FileDiff#render and the output of parsePatchFiles, using either empty-file patch from the reproduction. Check how the diff count and empty diff body are rendered; the issue also notes deleted empty files as a possible counterpart. Done means the irrelevant -0 is handled and the empty-file diff display is addressed.
Written by the indexing model from the issue text.
Description
Prerequisites
- I have searched for duplicate or closed issues
- I have read the contributing guidelines
Describe the issue
A very "aesthetic" "issue" that could also be a feature request, but fits better in the bug category.
Parsing works fine with empty files added in a PR, but:
- the
-0is present despite not being relevant at all. the+0is arguably a bit weird too, but still better than what GitHub does: showing "whitespace-only change" with no diff count. - no diff is shown at all. this is not a real bug as there is actually nothing to show, but having a diff header with nothing inside it looks off. maybe adding a
File added with no contentor similar would help?
Showcase:
[!NOTE]
The counterpart fix(es) could maybe be applied to deleted empty files too
Reproduction
Use FileDiff#render on the output of parsePatchFiles with this data:
--- /dev/null
+++ whatever.js
OR
diff --git a/whatever.js b/whatever.js
new file mode 100644
index 000000000000..e69de29bb2d1
What browser(s) are you seeing the problem on?
Chrome
What version of @pierre/diffs are you using?
1.0.11
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 226
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 34
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pierrecomputer/pierre
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pierrecomputer/pierre#1187 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pierrecomputer/pierre#1150 · 3 comments ·
Maintainers usually reply within 1 day
-
Bug: Dragging a selection past the edge of an editable CodeView collapses it, then stops it growingOpenbug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
pierrecomputer/pierre#1189 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
pierrecomputer/pierre#1184 · 4 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 63/100
pierrecomputer/pierre#1172 ·
Maintainers usually reply within 1 day
All issues in pierrecomputer/pierre
Similar issues
-
area:editor bug issue-form:bug P0 platform:windows review: low
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
1lck/Lithe-IDEA#1388 ·
Maintainers usually reply within 1 day
-
fix(api): isToolAuditEnabled swallows database read errors on auditToolOperations without loggingOpenarea: backend bug priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
snapotter-hq/SnapOtter#3238 ·
Maintainers usually reply within 1 day
-
rig up --plan times out after 5 s and reports an UNKNOWN outcome while the daemon completes the planOpen
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
modelcontextprotocol/servers#5216 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day