mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-04 00:28:33 +00:00
Implement bug issues listing tool
Co-authored-by: JimmFly <102217452+JimmFly@users.noreply.github.com>
This commit is contained in:
53
BUG_ISSUES.md
Normal file
53
BUG_ISSUES.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# Ten Most Recent Bug Issues in toeverything/AFFiNE
|
||||
|
||||
This is a simple list of the ten most recent bug issues from the toeverything/AFFiNE GitHub repository:
|
||||
|
||||
## 🐛 Open Issues
|
||||
|
||||
1. **#12128** - [Bug]: Edgeless Export Frames as Image (PNG/SVG)
|
||||
- Created: May 5, 2025 by @fallsdevil
|
||||
- https://github.com/toeverything/AFFiNE/issues/12128
|
||||
|
||||
2. **#12115** - [Bugt]: add a way to zoom without needing a middle mouse button
|
||||
- Created: May 2, 2025 by @gabrielcamilo0321
|
||||
- https://github.com/toeverything/AFFiNE/issues/12115
|
||||
|
||||
3. **#11656** - [Bug]: Attachment in database view is not visible on the shared view of the page
|
||||
- Created: Apr 13, 2025 by @wikinikiwings
|
||||
- https://github.com/toeverything/AFFiNE/issues/11656
|
||||
|
||||
4. **#11515** - [Bug]: Input text exceeds before character selection
|
||||
- Created: Apr 7, 2025 by @Edit-Mr
|
||||
- https://github.com/toeverything/AFFiNE/issues/11515
|
||||
|
||||
## ✅ Recently Closed Issues
|
||||
|
||||
5. **#11719** - [Bug]: Web frontend ignores AFFINE_SERVER_SUB_PATH
|
||||
- Created: Apr 15, 2025 by @jorne
|
||||
- https://github.com/toeverything/AFFiNE/issues/11719
|
||||
|
||||
6. **#9526** - journals's title(and its property) get lost after exporting and importing
|
||||
- Created: Jan 5, 2025 by @happyZYM
|
||||
- https://github.com/toeverything/AFFiNE/issues/9526
|
||||
|
||||
7. **#8559** - Loss folder information when import Workspace
|
||||
- Created: Oct 21, 2024 by @Markche1985
|
||||
- https://github.com/toeverything/AFFiNE/issues/8559
|
||||
|
||||
8. **#7937** - Linux App version bugged - JavaScript errors since last update
|
||||
- Created: Aug 21, 2024 by @MindHack
|
||||
- https://github.com/toeverything/AFFiNE/issues/7937
|
||||
|
||||
9. **#7881** - [bug] Opening Docs in new tabs redirects to app.affine.pro
|
||||
- Created: Aug 15, 2024 by @compgeniuses
|
||||
- https://github.com/toeverything/AFFiNE/issues/7881
|
||||
|
||||
10. **#7822** - Linked docs in the sidebar cannot be sorted or ordered
|
||||
- Created: Aug 9, 2024 by @JimmFly
|
||||
- https://github.com/toeverything/AFFiNE/issues/7822
|
||||
|
||||
---
|
||||
|
||||
**Summary**: 4 open issues, 6 closed issues
|
||||
|
||||
*This list was generated using the bug-issues tool in tools/bug-issues/*
|
||||
86
tools/bug-issues/README.md
Normal file
86
tools/bug-issues/README.md
Normal file
@@ -0,0 +1,86 @@
|
||||
# Bug Issues Tool
|
||||
|
||||
A simple Node.js tool to list the ten most recent bug issues from the toeverything/AFFiNE GitHub repository.
|
||||
|
||||
## Usage
|
||||
|
||||
### Demo Mode (Recommended)
|
||||
|
||||
To see the tool in action with pre-fetched data:
|
||||
|
||||
```bash
|
||||
# From the root of the AFFiNE repository
|
||||
node tools/bug-issues/demo.js
|
||||
```
|
||||
|
||||
### Live Data Mode
|
||||
|
||||
To fetch live data from GitHub API:
|
||||
|
||||
```bash
|
||||
# From the root of the AFFiNE repository
|
||||
node tools/bug-issues/index.js
|
||||
|
||||
# Or with GitHub token for higher rate limits
|
||||
GITHUB_TOKEN=your_token_here node tools/bug-issues/index.js
|
||||
```
|
||||
|
||||
Or from the tools/bug-issues directory:
|
||||
|
||||
```bash
|
||||
# Demo mode
|
||||
node demo.js
|
||||
|
||||
# Live mode
|
||||
node index.js
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
- 📋 Lists the 10 most recent bug issues (both open and closed)
|
||||
- 🐛 Shows issue state with emojis (🐛 for open, ✅ for closed)
|
||||
- 📅 Displays creation date, author, and current state
|
||||
- 🔗 Provides direct links to issues
|
||||
- 📝 Shows truncated descriptions
|
||||
- 📊 Provides a summary with open/closed counts
|
||||
|
||||
## Output Format
|
||||
|
||||
The tool displays issues in a formatted table with:
|
||||
- Issue number and title
|
||||
- Creation date and author
|
||||
- Current state (open/closed)
|
||||
- Direct link to the GitHub issue
|
||||
- Brief description
|
||||
- Summary statistics
|
||||
|
||||
## Files
|
||||
|
||||
- `demo.js` - Demo version with pre-fetched data (no API calls)
|
||||
- `index.js` - Live version that fetches data from GitHub API
|
||||
- `README.md` - This documentation
|
||||
- `package.json` - Package configuration
|
||||
|
||||
## Requirements
|
||||
|
||||
- Node.js (version specified in package.json engines)
|
||||
- Internet connection to access GitHub API (for live mode)
|
||||
- Optional: GitHub token for higher rate limits (for live mode)
|
||||
|
||||
## Configuration
|
||||
|
||||
The tool is configured to:
|
||||
- Target repository: `toeverything/AFFiNE`
|
||||
- Look for issues with the "Bug" label
|
||||
- Return the 10 most recent issues
|
||||
- Sort by creation date (newest first)
|
||||
|
||||
These settings can be modified in the source code if needed.
|
||||
|
||||
## Rate Limits
|
||||
|
||||
GitHub's API has rate limits:
|
||||
- Without authentication: 60 requests per hour
|
||||
- With GitHub token: 5000 requests per hour
|
||||
|
||||
The demo mode doesn't make any API calls, so it always works.
|
||||
198
tools/bug-issues/demo.js
Normal file
198
tools/bug-issues/demo.js
Normal file
@@ -0,0 +1,198 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
/**
|
||||
* Tool to list the ten most recent bug issues from the toeverything/AFFiNE repository
|
||||
* This demo version uses pre-fetched data to show functionality
|
||||
*/
|
||||
|
||||
// Demo data based on actual GitHub API results (fetched previously)
|
||||
const DEMO_BUG_ISSUES = [
|
||||
{
|
||||
"id": 3038375593,
|
||||
"number": 12128,
|
||||
"state": "open",
|
||||
"title": "[Bug]: Edgeless Export Frames as Image (PNG/SVG)",
|
||||
"user": {"login": "fallsdevil"},
|
||||
"created_at": "2025-05-05T01:02:39Z",
|
||||
"html_url": "https://github.com/toeverything/AFFiNE/issues/12128",
|
||||
"body": "A dedicated Export as Image action in Edgeless mode (whiteboard) that lets users download their canvas as PNG or SVG. It should offer: Export entire canvas, a specific frame, or custom selection..."
|
||||
},
|
||||
{
|
||||
"id": 3036740744,
|
||||
"number": 12115,
|
||||
"state": "open",
|
||||
"title": "[Bugt]: add a way to zoom without needing a middle mouse button",
|
||||
"user": {"login": "gabrielcamilo0321"},
|
||||
"created_at": "2025-05-02T19:59:44Z",
|
||||
"html_url": "https://github.com/toeverything/AFFiNE/issues/12115",
|
||||
"body": "add a way to zoom in edgeless mode without needing a middle mouse button, like a shortcut, for example shift or alt + left mouse button to zoom."
|
||||
},
|
||||
{
|
||||
"id": 2997331918,
|
||||
"number": 11719,
|
||||
"state": "closed",
|
||||
"title": "[Bug]: Web frontend ignores AFFINE_SERVER_SUB_PATH",
|
||||
"user": {"login": "jorne"},
|
||||
"created_at": "2025-04-15T19:03:06Z",
|
||||
"html_url": "https://github.com/toeverything/AFFiNE/issues/11719",
|
||||
"body": "I'm trying to make AFFiNE available under https://sub.mydomain.com/affine, using NPM as proxy. I've set AFFINE_SERVER_SUB_PATH=/affine in the env file."
|
||||
},
|
||||
{
|
||||
"id": 2991436697,
|
||||
"number": 11656,
|
||||
"state": "open",
|
||||
"title": "[Bug]: Attachment in database view is not visible on the shared view of the page",
|
||||
"user": {"login": "wikinikiwings"},
|
||||
"created_at": "2025-04-13T19:28:47Z",
|
||||
"html_url": "https://github.com/toeverything/AFFiNE/issues/11656",
|
||||
"body": "all types of attachments are visible on the shared page, but attachments in the database view - are not showing"
|
||||
},
|
||||
{
|
||||
"id": 2976574946,
|
||||
"number": 11515,
|
||||
"state": "open",
|
||||
"title": "[Bug]: Input text exceeds before character selection",
|
||||
"user": {"login": "Edit-Mr"},
|
||||
"created_at": "2025-04-07T11:40:45Z",
|
||||
"html_url": "https://github.com/toeverything/AFFiNE/issues/11515",
|
||||
"body": "When using a Chinese input method in the mind map, the input text exceeds the text box before character selection is completed."
|
||||
},
|
||||
{
|
||||
"id": 2769179704,
|
||||
"number": 9526,
|
||||
"state": "closed",
|
||||
"title": "journals's title(and its property) get lost after exporting and importing",
|
||||
"user": {"login": "happyZYM"},
|
||||
"created_at": "2025-01-05T09:00:48Z",
|
||||
"html_url": "https://github.com/toeverything/AFFiNE/issues/9526",
|
||||
"body": "I'm using the AppImage version. When I export a space and import it again, all the titles of journals are lost."
|
||||
},
|
||||
{
|
||||
"id": 2601277065,
|
||||
"number": 8559,
|
||||
"state": "closed",
|
||||
"title": "Loss folder information when import Workspace",
|
||||
"user": {"login": "Markche1985"},
|
||||
"created_at": "2024-10-21T04:23:25Z",
|
||||
"html_url": "https://github.com/toeverything/AFFiNE/issues/8559",
|
||||
"body": "when export and import workspace, the folder will loss(tag and documents are fine, but no folder)"
|
||||
},
|
||||
{
|
||||
"id": 2478006065,
|
||||
"number": 7937,
|
||||
"state": "closed",
|
||||
"title": "Linux App version bugged - JavaScript errors since last update",
|
||||
"user": {"login": "MindHack"},
|
||||
"created_at": "2024-08-21T13:09:50Z",
|
||||
"html_url": "https://github.com/toeverything/AFFiNE/issues/7937",
|
||||
"body": "Hi ! I am using the Linux app in up-to-date Fedora 40. It has ceased to work properly following the last update."
|
||||
},
|
||||
{
|
||||
"id": 2467318206,
|
||||
"number": 7881,
|
||||
"state": "closed",
|
||||
"title": "[bug] Opening Docs in new tabs redirects to app.affine.pro",
|
||||
"user": {"login": "compgeniuses"},
|
||||
"created_at": "2024-08-15T03:36:26Z",
|
||||
"html_url": "https://github.com/toeverything/AFFiNE/issues/7881",
|
||||
"body": "when you click the 3 dotted menu on a docs, and chose the option to open in new tab, the link tries to open using app.affine.pro instead of the localhosted instance"
|
||||
},
|
||||
{
|
||||
"id": 2458040625,
|
||||
"number": 7822,
|
||||
"state": "closed",
|
||||
"title": "Linked docs in the sidebar cannot be sorted or ordered",
|
||||
"user": {"login": "JimmFly"},
|
||||
"created_at": "2024-08-09T14:21:38Z",
|
||||
"html_url": "https://github.com/toeverything/AFFiNE/issues/7822",
|
||||
"body": "The order of Linked Docs in the sidebar does not match their original order in the article, and it is also not possible to rearrange them by dragging in the sidebar."
|
||||
}
|
||||
];
|
||||
|
||||
/**
|
||||
* Format a date to a readable string
|
||||
* @param {string} dateString - ISO date string
|
||||
* @returns {string} Formatted date
|
||||
*/
|
||||
function formatDate(dateString) {
|
||||
const date = new Date(dateString);
|
||||
return date.toLocaleDateString('en-US', {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Truncate text to a specified length
|
||||
* @param {string} text - Text to truncate
|
||||
* @param {number} maxLength - Maximum length
|
||||
* @returns {string} Truncated text
|
||||
*/
|
||||
function truncateText(text, maxLength = 100) {
|
||||
if (text.length <= maxLength) return text;
|
||||
return text.substring(0, maxLength - 3) + '...';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get issue state emoji
|
||||
* @param {string} state - Issue state (open/closed)
|
||||
* @returns {string} Emoji representation
|
||||
*/
|
||||
function getStateEmoji(state) {
|
||||
return state === 'open' ? '🐛' : '✅';
|
||||
}
|
||||
|
||||
/**
|
||||
* Display issues in a formatted table
|
||||
* @param {Array} issues - Array of issue objects
|
||||
*/
|
||||
function displayIssues(issues) {
|
||||
console.log('📋 Ten Most Recent Bug Issues in toeverything/AFFiNE\n');
|
||||
console.log('═'.repeat(100));
|
||||
|
||||
issues.forEach((issue, index) => {
|
||||
const stateEmoji = getStateEmoji(issue.state);
|
||||
const createdDate = formatDate(issue.created_at);
|
||||
const title = truncateText(issue.title, 60);
|
||||
const author = issue.user.login;
|
||||
|
||||
console.log(`${index + 1}. ${stateEmoji} #${issue.number} - ${title}`);
|
||||
console.log(` 📅 Created: ${createdDate} | 👤 Author: ${author} | 🏷️ State: ${issue.state}`);
|
||||
console.log(` 🔗 ${issue.html_url}`);
|
||||
|
||||
if (issue.body) {
|
||||
const description = truncateText(issue.body.replace(/\r?\n/g, ' '), 80);
|
||||
console.log(` 📝 ${description}`);
|
||||
}
|
||||
|
||||
console.log('');
|
||||
});
|
||||
|
||||
console.log('═'.repeat(100));
|
||||
console.log(`\n📊 Summary: Found ${issues.length} bug issues`);
|
||||
console.log(`🐛 Open: ${issues.filter(issue => issue.state === 'open').length}`);
|
||||
console.log(`✅ Closed: ${issues.filter(issue => issue.state === 'closed').length}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Main function
|
||||
*/
|
||||
function main() {
|
||||
console.log('🔧 Bug Issues Tool (Demo Mode)');
|
||||
console.log('Note: This demo uses pre-fetched data from the GitHub API\n');
|
||||
|
||||
displayIssues(DEMO_BUG_ISSUES);
|
||||
|
||||
console.log('\n💡 To use with live data, you can:');
|
||||
console.log(' - Set a GITHUB_TOKEN environment variable');
|
||||
console.log(' - Use the full version in index.js');
|
||||
console.log(' - Or run: node tools/bug-issues/index.js');
|
||||
}
|
||||
|
||||
// Run the script
|
||||
if (import.meta.url === `file://${process.argv[1]}`) {
|
||||
main();
|
||||
}
|
||||
|
||||
export { displayIssues, DEMO_BUG_ISSUES };
|
||||
162
tools/bug-issues/index.js
Normal file
162
tools/bug-issues/index.js
Normal file
@@ -0,0 +1,162 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import { readFileSync } from 'fs';
|
||||
import { join, dirname } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
/**
|
||||
* Tool to list the ten most recent bug issues from the toeverything/AFFiNE repository
|
||||
*/
|
||||
|
||||
// Configuration
|
||||
const OWNER = 'toeverything';
|
||||
const REPO = 'AFFiNE';
|
||||
const BUG_LABEL = 'Bug';
|
||||
const LIMIT = 10;
|
||||
|
||||
/**
|
||||
* Make a request to GitHub API using fetch
|
||||
* @param {string} url - API endpoint URL
|
||||
* @returns {Promise<any>} Response data
|
||||
*/
|
||||
async function githubApiRequest(url) {
|
||||
try {
|
||||
const headers = {
|
||||
'Accept': 'application/vnd.github.v3+json',
|
||||
'User-Agent': 'AFFiNE-Bug-Issues-Tool',
|
||||
};
|
||||
|
||||
// Add GitHub token if available
|
||||
if (process.env.GITHUB_TOKEN) {
|
||||
headers['Authorization'] = `token ${process.env.GITHUB_TOKEN}`;
|
||||
}
|
||||
|
||||
const response = await fetch(url, { headers });
|
||||
|
||||
if (!response.ok) {
|
||||
if (response.status === 403) {
|
||||
throw new Error(`Rate limit exceeded. Please set GITHUB_TOKEN environment variable or try again later.`);
|
||||
}
|
||||
throw new Error(`HTTP error! status: ${response.status} - ${response.statusText}`);
|
||||
}
|
||||
|
||||
return await response.json();
|
||||
} catch (error) {
|
||||
throw new Error(`GitHub API request failed: ${error.message}`);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Format a date to a readable string
|
||||
* @param {string} dateString - ISO date string
|
||||
* @returns {string} Formatted date
|
||||
*/
|
||||
function formatDate(dateString) {
|
||||
const date = new Date(dateString);
|
||||
return date.toLocaleDateString('en-US', {
|
||||
year: 'numeric',
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Truncate text to a specified length
|
||||
* @param {string} text - Text to truncate
|
||||
* @param {number} maxLength - Maximum length
|
||||
* @returns {string} Truncated text
|
||||
*/
|
||||
function truncateText(text, maxLength = 100) {
|
||||
if (text.length <= maxLength) return text;
|
||||
return text.substring(0, maxLength - 3) + '...';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get issue state emoji
|
||||
* @param {string} state - Issue state (open/closed)
|
||||
* @returns {string} Emoji representation
|
||||
*/
|
||||
function getStateEmoji(state) {
|
||||
return state === 'open' ? '🐛' : '✅';
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the most recent bug issues
|
||||
* @returns {Promise<Array>} Array of issue objects
|
||||
*/
|
||||
async function fetchBugIssues() {
|
||||
try {
|
||||
console.log(`Fetching the ${LIMIT} most recent bug issues from ${OWNER}/${REPO}...\n`);
|
||||
|
||||
// GitHub API endpoint for issues with label filter
|
||||
const url = `https://api.github.com/repos/${OWNER}/${REPO}/issues?labels=${encodeURIComponent(BUG_LABEL)}&state=all&sort=created&direction=desc&per_page=${LIMIT}`;
|
||||
|
||||
const issues = await githubApiRequest(url);
|
||||
|
||||
return issues;
|
||||
} catch (error) {
|
||||
console.error('Error fetching issues:', error.message);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display issues in a formatted table
|
||||
* @param {Array} issues - Array of issue objects
|
||||
*/
|
||||
function displayIssues(issues) {
|
||||
console.log('📋 Ten Most Recent Bug Issues in toeverything/AFFiNE\n');
|
||||
console.log('═'.repeat(100));
|
||||
|
||||
issues.forEach((issue, index) => {
|
||||
const stateEmoji = getStateEmoji(issue.state);
|
||||
const createdDate = formatDate(issue.created_at);
|
||||
const title = truncateText(issue.title, 60);
|
||||
const author = issue.user.login;
|
||||
|
||||
console.log(`${index + 1}. ${stateEmoji} #${issue.number} - ${title}`);
|
||||
console.log(` 📅 Created: ${createdDate} | 👤 Author: ${author} | 🏷️ State: ${issue.state}`);
|
||||
console.log(` 🔗 ${issue.html_url}`);
|
||||
|
||||
if (issue.body) {
|
||||
const description = truncateText(issue.body.replace(/\r?\n/g, ' '), 80);
|
||||
console.log(` 📝 ${description}`);
|
||||
}
|
||||
|
||||
console.log('');
|
||||
});
|
||||
|
||||
console.log('═'.repeat(100));
|
||||
console.log(`\n📊 Summary: Found ${issues.length} bug issues`);
|
||||
console.log(`🐛 Open: ${issues.filter(issue => issue.state === 'open').length}`);
|
||||
console.log(`✅ Closed: ${issues.filter(issue => issue.state === 'closed').length}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Main function
|
||||
*/
|
||||
async function main() {
|
||||
try {
|
||||
const issues = await fetchBugIssues();
|
||||
|
||||
if (issues.length === 0) {
|
||||
console.log('No bug issues found.');
|
||||
return;
|
||||
}
|
||||
|
||||
displayIssues(issues);
|
||||
} catch (error) {
|
||||
console.error('An unexpected error occurred:', error.message);
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
// Run the script
|
||||
if (import.meta.url === `file://${process.argv[1]}`) {
|
||||
main();
|
||||
}
|
||||
|
||||
export { fetchBugIssues, displayIssues };
|
||||
17
tools/bug-issues/package.json
Normal file
17
tools/bug-issues/package.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "@affine/bug-issues",
|
||||
"version": "0.22.4",
|
||||
"type": "module",
|
||||
"main": "index.js",
|
||||
"private": true,
|
||||
"description": "List the ten most recent bug issues from the GitHub repository",
|
||||
"scripts": {
|
||||
"demo": "node demo.js",
|
||||
"live": "node index.js",
|
||||
"start": "node demo.js"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.0.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user