[PR #43] [MERGED] Add multiple files per snippet #70

Closed
opened 2026-02-27 23:18:45 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/snibox/snibox/pull/43
Author: @GWillmann
Created: 4/8/2019
Status: Merged
Merged: 5/31/2019
Merged by: @vavgustov

Base: masterHead: pr/add-files-to-snippets


📝 Commits (10+)

  • eef5eab Add multiple files per snippet
  • 7a8808f Merge branch 'pr/add-files-to-snippets' of https://github.com/Kinoba/snibox into Kinoba-pr/add-files-to-snippets
  • 98779e6 Replaces chromedriver-helper gem by webdrivers gem
  • bf4d058 Snippet files improvements
  • 0c407ff Merge branch 'pr/add-files-to-snippets' of https://github.com/Kinoba/snibox into Kinoba-pr/add-files-to-snippets
  • 7d83d4c Use 'main' as default file name for snippet -> snippet file conversion.
  • ecd2794 Make collapsible link more simple. Remove semicolons.
  • 118bb1a Fixed markdown view and copy to clipboard for show mode. Various experimental UI improvements for show mode.
  • cd199c8 Fixed language syntax highlighting for markdown files. Fixed copy to clipboard for collapsed files.
  • ad53f56 One more fix for collapsed + copy workflow.

📊 Changes

46 files changed (+886 additions, -257 deletions)

View changed files

📝 Gemfile (+1 -1)
📝 Gemfile.lock (+5 -7)
📝 app/controllers/api/v1/data_controller.rb (+4 -1)
📝 app/controllers/api/v1/snippets_controller.rb (+7 -2)
📝 app/javascript/packs/common.js (+3 -0)
📝 app/javascript/snibox/api/backend.js (+22 -9)
app/javascript/snibox/components/CollapsibleControls.vue (+41 -0)
📝 app/javascript/snibox/components/Repository.vue (+4 -0)
📝 app/javascript/snibox/components/SearchBox.vue (+6 -5)
📝 app/javascript/snibox/components/snippet/Form.vue (+61 -65)
📝 app/javascript/snibox/components/snippet/Show.vue (+26 -68)
app/javascript/snibox/components/snippet_file/Form.vue (+184 -0)
app/javascript/snibox/components/snippet_file/Show.vue (+112 -0)
📝 app/javascript/snibox/mixins/editor.js (+2 -2)
📝 app/javascript/snibox/mixins/factory.js (+8 -4)
📝 app/javascript/snibox/store/helpers.js (+18 -7)
📝 app/javascript/snibox/store/mutations.js (+46 -7)
📝 app/javascript/snibox/store/state.js (+5 -4)
📝 app/javascript/snibox/utils/highlighter_helper.js (+2 -3)
📝 app/javascript/snibox/utils/notifications.js (+2 -2)

...and 26 more files

📄 Description

What an awesome project Snibox is! I hope my contribution make it even better.

This PR adds support of multiple files per snippet.
We needed this kind of feature at Kinoba and I saw that several people wanted it also

I added the following model: SnippetFile which belong_to a Snippet.
Also I was inspired by GitHub's snippet system and I replace the Snippet title by a description.

I also changed the tests according to the new structure and added new ones:

  • Add a snippet file
  • Remove a snippet file

I am not extremely happy with the design I came up when one edits a Snippet, if you guys have some suggestions I'd be happy to change it.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/snibox/snibox/pull/43 **Author:** [@GWillmann](https://github.com/GWillmann) **Created:** 4/8/2019 **Status:** ✅ Merged **Merged:** 5/31/2019 **Merged by:** [@vavgustov](https://github.com/vavgustov) **Base:** `master` ← **Head:** `pr/add-files-to-snippets` --- ### 📝 Commits (10+) - [`eef5eab`](https://github.com/snibox/snibox/commit/eef5eab3fa9820d833056b5293eadbc6a66b31fb) Add multiple files per snippet - [`7a8808f`](https://github.com/snibox/snibox/commit/7a8808fac1e0d81acfd8d04c39b564e02fb80190) Merge branch 'pr/add-files-to-snippets' of https://github.com/Kinoba/snibox into Kinoba-pr/add-files-to-snippets - [`98779e6`](https://github.com/snibox/snibox/commit/98779e6da28491a317cf7e909ae38b88cc8b957a) Replaces chromedriver-helper gem by webdrivers gem - [`bf4d058`](https://github.com/snibox/snibox/commit/bf4d05873a101a19b209ca3f4744954ae299e0ee) Snippet files improvements - [`0c407ff`](https://github.com/snibox/snibox/commit/0c407ffcd0acd46eaefdac225c840373fc2f7db1) Merge branch 'pr/add-files-to-snippets' of https://github.com/Kinoba/snibox into Kinoba-pr/add-files-to-snippets - [`7d83d4c`](https://github.com/snibox/snibox/commit/7d83d4c400da0c649a923f18a47def8bcb5c3a69) Use 'main' as default file name for snippet -> snippet file conversion. - [`ecd2794`](https://github.com/snibox/snibox/commit/ecd2794a553343bc5b78206f215a5baf77a924b8) Make collapsible link more simple. Remove semicolons. - [`118bb1a`](https://github.com/snibox/snibox/commit/118bb1a73c3a2072cd18a9ac951ed428f262fd2f) Fixed markdown view and copy to clipboard for show mode. Various experimental UI improvements for show mode. - [`cd199c8`](https://github.com/snibox/snibox/commit/cd199c81f7f89b4e944b2b03a7b6ce0ec6a9f2f0) Fixed language syntax highlighting for markdown files. Fixed copy to clipboard for collapsed files. - [`ad53f56`](https://github.com/snibox/snibox/commit/ad53f56cc270ff82376d9fe9a7c109b08588232d) One more fix for collapsed + copy workflow. ### 📊 Changes **46 files changed** (+886 additions, -257 deletions) <details> <summary>View changed files</summary> 📝 `Gemfile` (+1 -1) 📝 `Gemfile.lock` (+5 -7) 📝 `app/controllers/api/v1/data_controller.rb` (+4 -1) 📝 `app/controllers/api/v1/snippets_controller.rb` (+7 -2) 📝 `app/javascript/packs/common.js` (+3 -0) 📝 `app/javascript/snibox/api/backend.js` (+22 -9) ➕ `app/javascript/snibox/components/CollapsibleControls.vue` (+41 -0) 📝 `app/javascript/snibox/components/Repository.vue` (+4 -0) 📝 `app/javascript/snibox/components/SearchBox.vue` (+6 -5) 📝 `app/javascript/snibox/components/snippet/Form.vue` (+61 -65) 📝 `app/javascript/snibox/components/snippet/Show.vue` (+26 -68) ➕ `app/javascript/snibox/components/snippet_file/Form.vue` (+184 -0) ➕ `app/javascript/snibox/components/snippet_file/Show.vue` (+112 -0) 📝 `app/javascript/snibox/mixins/editor.js` (+2 -2) 📝 `app/javascript/snibox/mixins/factory.js` (+8 -4) 📝 `app/javascript/snibox/store/helpers.js` (+18 -7) 📝 `app/javascript/snibox/store/mutations.js` (+46 -7) 📝 `app/javascript/snibox/store/state.js` (+5 -4) 📝 `app/javascript/snibox/utils/highlighter_helper.js` (+2 -3) 📝 `app/javascript/snibox/utils/notifications.js` (+2 -2) _...and 26 more files_ </details> ### 📄 Description What an awesome project Snibox is! I hope my contribution make it even better. This PR adds support of **multiple files per snippet**. We needed this kind of feature at Kinoba and I saw that [several people wanted it also](https://github.com/snibox/snibox/issues/6#issue-338351375) I added the following model: `SnippetFile` which belong_to a `Snippet`. Also I was inspired by GitHub's snippet system and I replace the Snippet title by a description. I also changed the tests according to the new structure and added new ones: - Add a snippet file - Remove a snippet file I am not extremely happy with the design I came up when one edits a `Snippet`, if you guys have some suggestions I'd be happy to change it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 23:18:45 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/snibox#70
No description provided.